Skip to content

Commit

Permalink
Add conditional modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalejandroaguilar committed Sep 24, 2024
1 parent 4746d52 commit c9717eb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/phlexy_ui/class_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit c9717eb

Please sign in to comment.