Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>px to rpxNew to Visual Studio Code? Get it now.
px to rpx

px to rpx

zhengjiaqi

|
18,409 installs
| (2) | Free
This is an extension for Visual Studio Code that allows you to convert px to rpx.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft