G
G
GAS-ART2021-08-13 10:15:21
Visual Studio Code
GAS-ART, 2021-08-13 10:15:21

How to make custom code snippet only for scss files in VS Code?

I want to write an abbreviation that will only work in SCSS files.
Here is an example code:

"mediaMaxWidth": {
    "scope": "scss",
    "prefix": "md",
    "body": [
      "@media (max-width: $1px) {",
      "$2",
      "}",
    ]
  },

I know that the "scope" key determines in which language this abbreviation will be displayed. But when I try to write scope": "scss", scope": "css" or scope": "sass" the code snippet stops working, it doesn't seem to see this language. You can remove this key, but then the code snippet starts working in all files.Maybe there are some values ​​for "scope" so that it would be displayed only in scss files?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-08-13
@Gavr_Gavr

Ctrl + Shit + P > Configure User Snippet > SCSS
Or just rename your snippet file to scss.json. And scopetake away.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question