generate image snippets insert to your editor
MIT License
"Image Snippets" can detect your image source path at last line, auto complete some snippets such as width / height.
width:${width}px; height:${height}px;
background-size: ${width}px ${height}px;
tsconfig.json
or jsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
.icon {
background: url(~@/img/icon.png);
/* parse to path: ${rootDir}/src/img/icon.png */
/* and return snippets below */
}
Extension.tpl
: Custom snippets template, (e.g. width: ${width}px;
)
some Available Variables below to inject into template
variable | description |
---|---|
width | image original width |
height | image original height |
alias
detected in tsconfig.json
or jsconfig.json
Extention.tpl
, set multi spinnets avaliable!