Skip to content

Commit

Permalink
Merge pull request #4288 from alphagov/standardise-inverse
Browse files Browse the repository at this point in the history
Standardise inverse option for action link component
  • Loading branch information
andysellick authored Oct 9, 2024
2 parents 982dc8b + 9e29059 commit 307be5a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 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

* Standardise inverse option for action link component ([PR #4288](https://github.com/alphagov/govuk_publishing_components/pull/4288))
* **BREAKING:** Remove Modernizr ([PR #4273](https://github.com/alphagov/govuk_publishing_components/pull/4273))
* Update accessibility criteria in component docs ([PR #4242](https://github.com/alphagov/govuk_publishing_components/pull/4242))
* Show all big_number symbol types in our docs ([PR #4271](https://github.com/alphagov/govuk_publishing_components/pull/4271))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
}
}

.gem-c-action-link--light-text {
.gem-c-action-link--inverse {
color: govuk-colour("white");

.gem-c-action-link__subtext {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
subtext ||= false
subtext_href ||= false
mobile_subtext ||= false
light_text ||= false
inverse ||= false
simple ||= false
simple_light ||= false
dark_icon ||= false
dark_large_icon ||= false
light_icon ||= false

css_classes = %w(gem-c-action-link)
css_classes << "gem-c-action-link--light-text" if light_text
css_classes << "gem-c-action-link--inverse" if inverse
css_classes << "gem-c-action-link--dark-icon" if dark_icon
css_classes << "gem-c-action-link--dark-large-icon" if dark_large_icon
css_classes << "gem-c-action-link--light-icon" if light_icon
Expand All @@ -29,7 +29,7 @@
css_classes << shared_helper.get_margin_bottom

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

component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class(css_classes.join(" "))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ examples:
text: "Coronavirus (COVID-19):"
nowrap_text: what you need to do
href: "/page"
with_light_text:
inverse:
data:
text: "Coronavirus (COVID-19)"
href: "/page"
light_text: true
inverse: true
context:
dark_background: true
with_subtext:
Expand All @@ -35,7 +35,7 @@ examples:
text: Emergency something
href: "/page"
subtext: This is about the emergency that is happening right now unfortunately so pay attention
light_text: true
inverse: true
context:
dark_background: true
mobile_subtext:
Expand All @@ -56,7 +56,7 @@ examples:
text: Remain calm
subtext: Better things are ahead
subtext_href: "/page"
light_text: true
inverse: true
context:
dark_background: true
simple_arrow:
Expand All @@ -68,7 +68,7 @@ examples:
data:
text: Getting financial help and keeping your business safe
href: "/financial-help"
light_text: true
inverse: true
simple_light: true
context:
dark_background: true
Expand Down
6 changes: 3 additions & 3 deletions spec/components/action_link_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ def component_name
assert_select ".gem-c-action-link--dark-large-icon"
end

it "renders light text version" do
it "renders inverse version" do
render_component(
text: "Get more info",
href: "/coronavirus",
light_text: true,
inverse: true,
)
assert_select ".gem-c-action-link--light-text"
assert_select ".gem-c-action-link--inverse"
end
end

0 comments on commit 307be5a

Please sign in to comment.