From e6d295ae06d0f8bc07e94b1f487d920278363693 Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:49:18 +0100 Subject: [PATCH] Remove brand colour link class and make branded share icons black --- .../components/_share-links.scss | 4 +++ .../components/helpers/_brand-colours.scss | 33 +------------------ .../components/_share_links.html.erb | 3 +- .../components/docs/share_links.yml | 6 ++-- spec/components/share_links_spec.rb | 9 +++-- 5 files changed, 16 insertions(+), 39 deletions(-) diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss b/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss index 5b43a550d6..eaa9188363 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss @@ -115,3 +115,7 @@ $column-width: 9.5em; @include govuk-font(19, $weight: bold); } } + +.gem-c-share-links--black { + color: govuk-colour("black"); +} diff --git a/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss b/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss index 454e6d29aa..ef7589f7d8 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss @@ -1,21 +1,6 @@ @mixin organisation-brand-colour { @each $organisation in map-keys($govuk-colours-organisations) { .brand--#{$organisation} { - .brand__color { - color: govuk-organisation-colour($organisation); - - &:link, - &:visited, - &:active { - color: govuk-organisation-colour($organisation); - } - - &:hover, - &:focus { - color: $govuk-focus-text-colour; - } - } - // the & declaration allows border-color to also be applied to the parent // element as required by the heading component, adds 2KB to the CSS &.brand__border-color, @@ -32,21 +17,6 @@ // the "the" prefix was dropped, this is maintained here for backwards // compatibility .brand--the-office-of-the-leader-of-the-house-of-commons { - .brand__color { - color: govuk-organisation-colour("office-of-the-leader-of-the-house-of-commons"); - - &:link, - &:visited, - &:active { - color: govuk-organisation-colour("office-of-the-leader-of-the-house-of-commons"); - } - - &:hover, - &:focus { - color: $govuk-focus-text-colour; - } - } - &.brand__border-color, .brand__border-color { border-color: govuk-organisation-colour("office-of-the-leader-of-the-house-of-commons", $contrast-safe: false); @@ -56,9 +26,8 @@ // so are written out here for our use .brand--prime-ministers-office-10-downing-street { - .brand__color { - color: govuk-colour("black"); + .brand__color { &:link, &:visited, &:active { diff --git a/app/views/govuk_publishing_components/components/_share_links.html.erb b/app/views/govuk_publishing_components/components/_share_links.html.erb index f80c08c130..505ec32c3f 100644 --- a/app/views/govuk_publishing_components/components/_share_links.html.erb +++ b/app/views/govuk_publishing_components/components/_share_links.html.erb @@ -11,7 +11,6 @@ square_icons ||= false brand ||= false - brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand) classes = %w(gem-c-share-links govuk-!-display-none-print) classes << "gem-c-share-links--stacked" if stacked @@ -74,7 +73,7 @@ target: "_blank", rel: "noopener noreferrer external", data: data_attributes, - class: "govuk-link govuk-link--no-underline gem-c-share-links__link #{brand_helper.color_class}" do %> + class: "govuk-link govuk-link--no-underline gem-c-share-links__link" do %> <% if link[:icon] == 'facebook' %>