app/pb_kits/playbook/props.rb in playbook_ui-6.0.1 vs app/pb_kits/playbook/props.rb in playbook_ui-6.1.0.pre.alpha1
- old
+ new
@@ -41,15 +41,20 @@
spacing_value = send(k)
"#{spacing_options[k]}_#{spacing_value}" if spacing_values.include? spacing_value
end.compact.join(" ")
end
+ def dark_props
+ dark ? "dark" : nil
+ end
+
def generate_classname(*name_parts, separator: "_")
[
name_parts.compact.join(separator),
prop(:classname),
spacing_props,
+ dark_props
].compact.join(" ")
end
def generate_classname_without_spacing(*name_parts, separator: "_")
[
@@ -79,9 +84,10 @@
prop :padding_left
prop :padding_right
prop :padding_top
prop :padding_x
prop :padding_y
+ prop :dark, type: Playbook::Props::Boolean, default: false
end
def spacing_options
{
margin: "m",