Module: Markawesome::IconAttributes
- Defined in:
- lib/markawesome/icon_attributes.rb
Overview
Shared <wa-icon> attribute vocabulary (family/variant/animation) and emission helper. Values verified against Web Awesome 3.x. Adding a value later is a one-line change.
Constant Summary collapse
- SCHEMA =
{ family: %w[classic sharp duotone sharp-duotone brands], variant: %w[thin light regular solid], animation: %w[beat fade beat-fade bounce flip shake spin spin-pulse spin-reverse] }.freeze
Class Method Summary collapse
-
.pairs(attributes) ⇒ Object
Returns ordered [‘family=“…”’, ‘variant=“…”’, ‘animation=“…”’] for present keys.
Class Method Details
.pairs(attributes) ⇒ Object
Returns ordered [‘family=“…”’, ‘variant=“…”’, ‘animation=“…”’] for present keys.
14 15 16 17 18 |
# File 'lib/markawesome/icon_attributes.rb', line 14 def self.pairs(attributes) %i[family variant animation].filter_map do |key| "#{key}=\"#{attributes[key]}\"" if attributes[key] end end |