3 ms·
i believe the problem with form elements like checkboxes is that they are 'replaced elements', which the browser defers to the underlying operating system, and
by clairity 4y ago
i believe the problem with form elements like checkboxes is that they are 'replaced elements', which the browser defers to the underlying operating system, and that's why it requires a "hack" like accent-color rather than direct styling. this is also why you can't use ::before and ::after on form elements (to do things like add a 'required' indicator using css only).
- easrng 4y agoIIRC they used to, but not anymore. They're implemented with a special Shadow DOM that's not accessible by the page but you can style some elements if the browser exposes them as psuedoelements.
- clairity 4y agoare OG form elements actually reimplemented in shadow DOM, like they're doing with open UI (https://open-ui.org/ https://open-ui.org/) custom elements? 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.
- easrng 4y agoYep, there are settings to show them in the devtools for both Chrome and Firefox. You can't access them with JS though, you can only see them in the devtools.