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.