Using
HTML/Pug/Jade
Prefix | Snippets | |
---|---|---|
doctype | $1 | |
a | $2$3 | |
abbr | $2$3 | |
address | $1 | |
area | $5 | |
article | | |
aside | $2 | |
audio | ||
b | $1$2 | |
base | $3 | |
bdi | $1$2 | |
bdo | $2 | |
big | $1$2 | |
blockquote |
| |
body | $1 | |
br | ||
button | $3 | |
canvas | ||
caption | $2 | |
cite | $1$2 | |
code | $1 $2 | |
col | $2 | |
colgroup | | |
command | ||
datalist | ||
dd | $2 | |
del | ||
details | $1 | |
dialog | $2 | |
dfn | $1$2 | |
div | $1 | |
dl |
| |
dt | $2 | |
em | $1$2 | |
embed | $2 | |
fieldset | ||
figcaption | ||
figure | ||
footer | ||
form | ||
h1 | $1$2 | |
h2 | $1$2 | |
h3 | $1$2 | |
h4 | $1$2 | |
h5 | $1$2 | |
h6 | $1$2 | |
head | $1 | |
header | | |
hgroup | $1 | |
hr | ||
html | $1 | |
html5 | $4 | |
i | $1$2 | |
iframe | $3 | |
img | $3 | |
input | $4 | |
ins | $1$2 | |
keygen | $2 | |
kbd | $1$2 | |
label | $3 | |
legend | $2 | |
li | $1$2 | |
link | $4 | |
main | ||
map | ||
mark | $1$2 | |
menu | ||
menuitem | $2 | |
meta | $3 | |
meter | ||
nav | ||
noscript | ||
object | $5 | |
ol |
| |
optgroup | ||
option | $3 | |
output | $4 | |
p | $1 $2 | |
param | $3 | |
pre | $1 | |
progress | $4 | |
q | $1$2 | |
rp | $2 | |
rt | $2 | |
ruby | $1 | |
s | ||
samp | $1$2 | |
script | ||
section | | |
select | ||
small | $1$2 | |
source | $3 | |
span | $1$2 | |
strong | $1$2 | |
style | ||
sub | $1$2 | |
sup | $1$2 | |
summary | $2 | |
table | | |
tbody | ||
td | $1 | |
textarea | $4 | |
tfoot | ||
thead | $1 | |
th | $1 | |
time | $3 | |
title | $2 | |
tr | ||
track | $5 | |
u | $1$2 | |
ul |
| |
var | $1$2 | |
video |
JavaScript/Typescript
Prefix | Snippets |
---|---|
imp→ | import fs from ‘fs’; |
imn→ | import ‘animate.css’ |
imd→ | import from ‘fs’; |
ime→ | import * as localAlias from ‘fs’; |
ima→ | import < rename as localRename >from ‘fs’; |
rqr→ | require(»); |
req→ | const packageName = require(‘packageName’); |
mde→ | module.exports = <>; |
env→ | export const nameVariable = localVariable; |
enf→ | export const log = (parameter) => < console.log(parameter);>; |
edf→ | export default function fileName (parameter)< console.log(parameter);>; |
ecl→ | export default class Calculator < >; |
ece→ | export default class Calculator extends BaseClass < >; |
con→ | constructor() <> |
met→ | add() <> |
pge→ | get propertyName() |
pse→ | set propertyName(value) <> |
fre→ | array.forEach(currentItem => <>) |
fof→ | for(const item of object) <> |
fin→ | for(const item in object) <> |
anfn→ | (params) => <> |
nfn→ | const add = (params) => <> |
dob→ | const = fs |
dar→ | const [first, second] = [1,2] |
sti→ | setInterval(() => <>); |
sto→ | setTimeout(() => <>); |
prom→ | return new Promise((resolve, reject) => <>); |
thenc→ | .then((res) => <>).catch((err) => <>); |
cas→ | console.assert(expression, object) |
ccl→ | console.clear() |
cco→ | console.count(label) |
cdb→ | console.debug(object) |
cdi→ | console.dir |
cer→ | console.error(object) |
cgr→ | console.group(label) |
cge→ | console.groupEnd() |
clg→ | console.log(object) |
clo→ | console.log(‘object :>> ‘, object); |
ctr→ | console.trace(object) |
cwa→ | console.warn |
cin→ | console.info |
clt→ | console.table |
cti→ | console.time |
cte→ | console.timeEnd |
CSS/Sass/Less/Stylus
Prefix | Snippets |
---|---|
ai | align-items : flex-start; |
aib | align-items : baseline; |
aic | align-items : center; |
aifs | align-items : flex-start; |
aife | align-items : flex-end; |
ais | align-items : stretch; |
as | align-self : flex-start; |
ani | animation : name 1s linear; |
anide | animation-delay : 1s; |
anidi | animation-direction : alternate; |
anidu | animation-duratuion : 1s; |
anifm | animation-fill-mode : forwards; |
aniic | animation-iteration-count: infinite; |
anin | animation-name : name; |
anips | animation-play-state : paused; |
anitf | animation-timing-function: linear; |
bg | background : #fff; |
bga | background-attachment : fixed; |
bgc | background-color : #fff; |
bgcl | background-clip : border-box; |
bgi | background-image : url(«background.jpg»); |
bgo | background-origin : border-box; |
bgp | background-position : left top; |
bgr | background-repeat : no-repeat; |
bgrr | background-repeat : repeat; |
bgrx | background-repeat : repeat-x; |
bgry | background-repeat : repeat-y; |
bgrn | background-repeat : no-repeat; |
bgs | background-size : cover; |
bor | border : 1px solid #000; |
born | border : none; |
borc | border-color : #000; |
bors | border-style : solid; |
borw | border-width : 1px; |
borb | border-bottom : 1px solid #000; |
borl | border-left : 1px solid #000; |
borr | border-right : 1px solid #000; |
bort | border-top : 1px solid #000; |
br | border-radius : 2px; |
bot | bottom : 0; |
bos | box-shadow : 1px 1px 1px 1px rgba(0, 0, 0, .5); |
boz | box-sizing : border-box; |
clr | clear : both; |
col | color : #000; |
con | content : »; |
cur | cursor : auto; |
curp | cursor : pointer; |
curd | cursor : default; |
dis | display : none; |
disb | display : block; |
disi | display : inline-block; |
disn | display : none; |
disf | display : flex; |
flex | flex : 1 1 auto; |
fle | flex : 1 1 auto; |
fld | flex-direction : row; |
fldr | flex-direction : row; |
fldc | flex-direction : column; |
flf | flex-flow : row, wrap; |
flw | flex-wrap : wrap; |
fl | float : left; |
fll | float : left; |
flr | float : right; |
fln | float : none; |
ff | font-family : arial; |
fz | font-size : 12px; |
fst | font-style : italic; |
fsti | font-style : italic; |
fstn | font-style : normal; |
fsto | font-style : oblique; |
fw | font-weight : bold; |
fwb | font-weight : bold; |
fwl | font-weight : light; |
fwn | font-weight : normal; |
ft | font : 12px/1.5; |
hei | height : 1px; |
jc | justify-content : flex-start; |
jcfe | justify-content : flex-end; |
jcfs | justify-content : flex-start; |
jcc | justify-content : center; |
jcsa | justify-content : space-around; |
jcsb | justify-content : space-between; |
lis | list-style : disc outside; |
lisp | list-style-position : outside; |
list | list-style-type : disc; |
listc | list-style-type : circle; |
listd | list-style-type : disc; |
listlr | list-style-type : lower-roman; |
listn | list-style-type : none; |
lists | list-style-type : square; |
listur | list-style-type : upper-roman; |
lef | left : 0; |
lh | line-height : 1.5; |
ls | letter-spacing : 2px; |
lsn | letter-spacing : normal; |
mar | margin : 0; |
marb | margin-bottom : 0; |
marl | margin-left : 0; |
marr | margin-right : 0; |
mart | margin-top : 0; |
mara | margin : 0 auto; |
mih | min-height : 1px; |
miw | min-width : 1px; |
mah | max-height : 1px; |
maw | max-width : 1px; |
opa | opacity : 0; |
ov | overflow : visible; |
ova | overflow : auto; |
ovh | overflow : hidden; |
ovs | overflow : scroll; |
ovv | overflow : visible; |
pad | padding : 0; |
padb | padding-bottom : 0; |
padl | padding-left : 0; |
padr | padding-right : 0; |
padt | padding-top : 0; |
pos | position : relative; |
posa | position : absolute; |
posf | position : fixed; |
posr | position : relative; |
poss | position : sticky; |
rig | right : 0; |
ta | text-align : center; |
tac | text-align : center; |
tal | text-align : left; |
tar | text-align : right; |
td | text-decoration : none; |
tdu | text-decoration : underline; |
tdn | text-decoration : none; |
tdl | text-decoration : line-through; |
ti | text-indent : 2em; |
ts | text-shadow : 1px 1px 1px 1px rgba(0, 0, 0, .5); |
tt | text-transform : capitalize; |
top | top : 0; |
va | vertical-align : baseline; |
vab | vertical-align : bottom; |
vam | vertical-align : middle; |
vat | vertical-align : top; |
vis | visibility : visible; |
visv | visibility : visible; |
vish | visibility : hidden; |
wb | word-break : break-all; |
wid | width : 0; |
wida | width : auto; |
ws | white-space : nowrap; |
wsn | white-space : nowrap; |
wsp | white-space : pre; |
ww | word-wrap : break-word; |
zi | z-index : -1; |
imp | @import ‘filename’; |
inc | @include mixin; |
key | @keyframes name <>; |
med | @media screen and (max-width: 300px) <> |
mix | @mixin name <> |
! | !important |
i | !important |
License
VSCode CSS Snippets
Collection of CSS Snippets to make your life easier by auto-completing common css rules, Tailwind utility classes as css rules — Tailwind and 1 line layouts It’s not debatable, most of us got used to utility classes from Tailwind, BootStrap etc,. But when you come back to write plain CSS, wouldn’t be great to have those utility classes converted as snippets instead of typing the CSS rules? Apart from CSS Utility snippets, collection of snippets from popular CSS examples found all over the web can be found. To see the list of all the CSS Snippets, go here → Want to have your own favourite CSS Snippets in this extension, see Contributing →
Installation
Install via the Visual Studio Code Marketplace → You can enable tab completion (recommended) by opening Code > Preferences > Settings (on a Mac) and applying «editor.tabCompletion»: «onlySnippets» to your personal settings
Table of Contents
- VSCode CSS Snippets
- Description
- Installation
- Table of Contents
- Snippets
- Common
- CSS Reset
- Pseudo Styles
- Breakpoints
- Layout Snippets
- FlexBox Snippets
- Grid Snippets
- Spacing Snippets
- Snippets generation from Selected line/lines
Snippets
Common
CSS Reset
Pseudo Styles
Snippet Purpose hover :hover focus :focus active :active disabled :disabled visited :visited first :first-child last :last-child even :nth-child(2n) odd :nth-child(odd) nth-child :nth-child( rule ) Breakpoints
Snippet Purpose resp Get all tailwind breakpoints — 640px — 768px — 1024px — 1280px resp-sm Get tailwind breakpoint — sm — 640px resp-md Get tailwind breakpoint — md — 768px resp-lg Get tailwind breakpoint — lg — 1024px resp-xl Get tailwind breakpoint — xl — 1280px resp-selected Get all tailwind breakpoints for selected class/classes — 640px — 768px — 1024px — 1280px See how → resp-sm-selected Get tailwind breakpoint for selected class/classes — sm — 640px See how → resp-md-selected Get tailwind breakpoint for selected class/classes — md — 768px See how → resp-lg-selected Get tailwind breakpoint for selected class/classes — lg — 1024px See how → resp-xl-selected Get tailwind breakpoint for selected class/classes — xl — 1280px See how → Создание своих сниппетов в VS Code
VS Code
Как создавать пользовательские сниппеты в редакторе VS Code.
Видео по сниппетам в VS Code
Материалы из видео
Код из видео
< // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope // is left empty or omitted, the snippet gets applied to all languages. 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 $, $ for placeholders. // Placeholders with the same ids are connected. // Example: "Print to console": < "scope": "javascript,typescript", "prefix": "log", "body": ["console.log('$1');", "$2"], "description": "Log output to console" >, /* CSS, SCSS snippets */ "bgimg: Background properties, CSS": < "prefix": "bgimg, bgicon", "scope": "css,scss", "body": [ "background-color: #999;", "background-image: url('$1');", "background-position: center center; // x y", "background-size: cover;", "background-repeat: no-repeat;", "$2" ], "description": "Background properties, CSS" >, >
- Common