mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Allow user to theme all cover states in tile card and more info. (#17898)
This commit is contained in:
parent
24d401061c
commit
d0a60984ed
@ -35,9 +35,8 @@ export class HaMoreInfoCoverPosition extends LitElement {
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
const forcedState = this.stateObj.state === "closed" ? "open" : undefined;
|
||||
|
||||
const color = stateColorCss(this.stateObj, forcedState);
|
||||
const openColor = stateColorCss(this.stateObj, "open");
|
||||
const color = stateColorCss(this.stateObj);
|
||||
|
||||
return html`
|
||||
<ha-control-slider
|
||||
@ -55,6 +54,8 @@ export class HaMoreInfoCoverPosition extends LitElement {
|
||||
"current_position"
|
||||
)}
|
||||
style=${styleMap({
|
||||
// Use open color for inactive state to avoid grey slider that looks disabled
|
||||
"--state-cover-inactive-color": openColor,
|
||||
"--control-slider-color": color,
|
||||
"--control-slider-background": color,
|
||||
})}
|
||||
|
@ -72,9 +72,8 @@ export class HaMoreInfoCoverTiltPosition extends LitElement {
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
const forcedState = this.stateObj.state === "closed" ? "open" : undefined;
|
||||
|
||||
const color = stateColorCss(this.stateObj, forcedState);
|
||||
const openColor = stateColorCss(this.stateObj, "open");
|
||||
const color = stateColorCss(this.stateObj);
|
||||
|
||||
return html`
|
||||
<ha-control-slider
|
||||
@ -91,6 +90,8 @@ export class HaMoreInfoCoverTiltPosition extends LitElement {
|
||||
"current_tilt_position"
|
||||
)}
|
||||
style=${styleMap({
|
||||
// Use open color for inactive state to avoid grey slider that looks disabled
|
||||
"--state-cover-inactive-color": openColor,
|
||||
"--control-slider-color": color,
|
||||
"--control-slider-background": color,
|
||||
})}
|
||||
|
@ -64,14 +64,16 @@ class HuiCoverPositionTileFeature
|
||||
|
||||
const value = Math.max(Math.round(percentage), 0);
|
||||
|
||||
const forcedState = this.stateObj.state === "closed" ? "open" : undefined;
|
||||
const openColor = stateColorCss(this.stateObj, "open");
|
||||
|
||||
const color = this.color
|
||||
? computeCssColor(this.color)
|
||||
: stateColorCss(this.stateObj, forcedState);
|
||||
: stateColorCss(this.stateObj);
|
||||
|
||||
const style = {
|
||||
"--color": color,
|
||||
// Use open color for inactive state to avoid grey slider that looks disabled
|
||||
"--state-cover-inactive-color": openColor,
|
||||
};
|
||||
|
||||
return html`
|
||||
|
@ -64,14 +64,16 @@ class HuiCoverTiltPositionTileFeature
|
||||
|
||||
const value = Math.max(Math.round(percentage), 0);
|
||||
|
||||
const forcedState = this.stateObj.state === "closed" ? "open" : undefined;
|
||||
const openColor = stateColorCss(this.stateObj, "open");
|
||||
|
||||
const color = this.color
|
||||
? computeCssColor(this.color)
|
||||
: stateColorCss(this.stateObj, forcedState);
|
||||
: stateColorCss(this.stateObj);
|
||||
|
||||
const style = {
|
||||
"--color": color,
|
||||
// Use open color for inactive state to avoid grey slider that looks disabled
|
||||
"--state-cover-inactive-color": openColor,
|
||||
};
|
||||
|
||||
return html`
|
||||
|
Loading…
x
Reference in New Issue
Block a user