LoginSignup
2
2

More than 5 years have passed since last update.

VSCodeでプロジェクト用にスニペットを作ってみる

Posted at

知らなかった。vscodeのアップデートで使えるようになってたのね。結構前に。
Project level snippets

人が作ったsassとかそれぞれのmixinを作ってる場合があるから、いちいち打ち込むの面倒。

作り方

プロジェクトディレクトリ内の.vscodeディレクトリの中に、*.code-snippetsファイルを作る。
今回の場合は、scssファイルのスニペットのためscss.code-snippetsを作成。

.vscode/
  scss.code-snippets
scss.code-snippets
{
  "media query": {
    "prefix": "q",
    "body": [
      "@include query($$break) {",
      " $0",
      "}"
    ],
    "description": "sass snippet for media query"
  }
}

これでscssファイルでqと打つと候補が表示されるようになる。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2