After accidentally using a CSS selector in an HTML template I started wondering if there is a template language or an extension to one that would allow this syntax, and whether it would be useful. So instead of writing this:
<div id="mydiv">
<div class="first column">1</div>
<div class="second column">2</div>
</div>
We could write it like:
<div#mydiv>
<div.first.column>1</div>
<div.second.column>2</div>
</div>
Does something like this exist?
Maybe you mean something like Jade?
It is an HTML preprocessor.
The following:
Will be translated to:
Also, it is not exactly what you’re asking, but you may like Zen Coding. It is a plugin to code HTML at high-speed. GIF showing what it does:
It’s basically:
You should check with your editor if it can support this. FWIW, I use this in VIM and it’s awesome.