Skip to content

Instantly share code, notes, and snippets.

@stphn
Last active August 22, 2019 09:19
Show Gist options
  • Save stphn/fd3dc91890ca2008ac7d5ca69082e4ee to your computer and use it in GitHub Desktop.
Save stphn/fd3dc91890ca2008ac7d5ca69082e4ee to your computer and use it in GitHub Desktop.
vscode snippets
{
"require": {
"prefix": "require",
"body": [
"$1: require('../$1/$1.data')"
],
"description": "Require data"
}
}
{
"Add row and column": {
"prefix": "row",
"body": [
"<div class=\"row\">",
"\t<div class=\"column\">$1</div>",
"\t<div class=\"column\">$2</div>",
"</div>"
],
"description": "Add Basicgrid row and column"
},
"Nunjucks inject": {
"prefix": "inject",
"body": [
"{% inject \"$1/$1.njk\", $1 %}"
],
"description": "Nunjucks inject"
},
"Bodytext Safe": {
"prefix": "bdt",
"body": [
"{{bodytext | safe}}"
],
"description": "Bodytext with safe tag"
},
"If target": {
"prefix": "tar",
"body": [
"target=\"{{ href.target | default('_blank') }}\""
],
"description": "If target"
},
"href": {
"prefix": "link",
"body": [
"<a href=\"{{ item.href.value }}\" {% if item.href.target %}target=\"{{ item.href.target | default('_blank') }}\"{% endif %}>",
"\t{{ item.label }}",
"</a>",
],
"description": "link"
}
}
{
"add color": {
"prefix": "cc",
"body": [
"color('$1');"
],
"description": "Add color variables"
},
"add media": {
"prefix": "media",
"body": [
"@media (${1|min,max|}-width: ${2|$bpS,$bpM,$bpL|}) {",
"\t$0",
"}"
],
"description": "Add media queries"
},
"transition": {
"prefix": "trans",
"body": [
"transition: $1 $$duration $$timing;",
"$2"
],
"description": "Add Transition shorthand"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment