ron0115 / vscode-image-snippets

generate image snippets insert to your editor

Home Page:https://marketplace.visualstudio.com/items?itemName=ron0115.image-snippets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image Snippets

"Image Snippets" can detect your image source path at last line, auto complete some snippets such as width / height.

Features

Custom your snippets template

width:${width}px; height:${height}px;

feat-default

background-size: ${width}px ${height}px;

feat-custom

detect alias in project

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 */
}

feat-custom

Extension Settings

  • 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

TODO

  • Support alias detected in tsconfig.json or jsconfig.json
  • Support http(s) url detect
  • Support Array for Extention.tpl, set multi spinnets avaliable!
  • Get more variables about image information injects to template if need

About

generate image snippets insert to your editor

https://marketplace.visualstudio.com/items?itemName=ron0115.image-snippets

License:MIT License


Languages

Language:TypeScript 100.0%