Skip to content

Use named slots to have advanced ha-card headers#3127

Merged
balloob merged 2 commits intodevfrom
ha-card-lit-ts
Apr 29, 2019
Merged

Use named slots to have advanced ha-card headers#3127
balloob merged 2 commits intodevfrom
ha-card-lit-ts

Conversation

@thomasloven
Copy link
Copy Markdown
Contributor

In the discussions for #2701 I mentioned I tried to use named slots in ha-card for "advanced" headers, like the entities-card one with the toggle.

I finally came up with a way to make it work.

This avoids code duplication w.r.t. things like header font size and stuff.

@thomasloven
Copy link
Copy Markdown
Contributor Author

thomasloven commented Apr 28, 2019

A bit of background to the latest commit.

Previously, the opacity of the header text was set to .87. As it turns out, for pure black text on white background, this corresponds to #212121 which is the default --primary-text-color and also the darkest color in the material design gray color scheme. In other words, the fact that opacity was set at all before is probably to be considered a bug (after #2179).

I also added some (currently unused) theming variables.

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

Excellent !

@balloob balloob merged commit d8f21d9 into dev Apr 29, 2019
@delete-merged-branch delete-merged-branch bot deleted the ha-card-lit-ts branch April 29, 2019 18:31
@balloob balloob mentioned this pull request May 2, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 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