"Disregard logic, acquire funds" - Ducreux
(The workaround was creating a fake element that looked like a checkbox that overlapped the actual checkbox.)
Lean on the primitives we already have, enable flexibility, and if someone wants to make a SaSS wrapper or CSS function to do it, enable that vs. more random places for browsers to diverge on "standards".
It plays out like this:
"Oh, I wanna change the UI element style, thats a new feature! Accent-color! Nice. Oh wait, browsers are doing different things. Dang. Am I okay with that? vs. "I wanna change a UI element style, Oh, browsers now support classic CSS styling attributes on these elements! Nice! Designers sets colors, all browsers just read the designer's palette.
i've seen safari and chrome (but not firefox) expose some form input components as shadow DOM (e.g., slots), but wasn't sure if it was actually reimplemented.
There is also a newer workaround by styling the input element it self by using appearance: none. You can do some clever stuff with the :checked selector, multiple backgrounds, clip-paths, masks, etc.
If you were able to style the element with "classic" CSS primitives like border/background/color would that not have also solved the problem without introducing new syntax with new quirks?
input[type="range"]::-moz-range-thumb,
input[type="range"]::-webkit-slider-thumb {
background-color: red;
}
It'll work in Firefox, but Chrome (and probably Safari) will ignore it. Instead you need to do this: input[type="range"]::-moz-range-thumb {
background-color: red;
}
input[type="range"]::-webkit-slider-thumb {
background-color: red;
}I'm super excited for some of these additions. Perhaps they are meant for designer-developers such as myself and not for the casual CSS developer who doesn't already reach for existing advanced features.
https://web.dev/state-of-css-2022/#accent-color
Sure it's a "nice to have" but it bloats the spec? Look at the current actual implementation:
https://web.dev/accent-color/#guaranteeing-contrast
chrome and firefox already tint differently...
How is this better than a good ol CSS variable and leaving it up to the designer to manage?
Sure http://dowebsitesneedtolookexactlythesameineverybrowser.com/ but when the exec is like "why is our brand color slightly different on ff vs. chrome... we are back to square one.