diff --git a/lib/phlexy_ui/class_list.rb b/lib/phlexy_ui/class_list.rb index b7cd968..b731f13 100644 --- a/lib/phlexy_ui/class_list.rb +++ b/lib/phlexy_ui/class_list.rb @@ -19,6 +19,7 @@ def to_a classes = [] add_component_class(classes) add_selected_modifiers_classes(classes) + add_conditioned_modifiers_classes(classes) add_responsive_modifiers_classes(classes) add_class_option_classes(classes) classes @@ -46,6 +47,14 @@ def add_selected_modifiers_classes(classes) ) end + def add_conditioned_modifiers_classes(classes) + modifiers_map.each do |modifier, class_name| + next unless options.delete(modifier) + + classes << with_config_prefix(class_name) + end + end + def html_classes_for_modifiers(modifiers, responsive_prefix: nil) modifiers.map do |modifier| with_responsive_prefix(