Does anyone know of a way to add a class to an element so that the style info can go in the theme?
Specifically, I use two different styles for Paper Buttons Row buttons. Iād like to have the default style, then have a CSS entry for āpaper-button.button-with-backgroundā and then add the class ābutton-with-backgroundā to only the buttons/rows that I want to style that way.
Hi all, Iām trying to get markdown table to take up the full width of the markdown card.
The table is inside an ha-markdown-element - that is full width. If I manually add width: 100% to the table using element styles in developer tools it works.
another use-case came up where this card would be a perfect (only one I know currently) solution. For this I need to style the card (it already offers a buttonStyle option to apply CSS to the header/button of the card).
I want the background to be the same as the default HA theme color. So
white during the day (light mode) - already works out of the box
grey during the night (dark mode) - here unfortunately a full black is used. Here you can see the difference:
It should instead be grey as the default card background (see lower part of the screenshot).
ā Is: #111111
ā Should: #1c1c1c (only when dark mode of HA theme is active)
I applied background: default; but it changes nothing.
Do I need to add some āif dark mode is active, use #1c1c1c as backgroundā logic magic maybe?
ā Update: I found your great post for dynamic dark/light mode CSS application here. Now I need to know how to address the collapsable-card sectionā¦
Attempt for quick solution:
Or can I use something likebackground-color: var(--divider-color)but instead of--divider-coloror--accent-color(the only ones I know) there is one I am looking for? What other āāxxxxx-colorā options do exist?
Thanks, Iāve fixed the indentation and tried without the first-of-type and still doesnāt work. Iāve also tried the slightly different structure from this post and nothing.
I think that woks here but am getting odd results with my browser. When I refresh the page itās not right. Then I press edit dashboard and it works, press done and it continues to work until I refresh the page. Maybe some weird caching thing going on.
@e-raser Hi!
Post here a working code w/o using a ādark mode supportā to specify a custom background to the header.
Then weāll try to enhance it with a ādark mode supportā.
Also, I see here an issue with this card - not all itās elements follow ādark modeā. Probabaly you should register an issue for this card.
Currently I simply use the var(--divider-color) directly in the offered CSS field ābuttonStyleā without card-mod being involved. But letās say we want green background for light mode and blue for dark mode.
I asked about a working example of the card with card-mod āto specify a custom background to the header.ā
So, provide the card-mod code for the header, then weāll see how to apply a dark mode.
Thatās the biggest mountain to climb for me, the dark mode think afterwards seems to be a bit easier because of the example code you already provided.
which is quite fine to me, but i would like to allign vertically the slider, and i canāt figure out how to do that! I tryed many card-mod configuration, but notthing actually works