git ssb

0+

Grey the earthling / gkn.me.uk



Commit 03b5def70190c5c38cdfaab41f0899d39fff6052

Clearer focus state for links

Also, highlight image links using an offset outline instead of a border, padding and negative margin.
Grey Nicholson committed on 10/6/2021, 5:55:41 PM
Parent: 6ee6c8df21be3048d5582232e3677dc6c0bff8af

Files changed

static/style/tarazed.csschanged
static/style/tarazed.cssView
@@ -193,55 +193,32 @@
193193 }
194194
195195 :link,
196196 :visited,
197-nav a:link strong,
198-nav a:visited strong {
197 +nav :link strong,
198 +nav :visited strong {
199199 text-decoration: underline;
200200 text-decoration-thickness: max(1px, calc(1rem / 16));
201201 text-underline-offset: calc(4rem / 16);
202202 }
203203
204-:link:focus,
205204 :link:hover,
206-:visited:focus,
207205 :visited:hover,
208-nav a:link:focus strong,
209-nav a:link:hover strong,
210-nav a:visited:focus strong,
211-nav a:visited:hover strong {
206 +nav :link:hover strong,
207 +nav :visited:hover strong {
212208 text-decoration-thickness: max(2px, calc(2rem / 16));
213- outline: 0;
214209 }
215210
211 +:link:focus,
212 +:visited:focus {
213 + outline: max(2px, calc(2rem / 16)) solid;
214 +}
215 +
216216 :link:active,
217217 :visited:active {
218218 color: var(--foreground-color);
219219 }
220220
221-nav a,
222-nav a > *,
223-nav a > * > * {
224- display: block;
225-}
226-nav a * {
227- width: max-content;
228-}
229-nav > a:link,
230-nav > a:link:focus,
231-nav > a:link:hover,
232-nav > a:visited,
233-nav > a:visited:focus,
234-nav > a:visited:hover,
235-nav:not(.menu) a:link,
236-nav:not(.menu) a:link:focus,
237-nav:not(.menu) a:link:hover,
238-nav:not(.menu) a:visited,
239-nav:not(.menu) a:visited:focus,
240-nav:not(.menu) a:visited:hover {
241- text-decoration: none;
242-}
243-
244221 address {
245222 font-style: normal;
246223 }
247224
@@ -341,17 +318,14 @@
341318 margin-right: auto;
342319 }
343320 a img,
344321 a object {
345- padding: calc(0.25rem - max(1px, calc(1rem / 16)));
346- border: max(1px, calc(1rem / 16)) solid;
322 + outline: max(1px, calc(1rem / 16)) solid;
323 + outline-offset: max(2px, calc(2rem / 16));
347324 }
348-a img:focus,
349325 a img:hover,
350-a object:focus,
351326 a object:hover {
352- padding: calc(0.25rem - max(2px, calc(2rem / 16)));
353- border: max(2px, calc(2rem / 16)) solid;
327 + outline: max(2px, calc(2rem / 16)) solid;
354328 }
355329
356330 nav {
357331 margin-top: 1.5rem;
@@ -388,11 +362,31 @@
388362 display: inline-block;
389363 margin: 0;
390364 margin-right: 1.5rem;
391365 }
366 +nav a,
367 +nav a > *,
368 +nav a > * > * {
369 + display: block;
370 + outline-offset: max(2px, calc(2rem / 16));
371 +}
372 +nav a * {
373 + width: max-content;
374 +}
392375 nav.menu li a {
393- display: inline-block;
376 + display: inline;
377 + outline-offset: 0;
394378 }
379 +nav > :link,
380 +nav > :link:hover,
381 +nav > :visited,
382 +nav > :visited:hover,
383 +nav:not(.menu) :link,
384 +nav:not(.menu) :link:hover,
385 +nav:not(.menu) :visited,
386 +nav:not(.menu) :visited:hover {
387 + text-decoration: none;
388 +}
395389
396390 ol,
397391 ul {
398392 margin-top: 1.5rem;

Built with git-ssb-web