Emmet in VSCode - CSS - How do I multiply lines?
In HTML I can do:
div.item_$*5
and get:
<div class="item_1">
<div class="item_2">
<div class="item_3">
<div class="item_4">
<div class="item_5">
but in CSS I don't seem to be able to do:
.item_$*5
and get:
.item_1 {}
.item_2 {}
.item_3 {}
.item_4 {}
.item_5 {}
any idea how to do it or is it just a missing feature?
Posted May 10, 2022, 3:50 PM UTC
I may not be correct here, but it sounds like if you're using Emmet for CSS, you might be doing it wrong.
I can understand wanting to make 5 DOM elements, and have an automated mechanism for adding unique attribution to each. In having a harder time imaging common scenarios where you need to do that with style definitions.
Emmet does not act the same in CSS for me as it does in html, jsx, etc (and I would not expect it to). CSS Emmet might be the answer here. It looks like that sort of CSS support for Emmet does not exist right out of the box, but maybe you just need to install it?
Okay. it just seems like a useful feature and im not sure why it doesn't exist.