Skip to content

Commit

Permalink
Fix focus outline (#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
tillprochaska authored Sep 9, 2024
2 parents dd1ca0c + 7ce6f02 commit 1a91aa7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/Disclosure.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
font-weight: 500;
cursor: default;
user-select: none;
border-radius: var(--border-radius-xs);
}

.disclosure > summary::-webkit-details-marker {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/FilterSelect.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

.filter-select:focus-within {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-offset);
}

.filter-select > select {
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/components/VoteCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
margin-block-end: var(--space-xxs);
}

.vote-card__title:focus-within {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-offset);
border-radius: var(--border-radius-xs);
}

.vote-card__title a {
text-decoration: none;
}
Expand All @@ -16,6 +22,10 @@
text-decoration: underline;
}

.vote-card__title a:focus {
outline: none;
}

.vote-card__meta {
display: flex;
flex-wrap: wrap;
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ body {

a {
color: inherit;
border-radius: var(--border-radius-xs);
}

input,
Expand All @@ -42,4 +43,5 @@ noscript {

:focus {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-offset);
}
6 changes: 4 additions & 2 deletions frontend/src/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

--border-radius: 8px;
--border-radius-sm: 4px;
--border-radius-xs: 1px;

--shadow-elevated: 0 1px 2px rgba(0, 0, 0, 0.075),
0 5px 20px rgba(0, 0, 0, 0.1);
Expand Down Expand Up @@ -97,8 +98,9 @@
--color-focus-outline: hsla(
var(--blue-h),
var(--blue-s),
calc(var(--blue-l) + 30%),
0.5
calc(var(--blue-l) + 15%),
1
);
--focus-outline: 2px solid var(--color-focus-outline);
--focus-outline-offset: 2px;
}

0 comments on commit 1a91aa7

Please sign in to comment.