#CSS Nesting aims to give advanced users new ways to group and shorten style rules. It implements natively some of the features provided by preprocessors like #SASS or LESS #timetogiveinput
This tweet is unavailable
1
4
5
Besides removing duplication, the grouping of related rules improves the readability and maintainability of the resulting #CSS. The specification defines a new selector, the "nesting selector", written as an ASCII ampersand "&"
3
3
3
6
Can you post the actual code as alt text instead of a description of it? Thank you.
1
Replying to @cadars
Here it is (thx for the nudge!): table.colortable { & td { text-align:center; &.c { text-transform:uppercase } &:first-child, &:first-child + td { border:1px solid black } } & th { text-align:center; background:black; color:white; } }

Aug 31, 2021 · 2:08 PM UTC

1