2 ms·
Whichever option the boffins decide, nested and flattened should be isomorphic. And used interchangeably. Like this, but for CSS: https://github.com/wnameless/
by specialist 4y ago
Whichever option the boffins decide, nested and flattened should be isomorphic. And used interchangeably.
Like this, but for CSS: https://github.com/wnameless/json-flattener https://github.com/wnameless/json-flattener
Sharp observers will notice that flattened declarations look like path expressions.
While CSS selectors are nice, path expressions enable concise drill down to precise modifications (overrides).
For future, every programming language should have intrinsic path expressions. Basically a useful, usable, legible version of LINQ.
--
PS- I really don't get the '&' ampersand. It's like a reference?
"foo.bar { ... }" is sugar for the expanded "foo { bar { ... }}". Makes sense. (No ampersand required.)
But "foo { bar & { ... }}" being the same as "bar foo { ... }" breaks my brain. What's the use case for reversing the parent-child relationship, contrary to the lexical order?
Update: Oh. It's a SASS thing. Meh.