Module: Voom::Presenters::DSL::Components::Mixins::Typography

Includes:
Append
Included in:
Form, Voom::Presenters::DSL::Components::Menu::Item, Common, PageTitle, Table::Row::Column
Defined in:
lib/voom/presenters/dsl/components/mixins/typography.rb

Instance Method Summary collapse

Methods included from Append

#<<, #yield_to

Instance Method Details

#blank(level: 1, **attributes, &block) ⇒ Object



90
91
92
93
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 90

def blank(level: 1, **attributes, &block)
  self << Components::Typography.new(parent: self, type: :body, text: ['&nbsp;'], level: level,
                                     **attributes, &block)
end

#body(*text, level: 1, **attributes, &block) ⇒ Object



76
77
78
79
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 76

def body(*text, level: 1, **attributes, &block)
  self << Components::Typography.new(parent: self, type: :body, text: text, level: level,
                                     **attributes, &block)
end

#body2(*text, level: 2, **attributes, &block) ⇒ Object



81
82
83
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 81

def body2(*text, level: 2, **attributes, &block)
  body(*text, level: level, **attributes, &block)
end

#caption(*text, **attributes, &block) ⇒ Object



95
96
97
98
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 95

def caption(*text, **attributes, &block)
  self << Components::Typography.new(parent: self, type: :caption, text: text,
                                     **attributes, &block)
end

#headline(*text, level: nil, **attributes, &block) ⇒ Object Also known as: heading, display



9
10
11
12
13
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 9

def headline(*text, level: nil, **attributes, &block)
  self << Components::Typography.new(parent: self, type: :headline, text: text,
                                     level: level || Settings.default(:headline, :level),
                                     **attributes, &block)
end

#headline1(*text, level: nil, **attributes, &block) ⇒ Object Also known as: heading1



15
16
17
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 15

def headline1(*text, level: nil, **attributes, &block)
  headline(*text, level: 1, **attributes, &block)
end

#headline2(*text, level: nil, **attributes, &block) ⇒ Object Also known as: heading2



21
22
23
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 21

def headline2(*text, level: nil, **attributes, &block)
  headline(*text, level: 2, **attributes, &block)
end

#headline3(*text, level: nil, **attributes, &block) ⇒ Object Also known as: heading3



27
28
29
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 27

def headline3(*text, level: nil, **attributes, &block)
  headline(*text, level: 3, **attributes, &block)
end

#headline4(*text, level: nil, **attributes, &block) ⇒ Object Also known as: heading4



33
34
35
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 33

def headline4(*text, level: nil, **attributes, &block)
  headline(*text, level: 4, **attributes, &block)
end

#headline5(*text, level: nil, **attributes, &block) ⇒ Object Also known as: heading5



39
40
41
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 39

def headline5(*text, level: nil, **attributes, &block)
  headline(*text, level: 5, **attributes, &block)
end

#headline6(*text, level: nil, **attributes, &block) ⇒ Object Also known as: heading6



45
46
47
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 45

def headline6(*text, level: nil, **attributes, &block)
  headline(*text, level: 6, **attributes, &block)
end


109
110
111
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 109

def link(text, url, **attributes, &block)
  self << Components::Link.new(parent: self, text: text, url: url, **attributes, &block)
end

#overline(*text, **attributes, &block) ⇒ Object



100
101
102
103
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 100

def overline(*text, **attributes, &block)
  self << Components::Typography.new(parent: self, type: :overline, text: text,
                                     **attributes, &block)
end

#page_title(*text, **attributes, &block) ⇒ Object



72
73
74
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 72

def page_title(*text, **attributes, &block)
  self << Components::PageTitle.new(parent: self, text: text, level: 1, **attributes, &block)
end

#separator(**attributes, &block) ⇒ Object



105
106
107
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 105

def separator(**attributes, &block)
  self << Components::Separator.new(parent: self, **attributes, &block)
end

#subtitle(*text, level: 1, **attributes, &block) ⇒ Object Also known as: subtitle1, subheading



59
60
61
62
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 59

def subtitle(*text, level: 1, **attributes, &block)
  self << Components::Typography.new(parent: self, type: :subtitle, text: text, level: level,
                                     **attributes, &block)
end

#subtitle2(*text, level: 2, **attributes, &block) ⇒ Object



66
67
68
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 66

def subtitle2(*text, level: 2, **attributes, &block)
  subtitle(*text, level: level, **attributes, &block)
end

#text(*text, level: 1, **attributes, &block) ⇒ Object



85
86
87
88
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 85

def text(*text, level: 1, **attributes, &block)
  return @text if defined? @text
  body(*text, level: 1, **attributes, &block)
end

#title(*text, level: nil, **attributes, &block) ⇒ Object



55
56
57
# File 'lib/voom/presenters/dsl/components/mixins/typography.rb', line 55

def title(*text, level: nil, **attributes, &block)
  headline(text, level: level || Settings.default(:title, :level), **attributes, &block)
end