This is an extension for Visual Studio Code that allows you to convert px to rem, and vice versa.
Alt+Z
Px to rem, and rem to px. Converts selected text from px to rem, and rem to px.Alt+S
Asks for a new px per rem value.
- Px to rem, and rem to px. Converts selected text from px to rem, and rem to px.
- Px to rem. Converts selected text from px to rem
- Rem to px. Converts selected text from rem to px
- Px per rem. Asks for a new px per rem value.
This extension contributes the following settings:
px-to-rem.px-per-rem
: number of pixels per rem. Default is16
pixels per rem.px-to-rem.number-of-decimals-digits
: maximum number of decimals digits a px or rem can havepx-to-rem.only-change-first-ocurrence
: set to change all or only the first selected ocurrence of px/rempx-to-rem.notify-if-no-changes
: enable/disable notification that alerts the users if no conversion could be made
- If you select a value with multiple cursors it will get converted, but following cursors may change place after the conversion.
- 'Edits from command extension.pxToremAndRemToPx were not applied' message appears in debug console.
- Merged functionality to change px-to-rem with shortcut.
- Fixed bug, minimum number of decimal was 1, not 0
- Added gif for
alt + z
keybinding
- Fixed bug where text was being selected after conversion.
- There's no need to select a value to modify it. Now you only have to have the curso next to the value.
- Modified readme
- Fixed bug, The program was not finding all the px and rems in the selections
- Introduced an option to set the maximum number of decimals digits a rem and px can have
- Keybinding added
- Improved Readme, and fixed some typos
- New command that allows you to covert rem and px back and forward
Initial release
Feel free to fork this repository and use it the way you like. If you want to propose a nice new feature, just create a pull request from you forked branch. My github
Enjoy!