Code Monkey home page Code Monkey logo

vscode-px-to-u's Introduction

https://img.shields.io/badge/vscode-1.25.0-brightgreen.svg https://img.shields.io/badge/typescript-passing-blue.svg

px to U

A plugin that provides suggestions for converting px to vw, vh, rem, and custom units

支持px转换vw、vh、rem以及自定义转换的提示插件

Demo

支持文件类型

  • html
  • vue
  • css
  • less
  • scss
  • sass
  • stylus

如果非上述文件格式,可通过右下角select language mode选择上述任意一个格式,就可触发提示。

配置

可通过快捷键Ctrl + ,打开设置页面,搜索px to u;

  1. width,设计稿宽度,默认值750。用于转换vw、rem
  2. height,设计稿高度,默认值667。用于转换vh
  3. toFixedNum,小数点后保留位数,默认值4
  4. customXX,自定义提示项,默认值1%xx。格式为rate%unit,rate需为有效数字,unit为自定义的单位。如1%xx,4px可以通过计算(4*1)xx,最后出来结果就是4xx。

命令

可将当前文件中的指定css单位全部替换

Supported File Types

  • html
  • vue
  • css
  • less
  • scss
  • sass
  • stylus

For non-listed file formats, you can trigger suggestions by selecting any of the above formats using the select language mode in the lower right corner.

Configuration

You can open the settings page by using the shortcut Ctrl + ,, then search for px to u.

  1. width, design width, default value 750. Used for vw and rem conversions.
  2. height, design height, default value 667. Used for vh conversions.
  3. toFixedNum, decimal places to round to, default value 4.
  4. customXX, custom suggestion item, default value 1%xx. Format: rate%unit, where rate should be a valid number, and unit is the custom unit. For example, 1%xx means 4px can be calculated as (4*1)xx, resulting in 4xx.

Command

You can replace all specified CSS units in the current file.

vscode-px-to-u's People

Contributors

adokevin avatar proeagle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.