Sha256: a01dedb85a16fa0caf256b7bb3c9f6c8713a32f0c77a484a1a49716bf17f8c54

Contents?: true

Size: 882 Bytes

Versions: 1

Compression:

Stored size: 882 Bytes

Contents

<%
  average_title_length ||= false

  context ||= false
  context_locale ||= false

  inverse ||= false
  local_assigns[:margin_top] ||= 8
  local_assigns[:margin_bottom] ||= 8

  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)

  classes = %w[gem-c-title]
  classes << "gem-c-title--inverse" if inverse
  classes << (shared_helper.get_margin_top)
  classes << (shared_helper.get_margin_bottom)

  heading_classes = %w[gem-c-title__text]
  heading_classes << (average_title_length.present? ? 'govuk-heading-l' : 'govuk-heading-xl')
%>
<%= content_tag(:div, class: classes) do %>
  <% if context %>
    <span class="govuk-caption-xl gem-c-title__context" <%= "lang=#{context_locale}" if context_locale.present? %>>
      <%= context %>
    </span>
  <% end %>
  <h1 class="<%= heading_classes.join(" ") %>">
    <%= title %>
  </h1>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govuk_publishing_components-25.0.0 app/views/govuk_publishing_components/components/_title.html.erb