Skip to content

Commit 2278ec8

Browse files
committed
Issue #2983568 by kjay, smaz, John Cook, andrewmacpherson, alexpott, markconroy, emma.maria, Eli-T, mairi, jogordon: Audit and improve focus styles across the Umami theme for logged out users
1 parent 05bbd9d commit 2278ec8

File tree

15 files changed

+173
-105
lines changed

15 files changed

+173
-105
lines changed

core/profiles/demo_umami/themes/umami/css/base.css

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,21 @@ html {
1313
margin-top: 0; /* This allows us to ensure that items side-by-side line up nicely. */
1414
}
1515

16+
*:focus {
17+
outline-offset: 2px; /* Not supported in IE11 but greatly improves outline visibility in newer browsers. */
18+
outline-color: #00836d;
19+
outline-style: dotted;
20+
outline-width: 1px;
21+
}
22+
1623
a {
1724
color: #00836d;
1825
text-decoration: underline;
1926
}
2027
a:hover,
2128
a:focus {
2229
background-color: #e6eee0;
23-
color: #444;
24-
text-decoration: none;
25-
outline-offset: 1px;
30+
color: #cc2a00;
2631
}
2732

2833
body {
@@ -55,20 +60,27 @@ blockquote a:focus {
5560
background-color: #fdfcf9;
5661
}
5762

58-
.button {
63+
button,
64+
.button,
65+
[type='button'],
66+
[type='reset'],
67+
[type='submit'] {
68+
display: inline-block;
69+
padding: 0.7rem 1.3rem;
70+
border: 2px solid #00836d;
71+
border-radius: 3px;
5972
background-color: #00836d;
60-
border: 3px solid #00836d;
61-
border-radius: 4px;
6273
color: #fff;
6374
cursor: pointer;
64-
display: inline-block;
65-
padding: 0.4em 1.5em;
6675
text-align: center;
6776
text-decoration: none;
6877
font-family: 'Scope One', Georgia, serif;
6978
font-size: 1.2rem;
7079
font-weight: 400;
7180
transition: background-color 0.5s ease;
81+
min-width: inherit;
82+
max-width: inherit;
83+
margin: 0;
7284
}
7385
button:hover,
7486
button:active,
@@ -77,7 +89,6 @@ button:focus,
7789
.button:active,
7890
.button:focus {
7991
background-color: #e6eee0;
80-
border: 3px solid #00836d;
8192
color: #000;
8293
text-decoration: none;
8394
transition: background-color 0.5s ease;
@@ -196,8 +207,11 @@ input {
196207
padding: 0.8rem 0.4rem;
197208
}
198209
input:focus {
199-
border: 3px solid #00836d;
200-
margin-bottom: 2px;
210+
border: 2px solid #00836d;
211+
}
212+
input[type='checkbox'] {
213+
min-width: inherit;
214+
max-width: none;
201215
}
202216

203217
textarea {
@@ -206,8 +220,7 @@ textarea {
206220
padding: 0.8rem 0.4rem;
207221
}
208222
textarea:focus {
209-
border: 3px solid #00836d;
210-
margin-bottom: 2px;
223+
border: 2px solid #00836d;
211224
}
212225

213226
label {

core/profiles/demo_umami/themes/umami/css/components/blocks/banner/banner.css

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
.block-type-banner-block .field--name-field-content-link a {
2626
display: inline-block;
27-
padding: 0.5em 1.5em 0.4em;
28-
border: 0;
29-
border-radius: 4px;
27+
padding: 0.7em 1.3em;
28+
border: 2px solid #d93760;
29+
border-radius: 3px;
3030
background-color: #d93760;
3131
color: #fff;
3232
cursor: pointer;
@@ -40,10 +40,11 @@
4040

4141
.block-type-banner-block .field--name-field-content-link a:focus,
4242
.block-type-banner-block .field--name-field-content-link a:hover {
43-
background-color: #00836d;
44-
color: #fff;
45-
box-shadow: 0 0 0 2px currentColor inset;
46-
outline: none;
43+
background-color: #fcece7;
44+
color: #000;
45+
border-color: #d93760;
46+
outline-offset: 2px;
47+
outline-color: #fff;
4748
}
4849

4950
/* 768px */

core/profiles/demo_umami/themes/umami/css/components/blocks/branding/branding.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
max-width: 205px;
2121
background-color: inherit;
2222
}
23-
.site-logo:hover {
23+
.site-logo:hover,
24+
.site-logo:focus {
2425
background-color: inherit;
2526
}
2627

core/profiles/demo_umami/themes/umami/css/components/blocks/footer-promo/footer-promo.css

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,6 @@
1616
margin-bottom: 1.28rem;
1717
}
1818

19-
.block-type-footer-promo-block .footer-promo-content a {
20-
background-color: inherit;
21-
color: #fff;
22-
font-weight: 700;
23-
}
24-
25-
.block-type-footer-promo-block .footer-promo-content a:active,
26-
.block-type-footer-promo-block .footer-promo-content a:focus,
27-
.block-type-footer-promo-block .footer-promo-content a:hover {
28-
background-color: transparent;
29-
}
30-
31-
.block-type-footer-promo-block .footer-promo-content a:after {
32-
display: inline-block;
33-
width: 14px;
34-
height: 14px;
35-
content: '';
36-
background: url('../../../../images/svg/pointer--white.svg') no-repeat center center;
37-
vertical-align: middle;
38-
}
39-
[dir=rtl] .block-type-footer-promo-block .footer-promo-content a:after {
40-
transform: rotate(180deg);
41-
}
42-
4319
@media screen and (min-width: 60rem) {
4420
.block-type-footer-promo-block {
4521
flex-basis: 60%;

core/profiles/demo_umami/themes/umami/css/components/blocks/recipe-collections/recipe-collections.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@
3434
color: #fff;
3535
font-weight: bold;
3636
}
37+
.block-views-blockrecipe-collections-block .views-row a:active,
3738
.block-views-blockrecipe-collections-block .views-row a:focus,
3839
.block-views-blockrecipe-collections-block .views-row a:hover {
3940
text-decoration: underline;
4041
background: transparent;
42+
outline-color: #fff;
4143
}
42-

core/profiles/demo_umami/themes/umami/css/components/blocks/search/search.css

Lines changed: 89 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
}
4949
.search-link:focus,
5050
.search-link:hover {
51-
outline: 3px solid #00836d;
5251
background-color: #fff;
5352
}
5453
.search-link svg {
@@ -61,37 +60,65 @@
6160
.form-type-search {
6261
margin-top: 0;
6362
margin-bottom: 0;
63+
border: 1px solid #dbdbdb;
64+
border-top-left-radius: 3px; /* LTR */
65+
border-bottom-right-radius: 3px; /* LTR */
66+
}
67+
[dir=rtl] .form-type-search {
68+
border-top-left-radius: 0;
69+
border-top-right-radius: 3px;
70+
border-bottom-right-radius: 3px;
71+
border-bottom-left-radius: 0;
72+
}
73+
.search-form .form-type-search {
74+
border: none;
6475
}
6576

6677
.form-search {
67-
width: 20em;
68-
max-width: calc(100vw - 6.25em);
78+
width: auto;
6979
height: auto;
70-
margin: 0 -2px 0 0; /* LTR */
80+
margin: 0 80px 0 0; /* LTR */
7181
padding: 7px 8px 7px 32px;
7282
color: #464646;
73-
border: 1px solid #dbdbdb; /* LTR */
74-
border-right: none; /* LTR */
75-
border-radius: 3px;
83+
border: 2px solid #fff;
7684
background: url(../../../../images/svg/search.svg) no-repeat 0.5em center #fff;
7785
font-size: 0.875rem;
7886
line-height: normal;
7987
}
8088
[dir=rtl] .form-search {
89+
margin: 0 0 0 80px;
90+
}
91+
92+
@media screen and (min-width: 48em) {
93+
.form-search {
94+
width: 14em;
95+
}
96+
}
97+
.search-form .form-search {
98+
border: 1px solid #dbdbdb;
99+
border-radius: 3px;
100+
width: 20em;
101+
margin: 0 -2px 0 0; /* LTR */
102+
max-width: calc(100vw - 6.25em);
103+
}
104+
[dir=rtl] .search-form .form-search {
81105
margin: 0 0 0 -2px;
82-
border-left: none;
83-
border-right: 1px solid #dbdbdb;
84106
}
85107

86108
.form-search:focus {
87-
margin: 0 0 -2px -2px; /* LTR */
88-
padding: 5px 8px 5px 32px;
89-
outline: none;
109+
border: 2px solid #00836d;
110+
border-top-left-radius: 2px; /* LTR */
111+
border-bottom-left-radius: 2px; /* LTR */
90112
}
91113
[dir=rtl] .form-search:focus {
92-
margin: 0 -2px -2px 0;
93-
background-position: 0.35em;
94-
border: 3px solid #00836d;
114+
border-top-right-radius: 2px;
115+
border-bottom-right-radius: 2px;
116+
border-top-left-radius: 0;
117+
border-bottom-left-radius: 0;
118+
}
119+
120+
.search-form .form-search:focus {
121+
border: 1px solid #00836d;
95122
}
96123

97124
.form-search::placeholder {
@@ -104,38 +131,63 @@
104131
/* Search submit */
105132
.search-block-form .form-actions {
106133
position: relative;
107-
z-index: 1;
108134
margin-top: 0;
109135
margin-bottom: 0;
136+
border-top: 1px solid #dbdbdb;
137+
border-bottom: 1px solid #dbdbdb;
138+
border-right: 1px solid #dbdbdb; /* LTR */
139+
border-top-right-radius: 3px; /* LTR */
140+
border-bottom-right-radius: 3px; /* LTR */
110141
}
111-
.search-block-form .form-submit,
112-
.search-form .form-submit {
113-
/* Take off the border radius on the left side as it bumps into the search field */
114-
border-top-left-radius: 0; /* LTR */
115-
border-bottom-left-radius: 0; /* LTR */
116-
}
117-
[dir=rtl] .search-block-form .form-submit,
118-
[dir=rtl] .search-form .form-submit {
119-
/* Take off the border radius on the left side as it bumps into the search field */
120-
border-top-left-radius: 4px;
121-
border-bottom-left-radius: 4px;
142+
[dir=rtl] .search-block-form .form-actions {
122143
border-top-right-radius: 0;
123144
border-bottom-right-radius: 0;
145+
border-top-left-radius: 3px;
146+
border-bottom-left-radius: 3px;
147+
border-right: none;
148+
border-left: 1px solid #dbdbdb;
149+
}
150+
.search-block-form .form-submit,
151+
.search-form .form-submit {
152+
padding: 0.6em 1.25em 0.4em;
153+
margin: 0;
154+
border: 2px solid #fff;
155+
font-size: 0.875rem;
156+
background-color: #fff;
157+
color: #000;
158+
transition: background-color 0.5s ease;
159+
transition: border 0.5s ease;
160+
}
161+
162+
@media screen and (min-width: 48em) {
163+
.search-block-form .form-submit,
164+
.search-form .form-submit {
165+
border-top-left-radius: 0; /* LTR */
166+
border-bottom-left-radius: 0; /* LTR */
167+
}
168+
[dir=rtl] .search-block-form .form-submit,
169+
[dir=rtl] .search-form .form-submit {
170+
border-top-right-radius: 0;
171+
border-bottom-right-radius: 0;
172+
border-bottom-left-radius: 3px;
173+
border-top-left-radius: 3px;
174+
}
175+
}
176+
.search-form .form-submit {
177+
border: 1px solid #dbdbdb;
124178
}
125179

126180
.search-block-form .form-submit:focus,
127181
.search-block-form .form-submit:hover,
128182
.search-form .form-submit:focus,
129183
.search-form .form-submit:hover {
130184
margin: 0;
131-
border-top-left-radius: 4px; /* LTR */
132-
border-bottom-left-radius: 4px; /* LTR */
133-
}
134-
/* Apply border radius to all corners to override LTR and RTL (normal state) changes. */
135-
[dir=rtl] .search-block-form .form-submit:focus,
136-
[dir=rtl] .search-block-form .form-submit:hover,
137-
[dir=rtl] .search-form .form-submit:focus,
138-
[dir=rtl] .search-form .form-submit:hover {
139-
margin: 0;
140-
border-radius: 4px;
185+
background-color: #e6eee0;
186+
border: 2px solid #00836d;
187+
outline-offset: 2px;
188+
}
189+
190+
.search-form .form-submit:focus,
191+
.search-form .form-submit:hover {
192+
border: 1px solid #00836d;
141193
}

core/profiles/demo_umami/themes/umami/css/components/forms/buttons.css

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,9 @@
55
.form-actions {
66
display: inline-flex;
77
}
8-
98
.form-actions .button {
109
margin-left: 1em;
1110
}
1211
.form-actions .button:first-child {
1312
margin-left: 0;
1413
}
15-
16-
.form-submit {
17-
padding: 0.6em 1.25em 0.4em;
18-
margin: 0;
19-
border: 1px solid #dbdbdb;
20-
font-size: 0.875rem;
21-
background-color: #fff;
22-
color: #000;
23-
}
24-
.form-submit:hover,
25-
.form-submit:focus {
26-
padding: calc(0.6em - 2px) calc(1.25em - 2px) calc(0.4em - 2px) calc(1.25em - 2px);
27-
}

core/profiles/demo_umami/themes/umami/css/components/navigation/menu-account/menu-account.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
text-align: left;
1414
}
1515
}
16-
1716
.menu-account {
1817
display: inline-flex;
1918
margin: 0;
@@ -29,11 +28,13 @@
2928
margin-right: 1em;
3029
}
3130
.menu-account__link,
32-
.menu-account__link:hover {
31+
.menu-account__link:hover,
32+
.menu-account__link:focus {
3333
text-decoration: none;
3434
color: inherit;
3535
background-color: inherit;
3636
}
37-
.menu-account__link:hover {
37+
.menu-account__link:hover,
38+
.menu-account__link:focus {
3839
text-decoration: underline;
3940
}

0 commit comments

Comments
 (0)