Skip to content

Commit

Permalink
Standardise inverse for action link component
Browse files Browse the repository at this point in the history
- renames option from 'light_text' to 'inverse'
  • Loading branch information
andysellick committed Oct 8, 2024
1 parent 06e1b60 commit 6aab99b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
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 6aab99b

Please sign in to comment.