Class: FA::Layer
Overview
FontAwesome 5 (Pro) Helper for generating layered icons and spans
Direct Known Subclasses
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(icons = [], title: nil, grow: 0, css: '') ⇒ Layer
constructor
Creates a new Layer instance.
-
#raw ⇒ Object
Outputs the formatted stack of icons and spans directly.
Methods inherited from Base
Constructor Details
#initialize(icons = [], title: nil, grow: 0, css: '') ⇒ Layer
Creates a new Layer instance
Add icons or spans to the stack from bottom to top
Note: scaling counters does not work well with :grow, so should use the older “fa-3x” syntax in :css instead.
17 18 19 20 21 22 |
# File 'lib/fa/layer.rb', line 17 def initialize(icons = [], title: nil, grow: 0, css: '') @icons = icons @title = title @grow = grow @css = css end |
Instance Method Details
#raw ⇒ Object
Outputs the formatted stack of icons and spans directly.
25 26 27 28 29 30 31 32 |
# File 'lib/fa/layer.rb', line 25 def raw @icons.each do |i| i[:options] = (i, combine_grows(i, @grow)) i[:options][:title] = @title end build { parse_all(@icons).join } end |