Answer the question
In order to leave comments, you need to log in
How to customize snippets in vsCode?
I can't figure out how to achieve the following behavior:
I want to be able to write @mw500 and the snippet will be transformed into
@media (max-width: 500px){
}
Answer the question
In order to leave comments, you need to log in
To make a snippet, go to file-settings-new snippet.
Save file. The snippet file will open, there is an example commented out.
Everything is described in detail. The name of the snippet, the short name by which it will be called, in which files it will work, the snippet body and description.
You will have such a snippet.
"@media500": {
"prefix": "@mw500",
"scope": "css",
"body": [
"@media (max-width: 500px){$1}",
],
"description": " Including @media"
},
The $ sign is where the cursor will be positioned after the snippet has expanded.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question