Skip to content

Commit b9e2e27

Browse files
committed
add arrow-focus-style mixin and apply to arrows across the site - remove unused listing-avatar__arrow class
1 parent 6a4bbca commit b9e2e27

File tree

9 files changed

+34
-5
lines changed

9 files changed

+34
-5
lines changed

tbx/project_styleguide/templates/patterns/molecules/listing/listing--avatar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a class="listing-avatar__link listing__link" href="{{ link }}" aria-label="{{ aria_text|default:title }} by {{ name }}">
88
<h2 class="listing-avatar__title listing__title">
99
{# The title and icon need to be on the same line with no whitespace to prevent the arrow being orphaned on a new line #}
10-
<span class="listing__title-text">{{ title }}</span><span class="listing__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="listing-avatar__arrow listing__arrow" %}</span>
10+
<span class="listing__title-text">{{ title }}</span><span class="listing__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="listing__arrow" %}</span>
1111
</h2>
1212
</a>
1313
<div class="listing-avatar__details listing__details">

tbx/project_styleguide/templates/patterns/molecules/listing/listing--simple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<a class="listing__link" href="{{ link }}" aria-label="{{ aria_text|default:title }} by {{ name }}">
33
<h2 class="listing__title">
44
{# The title and icon need to be on the same line with no whitespace to prevent the arrow being orphaned on a new line #}
5-
<span class="listing__title-text">{{ title }}</span><span class="listing__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="listing-avatar__arrow listing__arrow" %}</span>
5+
<span class="listing__title-text">{{ title }}</span><span class="listing__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="listing__arrow" %}</span>
66
</h2>
77
</a>
88
<div class="listing__details">

tbx/project_styleguide/templates/patterns/molecules/streamfield/blocks/event_block.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<a class="event-block__title" href="{{ value.get_button_link }}" aria-label="{{ value.title }}">
66
<h2>
77
{# The title and icon need to be on the same line with no whitespace to prevent the arrow being orphaned on a new line #}
8-
<span>{{ value.title }}</span><span class="listing__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="listing-avatar__arrow listing__arrow" %}</span>
8+
<span>{{ value.title }}</span><span class="listing__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="event-block__arrow listing__arrow" %}</span>
99
</h2>
1010
</a>
1111
<div class="event-block__meta">

tbx/project_styleguide/templates/patterns/molecules/streamfield/blocks/featured_case_study.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<a href="{% pageurl link %}" class="featured-case-study__link">
1919
<h2 class="featured-case-study__title">
2020
{# The title and icon need to be on the same line with no whitespace to prevent the arrow being orphaned on a new line #}
21-
<span class="featured-case-study__link-text">{{ link.title }}</span><span class="featured-case-study__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="listing-avatar__arrow listing__arrow" %}</span>
21+
<span class="featured-case-study__link-text">{{ link.title }}</span><span class="featured-case-study__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="featured-case-study__arrow listing__arrow" %}</span>
2222
</h2>
2323
</a>
2424

tbx/static_src/sass/components/_event-block.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@use 'config' as *;
22

33
.event-block {
4+
$root: &;
5+
46
display: grid;
57
grid-template-columns: 1fr;
68
background-color: rgba($color--white, 0.04);
@@ -36,6 +38,12 @@
3638
@include media-query(large) {
3739
margin-bottom: $spacer-small;
3840
}
41+
42+
&:focus {
43+
#{$root}__arrow {
44+
@include arrow-focus-style();
45+
}
46+
}
3947
}
4048

4149
&__meta {

tbx/static_src/sass/components/_featured-case-study.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@use 'config' as *;
22

33
.featured-case-study {
4+
$root: &;
5+
46
$gradient-z-index: 1;
57
position: relative;
68
margin-top: $spacer-medium;
@@ -97,6 +99,10 @@
9799

98100
&:focus {
99101
@include focus-style();
102+
103+
#{$root}__arrow {
104+
@include arrow-focus-style();
105+
}
100106
}
101107
}
102108

tbx/static_src/sass/components/_listing.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
@use 'config' as *;
44

55
.listing {
6+
$root: &;
7+
68
list-style-type: none;
79
margin-bottom: $spacer-small;
810

@@ -16,6 +18,10 @@
1618

1719
&:focus {
1820
@include focus-style();
21+
22+
#{$root}__arrow {
23+
@include arrow-focus-style();
24+
}
1925
}
2026

2127
@include media-query(medium) {

tbx/static_src/sass/components/_showcase.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
&:focus,
5555
&:hover {
5656
#{$root}__arrow {
57-
transform: translate3d($link-transition-gap, 0, 0);
57+
@include arrow-focus-style();
5858
}
5959

6060
#{$root}__heading {

tbx/static_src/sass/config/_mixins.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@
133133
}
134134
}
135135

136+
@mixin arrow-focus-style() {
137+
transform: translate3d($link-transition-gap, 0, 0);
138+
color: var(--color--link-interaction);
139+
140+
@include reduced-motion() {
141+
transform: none;
142+
}
143+
}
144+
136145
/* ============================================
137146
Link styles - set to be the same colour as the text by default
138147
but can be overridden by passing in a resting colour and interaction colour

0 commit comments

Comments
 (0)