Class: DesignSystem::Nhsuk::Builders::InsetText
- Inherits:
-
Generic::Builders::InsetText
- Object
- Generic::Builders::Base
- Generic::Builders::InsetText
- DesignSystem::Nhsuk::Builders::InsetText
- Defined in:
- lib/design_system/nhsuk/builders/inset_text.rb
Overview
This generates html for rendering inset text for Nhsuk
Instance Method Summary collapse
Methods inherited from Generic::Builders::Base
Methods included from Helpers::CssHelper
Methods included from Generic::Builders::Concerns::BrandDerivable
Constructor Details
This class inherits a constructor from DesignSystem::Generic::Builders::Base
Instance Method Details
#render_inset_text(text = nil, **options) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/design_system/nhsuk/builders/inset_text.rb', line 8 def render_inset_text(text = nil, **, &) content = block_given? ? capture(&) : text return if content.blank? wrapped_content = block_given? ? content : content_tag(:p, content) = (, ["#{brand}-inset-text"]) content_tag(:div, **) do content_tag(:span, 'Information: ', class: "#{brand}-u-visually-hidden") + wrapped_content end end |