I don’t think square braces are used anywhere in the css spec. A thought occurred to me this morning - why not use them for subproperties - like this
body {
font [
face: Arial;
size: 2em;
style: italic;
weight: bold;
]
}
Yeah, we have property shorthands, but for some modules this is getting out of hand. In particular backgrounds. When a property can have multiples they can be comma separated…
body {
background: [
image: url(some/path);
opacity: .2;
color: #fff;
position: fixed;
size: 50;
], [
image: url(some/path);
opacity: .2;
color: #fff;
position: fixed;
size: 50;
]
}
The idea further is that these could be nestable as seen here with border, where the top property has a more specific call than the other three.
div {
border [
width: 1em;
style: solid;
top [
width: 2em;
]
]
Just a thought. Now someone can come in and tell me why this is utterly stupid and unworkable
BTW, this isn’t a replacement for multi-property shorthand (for example: border: 1px solid #ff0). It’s a more approachable, legible alternative (as it doesn’t require the reader to have memorized the argument order).