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-17.11.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.10.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.9.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.8.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.7.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.6.1 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.6.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.5.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.4.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.3.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.2.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.1.1 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.1.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-17.0.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-16.29.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-16.28.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-16.27.1 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-16.27.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-16.26.0 app/views/govuk_publishing_components/components/_title.html.erb
govuk_publishing_components-16.25.0 app/views/govuk_publishing_components/components/_title.html.erb