4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/irelia/options/padding.rb', line 4
def self.included(base)
base.class_eval do
option :padding, default: -> { nil }, in: [ :none, :sm, :md, :lg ]
option :padding_top, default: -> { nil }, in: [ :none, :sm, :md, :lg ]
option :padding_right, default: -> { nil }, in: [ :none, :sm, :md, :lg ]
option :padding_bottom, default: -> { nil }, in: [ :none, :sm, :md, :lg ]
option :padding_left, default: -> { nil }, in: [ :none, :sm, :md, :lg ]
after_initialize do
add_css_classes(
class_names(
"irelia-padding-none": padding == :none,
"irelia-padding-sm": padding == :sm,
"irelia-padding-md": padding == :md,
"irelia-padding-lg": padding == :lg,
"irelia-padding-top-none": padding_top == :none,
"irelia-padding-top-sm": padding_top == :sm,
"irelia-padding-top-md": padding_top == :md,
"irelia-padding-top-lg": padding_top == :lg,
"irelia-padding-right-none": padding_right == :none,
"irelia-padding-right-sm": padding_right == :sm,
"irelia-padding-right-md": padding_right == :md,
"irelia-padding-right-lg": padding_right == :lg,
"irelia-padding-left-none": padding_left == :none,
"irelia-padding-left-sm": padding_left == :sm,
"irelia-padding-left-md": padding_left == :md,
"irelia-padding-left-lg": padding_left == :lg,
"irelia-padding-bottom-none": padding_bottom == :none,
"irelia-padding-bottom-sm": padding_bottom == :sm,
"irelia-padding-bottom-md": padding_bottom == :md,
"irelia-padding-bottom-lg": padding_bottom == :lg,
)
)
end
end
end
|