Skip to content

Commit 27e215e

Browse files
author
Adam Argyle
committed
accessible ux
1 parent 8c6ffcc commit 27e215e

2 files changed

Lines changed: 45 additions & 37 deletions

File tree

app/css/index.css

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ dl {
102102
margin: 0;
103103
padding: 0;
104104
display: grid;
105-
gap: 1ch;
105+
gap: 1ex;
106106

107107
& > dt {
108108
color: deeppink;
@@ -121,16 +121,24 @@ dl {
121121
font-weight: 300;
122122
white-space: nowrap;
123123

124-
&:hover {
124+
& > a {
125+
padding-block: .5ex;
126+
}
127+
128+
& > a:hover {
125129
color: var(--brand);
130+
}
131+
132+
& > a:focus {
133+
outline: 1px dotted deeppink;
134+
}
126135

127-
&:after {
128-
content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' fill='deeppink' viewBox='0 0 24 24'><path d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/></svg>");
129-
position: absolute;
130-
inset: 1px 0 0 calc(100% + .5em);
131-
block-size: .75em;
132-
inline-size: .75em;
133-
}
136+
&:matches(:hover,:focus-within)::after {
137+
content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' fill='deeppink' viewBox='0 0 24 24'><path d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/></svg>");
138+
position: absolute;
139+
inset: 1px 0 0 calc(100% + .5em);
140+
block-size: .75em;
141+
inline-size: .75em;
134142
}
135143
}
136144
}

app/index.html

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -82,57 +82,57 @@ <h1>
8282
<h3>Circles</h3>
8383
<dl>
8484
<dt>Entrances</dt>
85-
<dd>in:circle:top-right</dd>
86-
<dd>in:circle:top-left</dd>
87-
<dd>in:circle:bottom-right</dd>
88-
<dd>in:circle:bottom-left</dd>
85+
<dd><a href="#">in:circle:top-right</a></dd>
86+
<dd><a href="#" autofocus>in:circle:top-left</a></dd>
87+
<dd><a href="#">in:circle:bottom-right</a></dd>
88+
<dd><a href="#">in:circle:bottom-left</a></dd>
8989

9090
<dt>Exits</dt>
91-
<dd>out:circle:top-right</dd>
92-
<dd>out:circle:top-left</dd>
93-
<dd>out:circle:bottom-right</dd>
94-
<dd>out:circle:bottom-left</dd>
91+
<dd><a href="#">out:circle:top-right</a></dd>
92+
<dd><a href="#">out:circle:top-left</a></dd>
93+
<dd><a href="#">out:circle:bottom-right</a></dd>
94+
<dd><a href="#">out:circle:bottom-left</a></dd>
9595
</dl>
9696

9797
<h3>Squares</h3>
9898
<dl>
9999
<dt>Entrances</dt>
100-
<dd>in:square:center</dd>
101-
<dd>in:square:top-right</dd>
102-
<dd>in:square:top-left</dd>
103-
<dd>in:square:bottom-right</dd>
104-
<dd>in:square:bottom-left</dd>
100+
<dd><a href="#">in:square:center</a></dd>
101+
<dd><a href="#">in:square:top-right</a></dd>
102+
<dd><a href="#">in:square:top-left</a></dd>
103+
<dd><a href="#">in:square:bottom-right</a></dd>
104+
<dd><a href="#">in:square:bottom-left</a></dd>
105105

106106
<dt>Exits</dt>
107-
<dd>out:square:center</dd>
108-
<dd>out:square:top-right</dd>
109-
<dd>out:square:top-left</dd>
110-
<dd>out:square:bottom-right</dd>
111-
<dd>out:square:bottom-left</dd>
107+
<dd><a href="#">out:square:center</a></dd>
108+
<dd><a href="#">out:square:top-right</a></dd>
109+
<dd><a href="#">out:square:top-left</a></dd>
110+
<dd><a href="#">out:square:bottom-right</a></dd>
111+
<dd><a href="#">out:square:bottom-left</a></dd>
112112
</dl>
113113

114114
<h3>Wipes</h3>
115115
<dl>
116116
<dt>Entrances</dt>
117-
<dd>in:wipe:right</dd>
118-
<dd>in:wipe:left</dd>
119-
<dd>in:wipe:up</dd>
120-
<dd>in:wipe:down</dd>
117+
<dd><a href="#">in:wipe:right</a></dd>
118+
<dd><a href="#">in:wipe:left</a></dd>
119+
<dd><a href="#">in:wipe:up</a></dd>
120+
<dd><a href="#">in:wipe:down</a></dd>
121121

122122
<dt>Exits</dt>
123-
<dd>out:wipe:right</dd>
124-
<dd>out:wipe:left</dd>
125-
<dd>out:wipe:up</dd>
126-
<dd>out:wipe:down</dd>
123+
<dd><a href="#">out:wipe:right</a></dd>
124+
<dd><a href="#">out:wipe:left</a></dd>
125+
<dd><a href="#">out:wipe:up</a></dd>
126+
<dd><a href="#">out:wipe:down</a></dd>
127127
</dl>
128128

129129
<h3>Diamonds</h3>
130130
<dl>
131131
<dt>Entrances</dt>
132-
<dd>in:diamond:center</dd>
132+
<dd><a href="#">in:diamond:center</a></dd>
133133

134134
<dt>Exits</dt>
135-
<dd>out:diamond:center</dd>
135+
<dd><a href="#">out:diamond:center</a></dd>
136136
</dl>
137137

138138
<hr>

0 commit comments

Comments
 (0)