Skip to content

Commit

Permalink
Show outlines on links for better keyboard accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Darshak Parikh committed Oct 9, 2024
1 parent 5a1011e commit ac2ecde
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion sass/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ small {

a {
color: unset;
outline: none;
border-radius: 2px;
text-decoration-color: var(--accent-color);
text-decoration-skip-ink: none;
text-decoration-thickness: 2px;
text-underline-offset: 3px;
transition: background-color 200ms, outline-width 200ms;

// TODO: uncomment this when Chromium gets its shit together and
// stops pretending to support this
Expand All @@ -81,6 +82,10 @@ a {
// }
}

a:focus {
outline: 4px solid var(--accent-color);
}

a[data-focusable]::before {
content: "";
display: inline-block;
Expand All @@ -91,6 +96,8 @@ a[data-focusable]::before {

a[data-focusable]:focus::before {
visibility: visible;
background-color: var(--accent-color);
text-decoration: none;
}

address {
Expand Down
4 changes: 3 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
margin: 0.5rem;
}

.footer-menu a {
.footer-menu a:has(.icon-path) {
display: inline-block;
line-height: 1;
color: var(--primary-color-dimmed);
text-decoration: none;
transition: color 250ms;
Expand Down

0 comments on commit ac2ecde

Please sign in to comment.