CSS fill doesn't work
See original GitHub issueHi to everybody. I’m not able anymore to change the fill color of the SVG object. I’m able via CSS to modify the visibility and the opacity but noway for the color.
Here is the CSS part:
.light-on {
fill: red !important;
}
.light-off {
fill: white !important;
}
and the YAML part:
- entities:
- switch.twinkly
- light.wled
state_action:
action: call-service
service: floorplan.class_set
service_data: '${(entity.state === "on") ? "light-on" : "light-off" }'
tap_action:
action: call-service
service: homeassistant.toggle
The YAML part is correct and object are well named infact , changing the CSS to:
.light-on {
opacity: 1 !important;
}
.light-off {
opacity: 0.2 !important;
}
it works correctly.
Any suggestion on how to solve it?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11
Top Results From Across the Web
SVG Fill Color Not Working
Your path has inline css on it with fill. This overrides your other css. Can be fixed with !important. Or you could remove...
Read more >Applying fill color to SVG doesn't work - Oxygen XML Forum
It works in HTML. I generate an HTML file with one CSS file, then clone the HTML and apply my print CSS. The...
Read more >CSS : SVG Fill Color Not Working - YouTube
CSS : SVG Fill Color Not Working. Watch later. Share. Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin shortly, ...
Read more >Fills and Strokes - SVG: Scalable Vector Graphics | MDN
There are several ways to color shapes (including specifying attributes on the object) using inline CSS, an embedded CSS section, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I know this has been closed but just talking to Petar this is a change to the underlying way floorplan works. For those in the future that find this you can try changing your CSS from what might have been something like:
to
note the extra in the first line which will apply the style to all nested elements.
Thanks @OzGav
Yep, the old version of Floorplan automatically ‘drilled down’ into nested elements and applied the specified CSS styles. We thought this would not always be desirable for all users / cases, so the new version no longer does this.
As Gav mentioned, you can use selectors in your CSS rules to control exactly which nested elements get which styles applied to them.