Skip to content

Commit

Permalink
fix: Apply button focus colours on :focus-visible only.
Browse files Browse the repository at this point in the history
I chose not to add a `:focus` fallback as:
- Support for `:focus-visible` is very good now.
- We still have a `:focus` ring.
  • Loading branch information
notlee committed Jun 18, 2024
1 parent e166699 commit be6ecc4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions components/o3-button/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
border-color: var(--_o3-button-primary-standard-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-primary-standard-focus-color);
background-color: var(--_o3-button-primary-standard-focus-background);
border-color: var(--_o3-button-primary-standard-focus-border);
Expand All @@ -91,7 +91,7 @@
border-color: var(--_o3-button-primary-inverse-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-primary-inverse-focus-color);
background-color: var(--_o3-button-primary-inverse-focus-background);
border-color: var(--_o3-button-primary-inverse-focus-border);
Expand All @@ -118,7 +118,7 @@
border-color: var(--_o3-button-primary-mono-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-primary-mono-focus-color);
background-color: var(--_o3-button-primary-mono-focus-background);
border-color: var(--_o3-button-primary-mono-focus-border);
Expand All @@ -144,7 +144,7 @@
border-color: var(--_o3-button-secondary-standard-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-secondary-standard-focus-color);
background-color: var(--_o3-button-secondary-standard-focus-background);
border-color: var(--_o3-button-secondary-standard-focus-border);
Expand All @@ -171,7 +171,7 @@
border-color: var(--_o3-button-secondary-inverse-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-secondary-inverse-focus-color);
background-color: var(--_o3-button-secondary-inverse-focus-background);
border-color: var(--_o3-button-secondary-inverse-focus-border);
Expand All @@ -198,7 +198,7 @@
border-color: var(--_o3-button-secondary-mono-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-secondary-mono-focus-color);
background-color: var(--_o3-button-secondary-mono-focus-background);
border-color: var(--_o3-button-secondary-mono-focus-border);
Expand All @@ -224,7 +224,7 @@
border-color: var(--_o3-button-ghost-standard-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-ghost-standard-focus-color);
background-color: var(--_o3-button-ghost-standard-focus-background);
border-color: var(--_o3-button-ghost-standard-focus-border);
Expand All @@ -251,7 +251,7 @@
border-color: var(--_o3-button-ghost-inverse-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-ghost-inverse-focus-color);
background-color: var(--_o3-button-ghost-inverse-focus-background);
border-color: var(--_o3-button-ghost-inverse-focus-border);
Expand All @@ -278,7 +278,7 @@
border-color: var(--_o3-button-ghost-mono-hover-border);
}

&:focus {
&:focus-visible {
color: var(--_o3-button-ghost-mono-focus-color);
background-color: var(--_o3-button-ghost-mono-focus-background);
border-color: var(--_o3-button-ghost-mono-focus-border);
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit be6ecc4

Please sign in to comment.