Skip to content

[css-forms-1] Pseudo elements and SVG for form controls #12039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jpzwarte opened this issue Apr 2, 2025 · 0 comments
Open

[css-forms-1] Pseudo elements and SVG for form controls #12039

jpzwarte opened this issue Apr 2, 2025 · 0 comments

Comments

@jpzwarte
Copy link

jpzwarte commented Apr 2, 2025

So as part of the CSS Forms 1 spec, i love that a lot of user-interface things are being exposed. Like ::picker-icon in <select> and ::checkmark for <input type=checkbox>. I'm unclear however how customizable those things actually are in practice.

One common practice for design systems is to provide a custom icon for those experiences, usually in the form of SVGs. Sometimes those icons are also animated, for example the <path> of the checkbox when the state changes to :checked.

One way today would be to use background: url("data:image/svg+xml....."); for the pseudo element. The downside of that is that the SVG is not styleable via CSS. So using this technique, you wouldn't be able to animate it in the checkbox scenario.

Is there an existing issue for this that i'm missing?

@lukewarlow lukewarlow changed the title Pseudo elements and SVG for form controls [css-forms-1] Pseudo elements and SVG for form controls Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants