DEV Community 👩‍💻👨‍💻

Discussion on: Making Web Components stylable

jaredcwhite profile image
Jared White

I simply cannot stress enough how important CSS variables are for enabling component styling. Your explorations into CSSOM are fascinating, but I fear they will always be non-standard and hacky. By using CSS variables, as well as exposing most of your component internals as parts, you'll provide all the styling hooks anyone could ask for.

horus_kol profile image
Stuart Jones Author

I think that's a fair call - but it also puts a lot of burden on component authors to ensure they provide enough of the right styling hooks. If they don't, then developers are just going to keep rolling their own instead - which isn't in itself an issue, but how many of those developers will build components that are properly accessible and reusable.

This is early days, still, but I think there may be a way forward to styling components more easily - whether working through CSSOM is that way, I cannot say.