Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Remove branded links and make branded share icons black #4195

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ $column-width: 9.5em;
display: block;
}
}

.gem-c-share-links--black {
color: govuk-colour("black");
}
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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);
Expand All @@ -56,21 +26,6 @@
// so are written out here for our use

.brand--prime-ministers-office-10-downing-street {
.brand__color {
color: govuk-colour("black");

&:link,
&:visited,
&:active {
color: govuk-colour("black");
}

&:hover,
&:focus {
color: $govuk-focus-text-colour;
}
}

&.brand__border-color,
.brand__border-color {
border-color: govuk-colour("black");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new(local_assigns)
underline_links ||= false
format_numbers ||= false
brand ||= false
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
title_fallback = t("components.contents_list.contents", locale: I18n.locale, fallback: false, default: "en")
classes = %w[gem-c-contents-list]
link_classes = %w[gem-c-contents-list__link govuk-link]
link_classes << brand_helper.color_class
link_classes << "govuk-link--no-underline" unless underline_links

disable_ga4 ||= false
Expand All @@ -21,7 +18,7 @@
} unless disable_ga4
local_assigns[:aria] ||= {}
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class("gem-c-contents-list #{brand_helper.brand_class}")
component_helper.add_class("gem-c-contents-list")
component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
component_helper.add_aria_attribute({ label: t("components.contents_list.contents") }) unless local_assigns[:aria][:label]
component_helper.add_role("navigation")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
extra_link_classes = "govuk-link--no-underline" if local_assigns[:remove_underline]
title_with_context_class = " gem-c-document-list__item-title--context"

brand ||= false
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)

disable_ga4 ||= false
unless disable_ga4
ga4_extra_data ||= {}
Expand All @@ -34,14 +31,14 @@
<%= tag.ul(**component_helper.all_attributes) do %>
<% items.each do |item| %>
<% highlight_class = " gem-c-document-list__item--highlight" if item[:highlight] %>
<li class="gem-c-document-list__item <%= brand_helper.brand_class %> <%= highlight_class %>">
<li class="gem-c-document-list__item <%= highlight_class %>">
<% if item[:highlight] && item[:highlight_text] %>
<p class='gem-c-document-list__highlight-text'><%= item[:highlight_text] %></p>
<% end %>

<%= content_tag :div, class: "gem-c-document-list__item-title" do -%>
<%=
item_classes = "#{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}"
item_classes = "#{title_with_context_class if item[:link][:context]}"

if item[:link][:path]
rel = [
Expand Down Expand Up @@ -117,7 +114,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 #{extra_link_classes}",
class: "gem-c-document-list-child__heading gem-c-document-list-child__link govuk-link #{extra_link_classes}",
)
else
content_tag(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
add_gem_component_stylesheet("image-card")

sizes ||= false
brand ||= false

brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns, brand_helper)
card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns)
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class("gem-c-image-card")
component_helper.add_class("govuk-grid-row") if card_helper.two_thirds
component_helper.add_class("gem-c-image-card--large") if card_helper.large
component_helper.add_class("gem-c-image-card--two-thirds") if card_helper.two_thirds
component_helper.add_class("gem-c-image-card--no-image") unless (card_helper.image_src || card_helper.youtube_video_id)
component_helper.add_class(brand_helper.brand_class) if brand_helper.brand_class

text_wrapper_classes = %w[gem-c-image-card__text-wrapper]
text_wrapper_classes << "gem-c-image-card__text-wrapper--two-thirds" if card_helper.two_thirds
Expand All @@ -26,13 +23,11 @@
gem-c-image-card__title-link
govuk-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
]
extra_link_classes << brand_helper.color_class

component_helper.add_data_attribute({ module: "image-card" }) if card_helper.youtube_video_id
component_helper.set_lang(card_helper.lang)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
columns ||= false

brand ||= false
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)

if brand
brand_class = 'gem-c-share-links--black'
end

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 << brand_helper.brand_class

data_attributes ||= {}
((data_attributes[:module] ||= "") << " " << "ga4-link-tracker").strip! if track_as_sharing || track_as_follow
Expand Down Expand Up @@ -71,8 +73,8 @@
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 %>
<span class="gem-c-share-links__link-icon">
class: "govuk-link govuk-link--no-underline gem-c-share-links__link" do %>
<span class="gem-c-share-links__link-icon <%= brand_class %>">
<% if link[:icon] == 'facebook' %>
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
<path fill="currentColor" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<%
add_gem_component_stylesheet("subscription-links")

brand ||= false
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)

sl_helper = GovukPublishingComponents::Presenters::SubscriptionLinksHelper.new(local_assigns)
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)

Expand All @@ -12,7 +9,6 @@

css_classes = %w( gem-c-subscription-links govuk-!-display-none-print )
css_classes << shared_helper.get_margin_bottom unless local_assigns[:margin_bottom] == 0
css_classes << brand_helper.brand_class
css_classes << "gem-c-subscription-links--with-feed-box" if sl_helper.feed_link_box_value

data = {"module": "gem-toggle"} if sl_helper.feed_link_box_value
Expand All @@ -35,7 +31,7 @@
</svg><%= sl_helper.email_signup_link_text %>
<% end %>
<%= link_to email_link_text, sl_helper.email_signup_link, {
class: "govuk-link gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
class: "govuk-link gem-c-subscription-links__item gem-c-subscription-links__item--link",
data: sl_helper.email_signup_link_data_attributes,
lang: email_signup_link_text_locale
} %>
Expand All @@ -49,12 +45,12 @@
</svg><%= sl_helper.feed_link_text %>
<% end %>
<%= tag.button(feed_link_text,
class: "govuk-link govuk-link--no-underline gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--button",
class: "govuk-link govuk-link--no-underline gem-c-subscription-links__item gem-c-subscription-links__item--button",
data: sl_helper.feed_link_data_attributes,
lang: feed_link_text_locale
) if sl_helper.feed_link_box_value %>
<%= link_to(feed_link_text, sl_helper.feed_link,
class: "govuk-link govuk-link--no-underline gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
class: "govuk-link govuk-link--no-underline gem-c-subscription-links__item gem-c-subscription-links__item--link",
data: sl_helper.feed_link_data_attributes,
lang: feed_link_text_locale
) unless sl_helper.feed_link_box_value %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<%
add_gem_component_stylesheet("translation-nav")

brand ||= false
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
%>
<% if translation_helper.has_translations? %>
<nav role="navigation"
class="gem-c-translation-nav govuk-!-display-none-print <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
class="gem-c-translation-nav govuk-!-display-none-print <%= translation_helper.classes %>"
aria-label="<%= t("common.translations") %>"
>
<ul class="gem-c-translation-nav__list">
Expand All @@ -20,7 +18,7 @@
hreflang: translation[:locale],
lang: translation[:locale],
rel: "alternate",
class: "govuk-link gem-c-translation-nav__link #{brand_helper.color_class}",
class: "govuk-link gem-c-translation-nav__link",
data: translation[:data_attributes]
%>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,6 @@ examples:
text: "تقديم الطلب"
context:
right_to_left: true
with_branding:
description: Where this component could be used on an organisation page (such as the [Attorney General's Office](https://www.gov.uk/government/organisations/attorney-generals-office)) branding can be applied for link colours and border colours. See the [branding documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) for more details.
data:
brand: 'department-for-environment-food-rural-affairs'
format_numbers: true
contents:
- href: "#first-thing"
text: 1. First thing
items:
- href: "#second-thing"
text: 2. Numbers not parsed
- href: "#third-thing"
text: 3. Numbers are just text
without_ga4_tracking:
description: Disables GA4 link tracking on the list. Tracking is enabled by default.
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,6 @@ examples:
metadata:
public_updated_at: 2017-07-19 15:01:48
document_type: 'Statutory guidance'
with_branding:
description: Where this component could be used on an organisation page (such as the [Attorney General's Office](https://www.gov.uk/government/organisations/attorney-generals-office)) branding can be applied for link colours and border colours. See the [branding documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) for more details.
data:
brand: 'attorney-generals-office'
items:
- link:
text: 'School behaviour and attendance: parental responsibility measures'
path: '/government/publications/parental-responsibility-measures-for-behaviour-and-attendance'
metadata:
public_updated_at: 2017-01-05 14:50:33
document_type: 'Statutory guidance'
- link:
text: 'School exclusion'
path: '/government/publications/school-exclusion'
metadata:
public_updated_at: 2017-07-19 15:01:48
document_type: 'Statutory guidance'
with_only_link:
data:
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,6 @@ examples:
href: '/no-valid-links-here'
heading_text: 'John McJohnson'
description: 'Deputy director for Parks and Small Trees'
with_branding:
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
data:
brand: "department-for-work-pensions"
href: "/again-not-a-page"
image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
image_alt: "some meaningful alt text please"
heading_text: "Something relating to this"
description: "Public reform committee consultation vote department interior minister referendum."
extra_details: [
{
text: "Something",
href: "/1"
},
{
text: "Something else",
href: "/2"
}
]
large_version:
data:
large: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ examples:
}
]
with_branding:
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
description: Black branding can be added to the component icons as shown.
data:
brand: 'attorney-generals-office'
brand: true
links: [
{
href: 'share',
Expand Down Expand Up @@ -208,7 +208,7 @@ examples:
with_all_icons:
data:
stacked: true
brand: 'hm-treasury'
brand: true
links: [
{
href: '/facebook-share-link',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ examples:
data:
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
with_branding:
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
data:
brand: 'attorney-generals-office'
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
feed_link: '/foreign-travel-advice/singapore.atom'
with_data_attributes_on_links:
description: Data attributes can be passed for each link as shown.
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ examples:
active: true
context:
right_to_left: true
with_branding:
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
data:
brand: 'wales-office'
translations:
- locale: 'en'
base_path: '/en'
text: 'English'
active: true
- locale: 'cy'
base_path: '/cy'
text: 'Cymraeg'
with_no_top_margin:
data:
no_margin_top: true
Expand Down
Loading
Loading