Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
fix: focus button styles #713
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull authored Jan 2, 2020
1 parent 24a17d9 commit 8a32670
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
22 changes: 15 additions & 7 deletions src/components/calcite-action/calcite-action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
padding-right: var(--calcite-app-side-spacing-quarter);
}

&:hover {
&:hover,
&:focus {
background-color: var(--calcite-app-background-hover);
color: var(--calcite-app-foreground-hover);
fill: var(--calcite-app-foreground-hover);
Expand Down Expand Up @@ -81,6 +82,7 @@

:host([active]) .button,
:host([active]) .button:hover,
:host([active]) .button:focus,
:host([active][loading]) .button {
color: var(--calcite-app-foreground-active);
fill: var(--calcite-app-foreground-active);
Expand All @@ -92,13 +94,15 @@
transition: box-shadow var(--calcite-app-animation-time-fast) var(--calcite-app-easing-function);
}

:host([appearance="clear"]) .button:hover {
:host([appearance="clear"]) .button:hover,
:host([appearance="clear"]) .button:focus {
background-color: var(--calcite-app-background-clear);
@include borderShadowHover();
}

:host([active][appearance="clear"]) .button,
:host([active][appearance="clear"]) .button:hover {
:host([active][appearance="clear"]) .button:hover,
:host([active][appearance="clear"]) .button:focus {
color: var(--calcite-app-foreground-active);
fill: var(--calcite-app-foreground-active);
background-color: var(--calcite-app-background-active);
Expand All @@ -111,7 +115,8 @@
}

:host([loading]) .button,
:host([loading]) .button:hover {
:host([loading]) .button:hover,
:host([loading]) .button:focus {
background-color: var(--calcite-app-background);
}

Expand All @@ -121,14 +126,16 @@
}

:host([disabled]) .button,
:host([disabled]) .button:hover {
:host([disabled]) .button:hover,
:host([disabled]) .button:focus {
cursor: default;
opacity: var(--calcite-app-disabled-opacity);
background-color: var(--calcite-app-background);
}

:host([disabled][active]) .button,
:host([disabled][active]) .button:hover {
:host([disabled][active]) .button:hover,
:host([disabled][active]) .button:focus {
opacity: var(--calcite-app-disabled-opacity);
background-color: var(--calcite-app-background-active);
}
Expand Down Expand Up @@ -160,7 +167,8 @@
padding-left: var(--calcite-app-side-spacing);
}

:host([indicator]) .button:hover::after {
:host([indicator]) .button:hover::after,
:host([indicator]) .button:focus::after {
border-color: var(--calcite-app-background-hover);
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/calcite-filter/calcite-filter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ input[type="text"]:focus {
background: none;
border: 0;
cursor: pointer;
&:hover {
&:hover,
&:focus {
color: var(--calcite-app-foreground-hover);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
animation: calcite-app-fade-in var(--calcite-app-animation-time) var(--calcite-app-easing-function);
}

:host(:hover) {
:host(:hover),
:host(:focus) {
background-color: var(--calcite-app-background-hover);
}

Expand Down

0 comments on commit 8a32670

Please sign in to comment.