Skip to content

This is an extension for Visual Studio Code that allows you to convert px to rpx.

License

Notifications You must be signed in to change notification settings

zhengjiaqi/vscode-px-to-rpx

Repository files navigation

px to rpx

This is an extension for Visual Studio Code that allows you to convert px to rpx.

中文版

Usages

Usage

Install

ext install px-to-rpx

How To Use

  • Smart snippet: (e.g.) input 20px
  • CLI: Press F1, enter px2rpx or px2rpx in selection
  • Context Menu: px2rpx or px2rpx in selection

Keybindings

  • Cmd+Alt+P Px to rpx
  • Alt+Shift+P Converts selected text from px to rpx.

Support Language

html vue swan wxml axml css wxss acss less scss sass stylus tpl

Configuration

Open your user and workspace settings (Code > Preferences > Settings):

  • px-to-rpx.baseWidth base design view width (unit: px), default: 1242
  • px-to-rpx.fixedDigits px to rpx decimal point maximum length, default: 3
  • px-to-rpx.autoRemovePrefixZero Automatically remove prefix 0, default: false

NOTE: Muse be restart vscode after modification

Change log

See Change Log here

Enjoy!

About

This is an extension for Visual Studio Code that allows you to convert px to rpx.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published