This extension contains property snippets for CSS and rule snippets for SCSS.
- Added
_
for child brace scope& { ... }
. - Added
__
for simple brace scope#{}
in SCSS. - Added
#{clipboard}
and#{selection}
for keyboard shortcut usage. - Added
grid
properties. - Added
writing-mode
property. - Added
isolation
property. - Added
block
andinline
properties forborder
,margin
andpadding
. - Added SCSS module functions.
- Added
$1
,$d1
and$g1
for SCSS variable declaration. - Added
true
,false
andnull
for SCSS. - Changed prefix for color from
_
to#
. - Simplified SCSS include.
- Strings are always single quote.
- Some fixes and clean up like simplified font.
- Eliminated a lot of duplicated prefixes with value selection.
- Removed properties with prefixes.
- Introduction
- Shortcut rules for CSS snippets
- Shortcut rules for SCSS snippets
- Recommended Settings
- Recommended Keyboard Shortcuts
- Recommended Extensions
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.
Prefix | Snippet |
---|---|
di |
display: inline; |
dib |
display: inline-block; |
wa |
width: auto; |
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; |
Prefix | Snippet |
---|---|
c# |
color: #000000; |
b# |
background: #000000; |
bs1# |
border: solid 0 #000000; |
Prefix | Snippet |
---|---|
bunr2# |
background: url() no-repeat 0 0 #000000; |
Prefix | Snippet |
---|---|
@i |
@import ''; |
Prefix | Snippet |
---|---|
@m_ |
@media { ... } |
Prefix | Snippet |
---|---|
c$ |
calc(); |
Prefix | Snippet |
---|---|
r$3 |
rgb(0, 0, 0) |
r$4 |
rgba(0, 0, 0, 1) |
Prefix | Snippet |
---|---|
t |
true |
f |
false |
n |
null |
Prefix | Snippet |
---|---|
@c1 |
@content; |
Prefix | Snippet |
---|---|
@i_ |
@if CONDITION { ... } |
Prefix | Snippet |
---|---|
$1 |
$name: null; |
$d1 |
$name: null !default; |
$g1 |
$name: null !global; |
Prefix | Snippet |
---|---|
@e1 |
@extend NAME; |
See also Recommended Keyboard Shortcuts.
Prefix | Snippet |
---|---|
__ |
#{ ... } |
Prefix | Snippet |
---|---|
_ |
& { ... } |
_h_ |
&:hover { ... } |
_0_ |
~ * { ... } |
_1_ |
> * { ... } |
It is recommended to disable auto intellisense for snippet.
"editor.suggest.snippetsPreventQuickSuggestions": true
It is recommended to exclude emmet support for CSS and SCSS in the settings.
"emmet.excludeLanguages": [
"css",
"scss"
]
It is recommended to change the word separators for css and scss.
"[css]": {
"editor.wordSeparators": "`~!#$%^&*()=+[{]}\\|;:'\",.<>/?",
},
"[scss]": {
"editor.wordSeparators": "`~!#%^&*()=+[{]}\\|;:'\",.<>/?",
}
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.
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.
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.
The following keyboard shortcut improves the writing of a SassScript expression.
[
{
"key": "cmd+-",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && !editorReadonly && editorLangId == scss",
"args": { "name": "#{selection}" }
},
{
"key": "alt+cmd+-",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && !editorReadonly && editorLangId == scss",
"args": { "name": "#{clipboard}" }
}
]
[
{
"key": "ctrl+-",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && !editorReadonly && editorLangId == scss",
"args": { "name": "#{selection}" }
},
{
"key": "alt+ctrl+-",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && !editorReadonly && editorLangId == scss",
"args": { "name": "#{clipboard}" }
}
]