← Back to context

Comment by graypegg

19 hours ago

I might toss it out there that upcoming changes to attr() [0] as well as typed properties [1] will add some interesting features. Being able to provide a value that's subbed into a stylesheet from the HTML itself is neat.

You can try to get by with auto-generated selectors for every possible value today, ([background="#FFFFFF"]{background: #FFFFFF}[background="#FFFFFE"]{background: #FFFFFE}...) but just mapping attributes to styles 1:1 does begin to feel like a very lightweight component.

(Note... I'm not convinced this is a great idea... but it could be interesting to mess around with.)

[0] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/V...

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/A...