Sha256: 15d86ce821a2dcdeb5d40aa269827fe42b94f8e0114c5da43e14014711a67eca
Contents?: true
Size: 1.64 KB
Versions: 79
Compression:
Stored size: 1.64 KB
Contents
<% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) big_number_helper = GovukPublishingComponents::Presenters::BigNumberHelper.new(local_assigns) number ||= false label ||= nil href ||= nil data_attributes ||= nil aria ||= nil classes = ["gem-c-big-number"] classes << shared_helper.get_margin_bottom value_classes = big_number_helper.value_classes %> <% if number %> <% big_number_value = capture do %> <%= tag.span class: value_classes, data: href ? nil : data_attributes do %> <% # The below check is to account for small symbols awkwardly sitting above the baseline in our typeface and adjust them to sit at the baseline for the purpose of visual harmony # Currently the only small symbol used with big numbers are pluses so they are specifically applied in the below code %> <% if big_number_helper.number_has_plus_suffix? %> <%= number[0...-1] %><%= tag.span "+", class: "gem-c-big-number__suffix" %> <% else %> <%= number %> <% end %> <% end %> <% unless label.nil? %> <% # add a virtual space here to handle screen readers printing dictations without a space between the number and the label %> <span class="govuk-visually-hidden"> </span> <span class="gem-c-big-number__label"> <%= label %> </span> <% end %> <% end %> <%= tag.div class: classes, aria: aria do %> <% unless href.nil? %> <%= link_to big_number_value, href, class: "govuk-link gem-c-big-number__link", data: data_attributes %> <% else %> <%= big_number_value %> <% end %> <% end %> <% end %>
Version data entries
79 entries across 79 versions & 1 rubygems