Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>px-to-viewportNew to Visual Studio Code? Get it now.
px-to-viewport

px-to-viewport

Rohit Kadam

|
2,738 installs
| (0) | Free
Convert html Pixel to viewport and Rem
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

px to viewport

This is an extension for Visual Studio Code that allows you to convert px to viewport (vh and vw), convert px to min(**vw, **vh) and convert px to rem.

Usage

Keybindings

  • Alt+Shift+W : Converts selected text from px to vw (Viewport Width).
  • Alt+Shift+H : Converts selected text from px to vh (Viewport Height).
  • Alt+Shift+M : Converts selected text from px to min(**vw, **vh).
  • Alt+Shift+R : Converts selected text from px to rem.

Commands (ctrl+shift+p)

  • Convert px to vw : Converts selected text from px to vw (Viewport Width).
  • Convert px to vh : Converts selected text from px to vh (Viewport Height).
  • Convert px to min(**vw, **vh) : Converts selected text from px to min(**vw, **vh).
  • Set Viewport Size : Set screen width and height in pixel.
  • Set Root Font-Size (rem) : Set root font-size in pixel.

Extension Settings

This extension contributes the following settings:

  • px-to-viewport.viewportWidth: number of viewportWidth in px. Default is 720px.
  • px-to-viewport.viewportHeight: number of viewportHeight in px. Default is 480px.
  • px-to-viewport.rootFontSize: number of rootFontSize in px. Default is 16px.
  • px-to-viewport.unitPrecision: maximum number of decimals digits a px or vw can have. Default is 2.

Release Notes

1.0.0

Initial release of px-to-viewport


Github

https://github.com/Rohit-B-Kadam/vscode-px-to-viewport-extension If you have any issue or you want to add new feature create a new issue on above github repo

Enjoy!

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