4 ms·
> By combining some "not-too common" HTML attributes with some CSS variables, we can generate a series of widgets without the need to use JavaScript or HTML cla
by stevage 5y ago
> By combining some "not-too common" HTML attributes with some CSS variables, we can generate a series of widgets without the need to use JavaScript or HTML classes.
This sounds suspiciously like abusing semantic attributes for display purposes. At which point, surely it would be much better to use classes?
Come to think of it, what is behind the design goal of avoiding classes?
- rendall 5y ago> This sounds suspiciously like abusing semantic attributes for display purposes. You don't need to be suspicious. The code is right there to evaluate at the bottom of [the demo](https://alvaromontoro.github.io/almond.css/demo/ https://alvaromontoro.github.io/almond.css/demo/). The circular progress widget shows this: <div role="progressbar" aria-valuenow="33" aria-valuemin="0" aria-valuemax="100" style="--value: 33"></div> Is it semantic? No. But it's not an egregious sin, either. Definitely not "abuse". I wonder if `<progress>` can be styled into the circular widget instead of `<div>`? I assume not.
- dsego 5y agoMaybe with pseudo elements (::before,::after) and gradients?