Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>px-transformNew to Visual Studio Code? Get it now.
px-transform

px-transform

Tingkeng

|
1,704 installs
| (1) | Free
convert one css unit to another, like px rem vw and so on
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Buy Me a Coffee ☕️

px-transform

This is an extension for Visual Studio Code that enable you to convert any css unit. For example:

  • px -> rem
  • px -> rpx
  • px -> vw
  • rem -> px
  • 2px -> 4px
  • any.....

Usage

For example:

px -> rem:

2px -> 4px:

Using this extension is easy:

  1. Install it.

  2. Config it in your VSCode Setting

  3. Select the parts that need to be converted.

  4. Press "Alt + Z" (Mac press "option + Z").


中文介绍:

  • 作用一:把任意 css 单位转换成另一种 css 单位。你可能有这样的转换需求:

    • px -> rem
    • px -> rpx
    • px -> vw
    • rem -> px
    • ......
    • 等等都可以实现...
  • 作用二:对数值做乘法,如要把所有的 px 都乘 2:

    • 2px -> 4px

github

https://github.com/tkaabbc/vscode-px-transform

Enjoy!

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