Class: DesignSystem::Generic::Builders::Paragraph

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

Overview

This class provides generic methods to display paragraphs with typography styles.

Constant Summary collapse

FONT_SIZES =
%i[s].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_paragraph(text = nil, size: nil, **options, &block) ⇒ Object



10
11
12
13
14
15
# File 'lib/design_system/generic/builders/paragraph.rb', line 10

def render_paragraph(text = nil, size: nil, **options, &block)
  content = block_given? ? capture(&block) : text
  return if content.blank?

  ('p', content, class: classes(size), **options)
end