oddbird / cascading-color-system

CSS Custom Property color-theming
Other
71 stars 2 forks source link

I want flexible markup for color controls #37

Open mirisuzanne opened 9 months ago

mirisuzanne commented 9 months ago

This comes from oddbird/oddleventy#250 - where we would like to replace the radio-button light/dark/auto with a group of toggle buttons. But it seems to me like there might be ways to make this generally more flexible.

mirisuzanne commented 9 months ago

Already, the main feature of CCS is that it generates all the variables required on the CSS side. Any JS could be used to update those variables. There's already an assumption that you can add the controls you want. The JS simply provides shortcuts for wiring up form controls to HTML attributes and CSS custom properties. I think this would be a great place use-case for custom elements.

I have started on some high level elements for quickly wiring form controls to attrs/props:

Those could be cleaned up and packaged as stand-alone tools, but then also CCS could use them (or recommend them) to provide more CSS-specific wiring for color controls?