R
R
Roman Matveev2022-02-10 16:33:49
Visual Studio Code
Roman Matveev, 2022-02-10 16:33:49

How to make your own snippet in Visual Studio Code so that it works like emmet?

for example, in emmet we write
mt10 and get a tab when expanding margin-top: 10px;
and like this I need to make my own snippet.
I write md768
and
get
@media all and (max-width:768px) { }
========

i.e. the essence is clear, so that immediately after md the numbers fall in expanded form to the places of the size of the breakpoint of the media request.

I found something similar in the documentation for creating snippets, but I could not do just such an option.
Maybe someone has come across this.
Please share.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Matveev, 2022-02-11
@ramzez1

The issue is resolved
I went the other way, I used Emmet itself, or rather its settings.
https://code.visualstudio.com/docs/editor/emmet#_u...
I made my own in the snippets file for emmet and everything worked:

"css": {
    "snippets": {
    "md": "@include max-s(${1}px)  {\n  ${0} \n}"
    }
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question