Skip to content

Commit

Permalink
Add :focus-visible style to buttons (#31799)
Browse files Browse the repository at this point in the history
Buttons now show a focus style via
[`:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)
when the browser deems the focus to be important, like for example when
the button is focused via keyboard navigation.

<img width="492" alt="Screenshot 2024-08-07 at 22 12 51"
src="https://github.com/user-attachments/assets/060568b1-1599-4c56-bafb-b36ebb1bec35">
<img width="479" alt="image"
src="https://github.com/user-attachments/assets/885f4e10-f496-47f0-8ae5-45827ded09f8">
  • Loading branch information
silverwind authored Aug 12, 2024
1 parent 64ef389 commit 63c5ac6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web_src/css/modules/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
white-space: nowrap;
}

.ui.button:focus-visible {
box-shadow: inset 0 0 0 2px currentcolor;
}

@media (max-width: 767.98px) {
.ui.button {
white-space: normal;
Expand Down

0 comments on commit 63c5ac6

Please sign in to comment.