Class: DesignSystem::Generic::Builders::Heading

Inherits:
Base
  • Object
show all
Defined in:
lib/design_system/generic/builders/heading.rb

Overview

This class provides generic methods to display headings in page content.

Constant Summary collapse

SIZE_MAPPING =
{
  1 => 'xl',
  2 => 'l',
  3 => 'm',
  4 => 's',
  5 => 'xs',
  6 => 'xs'
}.freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Helpers::CssHelper

#css_class_options_merge

Methods included from Concerns::BrandDerivable

#brand

Constructor Details

This class inherits a constructor from DesignSystem::Generic::Builders::Base

Instance Method Details

#render_heading(text, level: 2, **options) ⇒ Object



17
18
19
# File 'lib/design_system/generic/builders/heading.rb', line 17

def render_heading(text, level: 2, **options)
  ("h#{level}", text, class: classes(level), **options)
end