Skip to content

Commit 203629f

Browse files
authored
Merge pull request #5040 from alphagov/action-link-arrow
Adjust action link arrow
2 parents a6a9ed5 + 10da1d4 commit 203629f

File tree

5 files changed

+60
-34
lines changed

5 files changed

+60
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
## Unreleased
1111

1212
* Revert GA4 phone number PII changes ([PR #5039](https://github.com/alphagov/govuk_publishing_components/pull/5039))
13+
* Adjust action link arrow ([PR #5040](https://github.com/alphagov/govuk_publishing_components/pull/5040))
1314

1415
## 61.0.3
1516

app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,54 @@
1212
display: table-cell;
1313
line-height: 1;
1414
width: 36px;
15+
vertical-align: middle;
1516

16-
svg {
17-
height: 28px;
18-
vertical-align: middle;
19-
width: 28px;
17+
@include govuk-media-query($from: tablet) {
18+
width: 45px;
19+
}
20+
}
2021

21-
.gem-c-action-link__icon__circle {
22-
fill: #eeefef;
22+
.gem-c-action-link__svg {
23+
height: 28px;
24+
vertical-align: middle;
25+
width: 28px;
26+
27+
.gem-c-action-link__icon__circle {
28+
fill: #eeefef;
2329

24-
// stylelint-disable max-nesting-depth
25-
@media (forced-colors: active) {
26-
fill: LinkText;
27-
}
28-
// stylelint-enable max-nesting-depth
30+
@media (forced-colors: active) {
31+
fill: LinkText;
2932
}
33+
}
3034

31-
.gem-c-action-link__icon__arrow {
32-
fill: #000000;
35+
.gem-c-action-link__icon__arrow {
36+
fill: #000000;
3337

34-
// stylelint-disable max-nesting-depth
35-
@media (forced-colors: active) {
36-
fill: Canvas;
37-
}
38-
// stylelint-enable max-nesting-depth
38+
@media (forced-colors: active) {
39+
fill: Canvas;
3940
}
4041
}
4142

4243
@include govuk-media-query($from: tablet) {
43-
width: 45px;
44-
45-
svg {
46-
height: 35px;
47-
width: 35px;
48-
}
44+
height: 35px;
45+
width: 35px;
4946
}
5047
}
5148

5249
.gem-c-action-link__icon--simple {
5350
padding-top: 2px;
5451
width: 30px;
5552

56-
svg {
53+
.gem-c-action-link__svg {
5754
height: 25px;
5855
width: 25px;
56+
}
5957

60-
.gem-c-action-link__icon__arrow {
61-
fill: #272828;
58+
.gem-c-action-link__icon__arrow {
59+
fill: #272828;
6260

63-
// stylelint-disable max-nesting-depth
64-
@media (forced-colors: active) {
65-
fill: currentcolor;
66-
}
67-
// stylelint-enable max-nesting-depth
61+
@media (forced-colors: active) {
62+
fill: currentcolor;
6863
}
6964
}
7065
}
@@ -75,6 +70,18 @@
7570
@include govuk-font(19, $weight: bold, $line-height: 1.3);
7671
}
7772

73+
.gem-c-action-link--large {
74+
.gem-c-action-link__icon {
75+
height: 40px;
76+
width: 56px;
77+
}
78+
79+
.gem-c-action-link__svg {
80+
height: 40px;
81+
width: 40px;
82+
}
83+
}
84+
7885
@include govuk-media-query($media-type: print) {
7986
.gem-c-action-link {
8087
* {

app/views/govuk_publishing_components/components/_action_link.html.erb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
inverse ||= false
88
simple ||= false
99
simple_light ||= false
10+
large ||= false
1011

1112
link_classes = %w(govuk-link gem-c-action-link__link gem-print-force-link-styles)
1213
link_classes << "govuk-link--inverse" if inverse
@@ -15,12 +16,13 @@
1516
component_helper.add_class("gem-c-action-link")
1617
component_helper.add_class("gem-c-action-link--inverse") if inverse
1718
component_helper.add_class("gem-c-action-link--simple") if simple
19+
component_helper.add_class("gem-c-action-link--large") if large
1820
%>
1921
<% if text.present? %>
2022
<%= tag.div(**component_helper.all_attributes) do %>
2123
<% if simple || simple_light %>
2224
<span class="gem-c-action-link__icon gem-c-action-link__icon--simple" hidden>
23-
<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 23 23">
25+
<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 23 23" class="gem-c-action-link__svg">
2426
<g class="gem-c-action-link__icon__arrow">
2527
<path d="M14.943 11.795 10.44 7.292 11.733 6l5.795 5.795-5.795 5.795-1.293-1.292 4.503-4.503Z" />
2628
<path d="M3.956 10.881h11.485v1.828H3.956v-1.828Z" />
@@ -29,7 +31,7 @@
2931
</span>
3032
<% elsif %>
3133
<span class="gem-c-action-link__icon" hidden>
32-
<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 27 27">
34+
<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 27 27" class="gem-c-action-link__svg">
3335
<circle class="gem-c-action-link__icon__circle" cx="13.5" cy="13.5" r="13.5" />
3436
<g class="gem-c-action-link__icon__arrow">
3537
<path d="m17.701 13.526-3.827-3.828L14.973 8.6l4.926 4.926-4.926 4.926-1.099-1.099 3.827-3.827Z" />

app/views/govuk_publishing_components/components/docs/action_link.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ examples:
2525
text: Getting financial help and keeping your business safe
2626
href: "/financial-help"
2727
simple: true
28+
large:
29+
description: For use on the GOV.UK homepage popular links.
30+
data:
31+
text: This way for cookies
32+
href: "/cookies"
33+
large: true
34+

spec/components/action_link_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,13 @@ def component_name
4343
)
4444
assert_select ".gem-c-action-link--inverse"
4545
end
46+
47+
it "renders large version" do
48+
render_component(
49+
text: "Get more info",
50+
href: "/coronavirus",
51+
large: true,
52+
)
53+
assert_select ".gem-c-action-link.gem-c-action-link--large"
54+
end
4655
end

0 commit comments

Comments
 (0)