4 ms·
I don't understand why they didn't do something like this instead: div.foo#thing { text: "Foo" } Generates this: <div class="foo" id="thing
by spoiler 5y ago
I don't understand why they didn't do something like this instead:
div.foo#thing {
text: "Foo"
}
Generates this:
<div class="foo" id="thing">Foo</div>
I realise that there's issues with css name collisions, but there's different ways that can be resolved by the compiler.
- cabalamat 5y agoThat makes sense -- only give a tag an id if it needs one. It only needs one if ti's being referred to somewhere, and when that happens the user can give it a name, such as "thing" in this example.
- fao_ 5y agoSee, that's exactly what I thought when I said about this. I mean, worst case, give everything an id but don't _output_ it!
- rowanseymour 5y agoWas thinking the same thing. Or just copy HAML which would be... %div.foo#thing Foo
- LastMuel 5y agoThis is how JADE/PUG handled it. And, for anyone that's used css, querySelector or jQuery, it seems quite natural. I also wonder why the author didn't pick up these standard methodologies and continue from there.