3 ms·
I can't argue with this. Then again, writing stylesheets is still one of those things where, if you're not careful, everything spirals out of control. Often I'
by ayaros 11mo ago
I can't argue with this.
Then again, writing stylesheets is still one of those things where, if you're not careful, everything spirals out of control. Often I'll make changes and wonder why nothing's happening and realize something was overridden by another rule somewhere, or I was mixing up two properties, or some other silly thing...
I also find it's a bit awkward to write var(--foo) every time... I wish I could just write --foo... I suppose there's a grammar issue somewhere, or maybe it would have increased the complexity of implementations of CSS.
- brazukadev 11mo agoI dont mind the var(--foo) but I wish I could do var(attr(foo)) to use a var defined in the attribute foo.
- Latty 11mo ago`attr()` is being updated to basically do that, the modern spec lets you specify a datatype and access any attribute (with some exceptions, you can't get URL types for security reasons), then use it generally. E.g: aspect-ratio: attr(width px) / attr(height px);
- silverwind 11mo agoInterestingly, the bug for this feature is already 17 years old (https://bugzilla.mozilla.org/show_bug.cgi?id=435426 https://bugzilla.mozilla.org/show_bug.cgi?id=435426).
- alwillis 11mo ago> Then again, writing stylesheets is still one of those things where, if you're not careful, everything spirals out of control. Often I'll make changes and wonder why nothing's happening and realize something was overridden by another rule somewhere… It doesn't have to be this way; just write your CSS using Inverted Triangle CSS (ITCSS) [1] and these issues go away. [1]: https://matthiasott.com/notes/how-i-structure-my-css https://matthiasott.com/notes/how-i-structure-my-css