From 88ea86dc27ff4cf2cdb3edbe4ca53fe3d94719a3 Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:57:41 +0100 Subject: [PATCH 1/6] Remove custom link colours for organisations Excluding no. 10 --- .../components/helpers/_brand-colours.scss | 30 ------------------- 1 file changed, 30 deletions(-) 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..ab9cf63117 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); From 305cf1af27c8c5d7c2a45bcdacbec89fd08511c2 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 2/6] Turn branded share links variant into two options Share links need to have a black icon with blue links, but the no 10 page needs to retain black links. --- .../components/_share-links.scss | 12 +++++++++++ .../components/_share_links.html.erb | 10 ++++----- .../components/docs/share_links.yml | 17 +++++++++++---- spec/components/share_links_spec.rb | 21 ++++++++++++++++--- 4 files changed, 48 insertions(+), 12 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 c55ed87b2e..bc6186ac66 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss @@ -150,3 +150,15 @@ $column-width: 9.5em; @include govuk-font(19, $weight: bold); } } + +.gem-c-share-links--black-icons { + .gem-c-share-links__link-icon { + color: govuk-colour("black"); + } +} + +.gem-c-share-links--black-links { + .gem-c-share-links__label { + color: govuk-colour("black"); + } +} 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 6ee6569b90..82ef8929e2 100644 --- a/app/views/govuk_publishing_components/components/_share_links.html.erb +++ b/app/views/govuk_publishing_components/components/_share_links.html.erb @@ -11,16 +11,16 @@ flexbox ||= false square_icons ||= false - brand ||= false - brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand) + black_icons ||= false + black_links ||= false classes = %w(gem-c-share-links govuk-!-display-none-print) classes << "gem-c-share-links--stacked" if stacked classes << "gem-c-share-links--columns" if columns classes << "gem-c-share-links--flexbox" if flexbox classes << "gem-c-share-links--square-icons" if square_icons - - classes << brand_helper.brand_class + classes << "gem-c-share-links--black-icons" if black_icons + classes << "gem-c-share-links--black-links" if black_links data_attributes ||= {} ((data_attributes[:module] ||= "") << " " << "ga4-link-tracker").strip! if track_as_sharing || track_as_follow @@ -76,7 +76,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' %>