You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea of those snippets is to create a property instantly based on some simple rules without selecting it by menu or auto completion. Write one to six characters and you get the property and the value.
Only a few prefixes are twice, because the rules are matching different properties like fs1 -> flex-shrink: 0; and font-size: 0;. Then you have to pick the right one.
The following prefixes are just examples to explain the rules. To see the complete list, please visit SNIPPETS.md. If a property or pattern might be missing, please open an issue on Github and make a suggestion.
Shortcut rules for CSS snippets
1. The first letter in a word or after a minus "-" defines the prefix.
Prefix
Snippet
di
display: inline;
dib
display: inline-block;
wa
width: auto;
2. Numbers are defined by the amount of numbers.
Prefix
Snippet
p1
padding: 0;
p2
padding: 0 0;
p3
padding: 0 0 0;
p4
padding: 0 0 0 0;
w1
width: 0;
zi1
z-index: 0;
3. Colors are defined with "#".
Prefix
Snippet
c#
color: #000000;
b#
background: #000000;
bs1#
border: solid 0#000000;
4. The order of a value list is [function call] [keyword] [numbers] [color].
Prefix
Snippet
bunr2#
background: url() no-repeat 00#000000;
5. Rules are starting with an "@" symbol.
Prefix
Snippet
@i
@import '';
6. An underscore "_" after a prefix defines a brace scope.
Prefix
Snippet
@m_
@media { ... }
7. A dollar sign "$" defines a function call.
Prefix
Snippet
c$
calc();
8. A number after the dollar sign "$" defines the amount of parameters.
Prefix
Snippet
r$3
rgb(0, 0, 0)
r$4
rgba(0, 0, 0, 1)
Shortcut rules for SCSS snippets
1. All CSS snippets are available in SCSS, too.
Prefix
Snippet
t
true
f
false
n
null
2. Rules are starting with an "@" symbol.
Prefix
Snippet
@c1
@content;
3. An underscore "_" after a prefix defines a brace scope.
Prefix
Snippet
@i_
@if CONDITION { ... }
4. Variables are starring with a "$" sign.
Prefix
Snippet
$1
$name: null;
$d1
$name: null !default;
$g1
$name: null !global;
5. The number "1" defines a one line snippet.
Prefix
Snippet
@e1
@extend NAME;
6. A SassScript expression uses two underscores "__".
Please have the following keyboard shortcuts always in mind, because these are fundamental to get the most out of it. Every tab stop is used only if necessary, because it prevents VS Code to open the IntelliSense menu automatically. So sometimes DownArrow or Cmd/Ctrl + Enter can have the same effect.
macOS
Tab - Jump to the next tab stop of the snippet.
DownArrow - Move the caret down one line.
Cmd + Enter - Insert line below, even if the caret is in the middle of a line.
Cmd + Shift + Enter - Insert line above, even if the caret is in the middle of a line.
Windows / Linux
Tab - Jump to the next tab stop of the snippet.
DownArrow - Move the caret down one line.
Ctrl + Enter - Insert line below, even if the caret is in the middle of a line.
Ctrl + Shift + Enter - Insert line above, even if the caret is in the middle of a line.
Quick SassScript Expression
The following keyboard shortcut improves the writing of a SassScript expression.