Skip to content

Fixes Color not being overwritten by themes for cards#2179

Merged
balloob merged 1 commit intodevfrom
ha-card-primary-text
Dec 5, 2018
Merged

Fixes Color not being overwritten by themes for cards#2179
balloob merged 1 commit intodevfrom
ha-card-primary-text

Conversation

@zsarnett
Copy link
Copy Markdown
Contributor

@zsarnett zsarnett commented Dec 4, 2018

This allows card themes to overwrite the color using --primary-text-color

@ghost ghost assigned zsarnett Dec 4, 2018
@ghost ghost added the in progress label Dec 4, 2018
border-radius: 2px;
transition: all 0.3s ease-out;
background-color: var(--paper-card-background-color, white);
color: var(--primary-text-color);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making a change like this to a web component that we use throughout the whole Home Assistant and Hass.io UI seems a little wild. Do we really know that we're not messing with anything here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the color css was set back on panel element and therefore taking the value of primary text color back at that Dom. This just allows it to be changed in the card Dom. If the variable is not overwritten itshould still assume the primary text color set at panel element

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do realize that this is not a Lovelace specific element?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. But the logic is still the same. The variable will trickle down and only if overwritten will it be changed. Currently it does not work as expected because color is set so high in the Dom tree

@balloob balloob merged commit e2e002b into dev Dec 5, 2018
@delete-merged-branch delete-merged-branch bot deleted the ha-card-primary-text branch December 5, 2018 11:31
@ghost ghost removed the in progress label Dec 5, 2018
@balloob balloob mentioned this pull request Dec 5, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants