Skip to content

Commit

Permalink
Rename gem-print-link and gem-print-links-within
Browse files Browse the repository at this point in the history
The component wrapper helper doesn't like this class, so we've agreed to rename it.
  • Loading branch information
AshGDS committed Nov 7, 2024
1 parent a2285ef commit 02ba082
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

## Unreleased

* Rename gem-print-link and gem-print-links-within ([PR #4375](https://github.com/alphagov/govuk_publishing_components/pull/4375))
* Add GA4 tracking for search autocomplete ([PR #4371](https://github.com/alphagov/govuk_publishing_components/pull/4371))
* Append no-actions class to rows without actions in Summary Cards ([PR #4368](https://github.com/alphagov/govuk_publishing_components/pull/4368))
* Search with autocomplete: Work around Enter edge case ([PR #4372](https://github.com/alphagov/govuk_publishing_components/pull/4372))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
// to black, reduce the font size, and improve the layout
// of the printed href.
//
// .gem-print-link
// .gem-c-print-link
// ----------------------------------------------------------
// Typically this class will be applied to existing
// elements that have the `govuk-link` class but it can
// also be used on other link elements.
//
// .gem-print-links-within
// .gem-c-print-links-within
// ----------------------------------------------------------
// A variation of the previous print style, to be used on
// parent elements that contain links with the `govuk-link`
Expand All @@ -52,8 +52,8 @@

// stylelint-disable declaration-no-important
@include govuk-media-query($media-type: print) {
.gem-print-link,
.gem-print-links-within .govuk-link {
.gem-c-print-link,
.gem-c-print-links-within .govuk-link {
&,
&:link,
&:visited {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
css_classes << "gem-c-action-link--mobile-subtext" if mobile_subtext
css_classes << shared_helper.get_margin_bottom

link_classes = %w(govuk-link gem-c-action-link__link gem-print-link)
link_classes = %w(govuk-link gem-c-action-link__link gem-c-print-link)
link_classes << "govuk-link--inverse" if inverse

component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<%= content_tag("h#{sub_heading_level}", class: "gem-c-cards__sub-heading govuk-heading-s") do %>
<%=
link_to link[:text], link[:path],
class: "govuk-link gem-c-cards__link gem-print-link",
class: "govuk-link gem-c-cards__link gem-c-print-link",
data: link[:data_attributes]
%>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new(local_assigns)
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)

link_classes = %w[gem-c-contents-list__link govuk-link gem-print-link]
link_classes = %w[gem-c-contents-list__link govuk-link gem-c-print-link]
link_classes << brand_helper.color_class
link_classes << "govuk-link--no-underline" unless underline_links

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<% if devolved_nations_helper.nations_with_urls.any? %>
<%= content_tag :ul, class: "govuk-list govuk-!-margin-top-1 govuk-!-margin-bottom-0" do -%>
<% devolved_nations_helper.nations_with_urls.each do |k, v| %>
<%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link gem-print-link")) %>
<%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link gem-c-print-link")) %>
<% end %>
<% end %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
item[:link][:text],
item[:link][:path],
data: item[:link][:data_attributes],
class: "#{item_classes} govuk-link gem-print-link #{extra_link_classes}",
class: "#{item_classes} govuk-link gem-c-print-link #{extra_link_classes}",
lang: item[:link][:locale].presence,
rel: rel,
)
Expand Down Expand Up @@ -118,7 +118,7 @@
part[:link][:text],
part[:link][:path],
data: part[:link][:data_attributes],
class: "gem-c-document-list-child__heading gem-c-document-list-child__link #{brand_helper.color_class} govuk-link gem-print-link #{extra_link_classes}",
class: "gem-c-document-list-child__heading gem-c-document-list-child__link #{brand_helper.color_class} govuk-link gem-c-print-link #{extra_link_classes}",
)
else
content_tag(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
heading_link_classes = %w[
gem-c-image-card__title-link
govuk-link
gem-print-link
gem-c-print-link
]
heading_link_classes << brand_helper.color_class
heading_link_classes << "gem-c-image-card__title-link--large-font-size-mobile" if card_helper.large_mobile_font_size?
extra_link_classes = %w[
gem-c-image-card__list-item-link
govuk-link
gem-print-link
gem-c-print-link
]
extra_link_classes << brand_helper.color_class

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
margin_bottom: margin_bottom
})

classes = %w[gem-c-inset-text govuk-inset-text gem-print-links-within]
classes << shared_helper.get_margin_top
classes << shared_helper.get_margin_bottom
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class("gem-c-inset-text govuk-inset-text gem-c-print-links-within")
component_helper.add_class(shared_helper.get_margin_top)
component_helper.add_class(shared_helper.get_margin_bottom)

%>
<%= tag.div id: id, class: classes do %>
<%= tag.div(**component_helper.all_attributes) do %>
<% if defined? text %>
<%= text %>
<% elsif block_given? %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
data_attributes[:ga4_intervention_banner] = "" unless disable_ga4 # Added to the parent element for the GA4 pageview object to use

suggestion_tag_options = {
class: "govuk-link gem-print-link",
class: "govuk-link gem-c-print-link",
href: suggestion_link_url,
data: suggestion_data_attributes,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<strong class="gem-c-step-nav-header__part-of">Part of</strong>
<% if path %>
<a href="<%= path %>"
class="gem-c-step-nav-header__title govuk-link gem-print-link"
class="gem-c-step-nav-header__title govuk-link gem-c-print-link"
<% unless disable_ga4 %>
data-ga4-link='<%= ga4_data %>'
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<span class="gem-c-step-nav-related__pretitle"><%= pretitle %></span>
<% if links.length == 1 && !always_display_as_list %>
<a href="<%= links[0][:href] %>"
class="govuk-link gem-print-link"
class="govuk-link gem-c-print-link"
<% unless disable_ga4
ga4_attributes = {
event_name: "navigation",
Expand All @@ -37,7 +37,7 @@
<% links.each_with_index do |link, index| %>
<li class="gem-c-step-nav-related__link-item">
<a href="<%= link[:href] %>"
class="govuk-link gem-print-link"
class="govuk-link gem-c-print-link"
<% unless disable_ga4
ga4_attributes = {
event_name: "navigation",
Expand Down

0 comments on commit 02ba082

Please sign in to comment.