-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
View background settings #23133
View background settings #23133
Conversation
} | ||
|
||
static get styles(): CSSResultGroup { | ||
return css` | ||
:host { | ||
display: relative; | ||
} | ||
/* Fixed background hack for Safari iOS */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since your removed this, does it still work on iOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was introduced in #22531, I've added it back but can't test on iOS.
The background now scrolls with the page, previously it was static and would not scroll. We can make this an option too, but we should at least make sure the old behaviour stays by default. |
Can we add fixed as option in the UI too? |
@silamon I've modified the initial design to add Background attachment via UI and a
|
Do you have a link somewhere? I can't seem to find a design that got updated. |
private _computeBackgroundProperty( | ||
background?: string | LovelaceViewBackgroundConfig | ||
) { | ||
if (typeof background === "object" && background.image) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If background is an object, can we set the css rules individually instead of using the shorthand format?
const viewBackgroundOpacity = this._computeBackgroundOpacityProperty( | ||
this.background | ||
); | ||
this.style.setProperty("--view-background-opacity", viewBackgroundOpacity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use variables for this? So it can also be used by themes? Then we should only set it if _computeBackgroundOpacityProperty
doesn't return null
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main use is to be able to use it in the css styling, like it was done for the background. For to be used in themes, there's a different theming variable used in the fallback:
var(--view-background, var(--lovelace-background, var(--primary-background-color)));
59bc691
to
9f9179a
Compare
@silamon could you fix the background Size and Repeat to be a dropdown as opposed to being a radio group now? |
Proposed change
Implements
Fixes #22512
Fixes #22931
Fixes #22511
Help wanted: Testing in cast specific views and iOS testing.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: