mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Add better focus style for tile card when theme use box-shadow (#15476)
This commit is contained in:
parent
1ab1cf0fab
commit
9c42eb5130
@ -280,6 +280,7 @@ export class HaBarSlider extends LitElement {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: var(--slider-bar-border-radius);
|
border-radius: var(--slider-bar-border-radius);
|
||||||
outline: none;
|
outline: none;
|
||||||
|
transition: box-shadow 180ms ease-in-out;
|
||||||
}
|
}
|
||||||
:host(:focus-visible) {
|
:host(:focus-visible) {
|
||||||
box-shadow: 0 0 0 2px var(--slider-bar-color);
|
box-shadow: 0 0 0 2px var(--slider-bar-color);
|
||||||
|
@ -106,6 +106,7 @@ export class HaBarSwitch extends LitElement {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: var(--switch-bar-border-radius);
|
border-radius: var(--switch-bar-border-radius);
|
||||||
outline: none;
|
outline: none;
|
||||||
|
transition: box-shadow 180ms ease-in-out;
|
||||||
}
|
}
|
||||||
:host(:focus-visible) {
|
:host(:focus-visible) {
|
||||||
box-shadow: 0 0 0 2px var(--switch-bar-off-color);
|
box-shadow: 0 0 0 2px var(--switch-bar-off-color);
|
||||||
|
@ -422,14 +422,17 @@ export class HuiTileCard extends LitElement implements LovelaceCard {
|
|||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
ha-card:has(.background:focus-visible) {
|
ha-card:has(.background:focus-visible) {
|
||||||
|
--shadow-default: var(--ha-card-box-shadow, 0 0 0 0 transparent);
|
||||||
|
--shadow-focus: 0 0 0 1px var(--tile-color);
|
||||||
border-color: var(--tile-color);
|
border-color: var(--tile-color);
|
||||||
box-shadow: 0 0 0 1px var(--tile-color);
|
box-shadow: var(--shadow-default), var(--shadow-focus);
|
||||||
}
|
}
|
||||||
ha-card {
|
ha-card {
|
||||||
--mdc-ripple-color: var(--tile-color);
|
--mdc-ripple-color: var(--tile-color);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
transition: box-shadow 180ms ease-in-out, border-color 180ms ease-in-out;
|
||||||
}
|
}
|
||||||
ha-card.active {
|
ha-card.active {
|
||||||
--tile-color: var(--state-icon-color);
|
--tile-color: var(--state-icon-color);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user