Skip to content

Instantly share code, notes, and snippets.

@matuzo
Last active November 11, 2022 21:02
Show Gist options
  • Save matuzo/188a81a567dc4780690c699c822ec387 to your computer and use it in GitHub Desktop.
Save matuzo/188a81a567dc4780690c699c822ec387 to your computer and use it in GitHub Desktop.
My VS Code Emmet abbreviations
{
"html": {
"snippets": {
"nav": "nav[aria-label='${1:Main}']>ul>(li>a[aria-current='page']{${1:Current Page}})+(li*3>a{${0:Another Page}})",
"img:l": "img[width height loading='lazy']",
"preload": "link[rel=preload href as]",
"page": "header>h1^main+footer{${0:©}",
"meta:vp": "meta[name=viewport content='width=device-width, initial-scale=1.0']",
"meta:utf": "meta[charset=${charset}]",
"style": "style>{\\* { box-sizing: border-box; \\}}+{\n${1:*}:focus \\{${2: outline: 2px solid red; }\\} }+{\n${0}}",
"!": "{<!DOCTYPE html>}+html[lang=${1}${lang}]>(head>meta:utf+meta:vp+{}+title{${2:New document}}+{}+style)+body>(h1>{${3: Document}})+{${0}}",
"!!": "{<!DOCTYPE html>}+html[lang=${1}${lang}].no-js>{<!-- TODO: Check lang attribute --> }+(head>meta:utf+meta:vp+{}+title{${1:πŸ›‘ Change me}}+{}+(script[type=\"module\"]>{document.documentElement.classList.replace('no-js', 'js');})+{}+link:css+link:print+{}+meta[name=\"description\"][content=\"${2:πŸ›‘ Change me (up to ~155 characters)}\"]+{<!-- TODO: Change page description --> }+meta[name=\"theme-color\"][content=\"${2:#FF00FF}\"])+body>page",
"!!!": "{<!DOCTYPE html>}+html[lang=${1}${lang}].no-js>{<!-- TODO: Check lang attribute --> }+(head>meta:utf+meta:vp+{}+title{${1:πŸ›‘ Change me}}+{}+(script[type=\"module\"]>{document.documentElement.classList.replace('no-js', 'js');})+{}+link:css+link:print+{}+meta[property=\"og:title\"][content=\"${1:πŸ›‘ Change me}\"]+meta[name=\"description\"][content=\"${2:πŸ›‘ Change me (up to ~155 characters)}\"]+meta[property=\"og:description\"][content=\"${2:πŸ›‘ Change me (up to ~155 characters)}\"]+meta[property=\"og:image\"][content=\"${1:https://}\"]+meta[property=\"og:locale\"][content=\"${1:en_GB}\"]+meta[property=\"og:type\"][content=\"${1:website}\"]+meta[name=\"twitter:card\"][content=\"${1:summary_large_image}\"]+meta[property=\"og:url\"][content=\"${1:https://}\"]+{<!-- TODO: Change social media stuff --> }+{}+link[rel=\"canonical\"][href=\"${1:https://}\"]+{<!-- TODO: Change canonical link --> }+{}+link[rel=\"icon\"][href=\"${1:/favicon.ico}\"]+link[rel=\"icon\"][href=\"${1:/favicon.svg}\"][type=\"image/svg+xml\"]+link[rel=\"apple-touch-icon\"][href=\"${1:/apple-touch-icon.png}\"]+link[rel=\"manifest\"][href=\"${1:/my.webmanifest}\"]+{}+meta[name=\"theme-color\"][content=\"${2:#FF00FF}\"])+body>page+{}+script:src[type=\"module\"]"
}
},
"css": {
"snippets": {
"debug": "outline: 5px solid red;\noutline-offset: -5px;",
"center": "display: flex;\njustify-content: center;\nalign-items: center;",
"sticky": "position: sticky;\ntop: ${1:0};\nleft: ${2:0};"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment