Sha256: 08e2c2051a0edf8ff740d529b314c58aeee8f43055fd9b4ce800b804c30f07dc

Contents?: true

Size: 858 Bytes

Versions: 135

Compression:

Stored size: 858 Bytes

Contents

<%
  average_title_length ||= false
  context ||= false
  context_text = context.is_a?(Hash) ? context[:text] : context
  context_href = context.is_a?(Hash) ? context[:href] : false
  context_data = context.is_a?(Hash) ? context[:data] : false

  inverse ||= false
  margin_bottom ||= 5
  margin_bottom_class = "gem-c-title--margin-bottom-#{margin_bottom}" if [4, 5].include? margin_bottom
%>
<div class="gem-c-title
  <% if inverse %>gem-c-title--inverse<% end %>
  <%= margin_bottom_class %>">
  <% if context %>
    <p class="gem-c-title__context">
      <%= context_href ? link_to(context_text, context_href, class: 'gem-c-title__context-link', data: context_data) : context_text %>
    </p>
  <% end %>
  <h1 class="gem-c-title__text <% if average_title_length %>gem-c-title__text--<%= average_title_length %><% end %>">
    <%= title %>
  </h1>
</div>

Version data entries

135 entries across 135 versions & 1 rubygems

Version Path
govuk_publishing_components-13.5.4 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.5.3 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.5.2 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.5.1 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.5.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.4.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.3.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.2.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.1 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-13.0.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.21.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.20.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.19.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.18.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.17.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.16.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.15.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.14.1 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.14.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-12.13.0 app/views/govuk_publishing_components/components/_title.html.erb