Sha256: 7b4a8c40983f8fd21838be72dcea5177c0623da559e505bfdb176ff899455697
Contents?: true
Size: 1.68 KB
Versions: 140
Compression:
Stored size: 1.68 KB
Contents
<% add_gem_component_stylesheet("big-number") 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
140 entries across 140 versions & 1 rubygems