Module: Irelia::Options::Width

Included in:
Button::Component, Card::Component, Div::Component, Flex::Component
Defined in:
lib/irelia/options/width.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/irelia/options/width.rb', line 4

def self.included(base)
  base.class_eval do
    option :width, default: -> { nil }, in: [ :full ]

    after_initialize do
      add_css_classes(
        class_names(
          "irelia-width-full": width == :full
        )
      )
    end
  end
end