Class: DesignSystem::Generic::Builders::Paragraph
- Defined in:
- lib/design_system/generic/builders/paragraph.rb
Overview
This class provides generic methods to display paragraphs with typography styles.
Direct Known Subclasses
DesignSystem::Govuk::Builders::Paragraph, Nhsuk::Builders::Paragraph
Constant Summary collapse
- FONT_SIZES =
%i[s].freeze
Instance Method Summary collapse
Methods inherited from Base
Methods included from Helpers::CssHelper
Methods included from Concerns::BrandDerivable
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, **, &block) content = block_given? ? capture(&block) : text return if content.blank? content_tag('p', content, class: classes(size), **) end |