make focused element visible

This commit is contained in:
Rhiannon Morris 2020-08-03 23:06:19 +02:00
parent c2a0ca6680
commit 1b7f8e9af3
5 changed files with 34 additions and 3 deletions

View file

@ -92,7 +92,7 @@ make' nsfw dir info@(Info {date, title, artist}) = [b|@0
makePrefetch (Image {path}) = [b|<link rel=prefetch href=$@path>|] makePrefetch (Image {path}) = [b|<link rel=prefetch href=$@path>|]
warning' = ifJust (#warning image0) \w -> [b|@4 warning' = ifJust (#warning image0) \w -> [b|@4
<figcaption id=cw> <figcaption id=cw aria-role=button tabindex=0>
<span id=cw-text>cw: <b>$*w</b></span> <span id=cw-text>cw: <b>$*w</b></span>
</figcaption> </figcaption>
|] |]

View file

@ -14,6 +14,9 @@
--text-col: white; --text-col: white;
--nsfw-sticker-rotate: 15deg; --nsfw-sticker-rotate: 15deg;
--focus-box: 0 0 20px hsl(55deg, 60%, 90%, 80%);
--focus-text: hsl(334deg, 87%, 90%);
font-family: Muller; font-family: Muller;
font-size: 18pt; font-size: 18pt;
font-weight: 600; font-weight: 600;
@ -54,8 +57,17 @@ header h1 {
a { a {
color: inherit; color: inherit;
text-decoration: single underline;
text-decoration-thickness: 2px;
} }
a:focus {
outline: none;
color: var(--focus-text);
text-decoration-style: double;
}
footer { footer {
font-weight: 500; font-weight: 500;
font-size: 80%; font-size: 80%;
@ -83,7 +95,13 @@ footer {
.buttonbar.choice input { .buttonbar.choice input {
display: none; display: inline;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
margin: 0;
padding: 0;
width: 0;
} }
.buttonbar { .buttonbar {
@ -115,6 +133,11 @@ footer {
text-shadow: none; text-shadow: none;
} }
.buttonbar.choice :focus + label,
.buttonbar:not(.choice) li:focus-within {
box-shadow: var(--focus-box);
}
.buttonbar.choice :checked + label { .buttonbar.choice :checked + label {
color: var(--button-bg); color: var(--button-bg);
background: var(--text-col); background: var(--text-col);

View file

@ -37,6 +37,10 @@ body {
background: hsl(340, 45%, 65%); background: hsl(340, 45%, 65%);
} }
.item:focus-within {
box-shadow: var(--focus-box);
}
figure { figure {
margin: 0; margin: 0;

View file

@ -82,7 +82,7 @@ header h1::after {
justify-content: center; justify-content: center;
} }
.list a { .list a:not(:focus) {
text-decoration: none; text-decoration: none;
} }

View file

@ -19,6 +19,10 @@ body {
background: hsl(340, 45%, 65%); background: hsl(340, 45%, 65%);
} }
#mainfig:focus-within {
box-shadow: var(--focus-box);
}
#mainimg { #mainimg {
display: block; display: block;
} }