Class: DesignSystem::Generic::Builders::InsetText

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

Overview

This generates html for rendering inset text to help users identify and understand important content on the page.

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_inset_text(text = nil, **options) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/design_system/generic/builders/inset_text.rb', line 8

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

  div_options = css_class_options_merge(options, ["#{brand}-inset-text"])
  (:div, content, **div_options)
end