Skip to content

Commit 3ac4cd3

Browse files
authored
Merge pull request #286 from torchbox/fix/focus-state-inconsistencies
Focus state inconsistencies
2 parents f050065 + 6761a17 commit 3ac4cd3

File tree

14 files changed

+47
-8
lines changed

14 files changed

+47
-8
lines changed

docs/front-end/utility-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Most CSS classes used in this build are designed to fit with a particular compon
44

55
Some, such as the `listing` component are designed to be a base with variations across a number of variant components - this is made clear by the component naming: `listing--image.html`, `listing--simple.html` etc.
66

7-
However, we have some utility classes which are designed for re-use, along with the option to to use Tailwind utility classes. Classes that are designed for re-use include `button`, `heading--[xyz]`, `link`, `supporting` and `.body`.
7+
However, we have some utility classes which are designed for re-use, along with the option to to use Tailwind utility classes. Classes that are designed for re-use include `button`, `heading--[xyz]`, `link`, `supporting`, `.body` and `icon--listing-arrow`.
88

99
The same tailwind utility classes that are avialable in `wagtail-kit` are available in this build. `tailwind.config.js` includes the custom spacing for the build, allowing us to use classes such as `mb-spacerMini` where it wouldn't be practical to create a new scss component just for a one-off spacing adjustment.

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 icon--listing-arrow" %}</span>
1111
</h2>
1212
</a>
1313
<div class="listing-avatar__details listing__details">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<a class="listing-image__link listing__link" href="{{ link }}">
3232
<h2 class="listing-image__title listing__title">
3333
{# The title and icon need to be on the same line with no whitespace to prevent the icon being orphaned on a new line #}
34-
<span class="listing__title-text">{{ title }}</span><span class="listing__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="listing-image__arrow listing__arrow" %}</span>
34+
<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 icon--listing-arrow" %}</span>
3535
</h2>
3636
</a>
3737
<div class="listing-event__details listing__details">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<a class="listing-image__link listing__link" href="{{ link }}">
2727
<h2 class="listing-image__title listing__title">
2828
{# The title and icon need to be on the same line with no whitespace to prevent the arrow being orphaned on a new line #}
29-
<span class="listing__title-text">{{ title }}</span><span class="listing__tail">&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="listing-image__arrow listing__arrow" %}</span>
29+
<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 icon--listing-arrow" %}</span>
3030
</h2>
3131
</a>
3232
<div class="listing-image__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 icon--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 icon--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 icon--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/_footer.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
display: flex;
8282
align-items: center;
8383
height: 100%;
84+
85+
&:focus {
86+
@include focus-style($shadow: true);
87+
}
8488
}
8589

8690
&__logo {

0 commit comments

Comments
 (0)