5 ms·
Usually, "CSS-only" articles and repos are either technically impressive, or clever solutions for production environment problems. Considering attribute select
by bbx 12y ago
Usually, "CSS-only" articles and repos are either technically impressive, or clever solutions for production environment problems.
Considering attribute selectors have been around for a while, I fail to see a decent use case. Any progress bar or 2-dimensional chart of this kind needs to be generated dynamically, either through the backend or frontend, same thing. In this case, they're inserted as data attribute values. What's the difference with using inline style attributes (left: 10%; width: 90%)? They're generated automatically, so verbosity is not an issue. And you'd save yourself 1200 lines of CSS.
What about flexibility? CSS provides the ability to style each of the 400 options differently, right? Well using a "x24 y78" CSS class would be as simple. But in the end, you only want to give different height/width bottom/left values. The styling remains unchanged.
Writing every possible option of a dynamically generated chart into a static CSS file, just for the sake of "Simplicity" and "No javascript required" seems like an overkill.
On a side note, anything dealing with percentages instead of pixel values is automatically granted the keyword "Responsive".