create border margins constant
MODIFY
lib/primer/classify.rb
lib/primer/classify.rb
@@ -77,7 +77,8 @@ module Primer
]
}
}.freeze
- BORDER_KEYS = [:border, :border_color, :border_top, :border_bottom, :border_left, :border_right].freeze
+ BORDER_KEYS = [:border, :border_color].freeze
+ BORDER_MARGIN_KEYS = [:border_top, :border_bottom, :border_left, :border_right].freeze
TYPOGRAPHY_KEYS = [:font_size].freeze
VALID_KEYS = (
CONCAT_KEYS +
@@ -170,7 +171,6 @@ module Primer
end
dasherized_val = val.to_s.dasherize
- dasherized_key = key.to_s.dasherize
breakpoint = BREAKPOINTS[index]
@@ -197,11 +197,9 @@ module Primer
elsif key == WORD_BREAK_KEY
memo[:classes] << "wb-#{dasherized_val}"
elsif BORDER_KEYS.include?(key)
- if (key == :border || key == :border_color)
memo[:classes] << "border-#{dasherized_val}"
- else
- memo[:classes] << "#{dasherized_key}-#{val}"
- end
+ elsif BORDER_MARGIN_KEYS.include?(key)
+ memo[:classes] << "#{key.to_s.dasherize}-#{val}"
elsif key == DIRECTION_KEY
memo[:classes] << "flex#{breakpoint}-#{dasherized_val}"
elsif key == JUSTIFY_CONTENT_KEY

create border margins constant