This gives up some flexibility. If you want to switch from horizontal to vertical you have to change a lot more code. If you want to introduce a new face style that color codes bars based on height this wouldn't work.
Why do you bring this up? Is this more ideal? I thought writing inline css was an accepted awful thing to do. Or is that just a simplification for new developers? Why do you benefit from doing this?
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".
[+] [-] judofyr|11 years ago|reply
[+] [-] aleem|11 years ago|reply
[+] [-] scottcanoni|11 years ago|reply
[+] [-] rwl4|11 years ago|reply
[+] [-] fimdomeio|11 years ago|reply
[+] [-] peaton|11 years ago|reply
[+] [-] BoppreH|11 years ago|reply
https://github.com/asciimoo/cssplot/blob/master/cssplot.css
Still find it cool, but a 1200 line CSS may be a bit too much for a practical application.[+] [-] aligajani|11 years ago|reply
[+] [-] girvo|11 years ago|reply
[+] [-] evanm|11 years ago|reply
height: attr(sata-cp-size px);
[+] [-] JoelSutherland|11 years ago|reply
[+] [-] bbx|11 years ago|reply
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".
[+] [-] rco8786|11 years ago|reply
[+] [-] bennettfeely|11 years ago|reply
[+] [-] sova|11 years ago|reply
[+] [-] evan_|11 years ago|reply
[+] [-] caiob|11 years ago|reply