Skip to content

Instantly share code, notes, and snippets.

@ben-rogerson
Created July 8, 2018 13:12
Show Gist options
  • Save ben-rogerson/54ea42b67a0835476de164d4866e8489 to your computer and use it in GitHub Desktop.
Save ben-rogerson/54ea42b67a0835476de164d4866e8489 to your computer and use it in GitHub Desktop.
SCSS Snippits for VSCode
{
// Place your snippets for scss here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Margin right auto": {
"prefix": "mra",
"body": [
"margin-right: auto;"
]
},
"Margin left auto": {
"prefix": "mla",
"body": [
"margin-left: auto;"
]
},
"Margin left + right auto": {
"prefix": "mlra",
"body": [
"margin-left: auto;",
"margin-right: auto;",
"${0:max-width: 20rem;}"
]
},
"Flex center": {
"prefix": "center",
"body": [
"display: flex;",
"justify-content: center;",
"align-items: center;",
"text-align: center;",
"${0:flex-direction: column;}"
]
},
"Hover focus active on current element": {
"prefix": "hocus",
"body": [
"&:hover,",
"&:focus {",
" $1",
"}",
"",
"&:active {",
" $2",
"}",
""
]
},
"Bem child": {
"prefix": "_",
"body": [
"&__$1 {",
" $2",
"}",
""
]
},
"Bem modifier": {
"prefix": "__",
"body": [
"&--$1 {",
" ${2}",
"}",
""
]
},
"Block variable": {
"prefix": "block",
"body": [
"\\$block: #{&};${0:#{\\$block\\}}",
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment