WeBuilder Plugin: CSS Unit Converter v1.0
Convert stylesheet units from one format to another.
Can convert a pixel based stylesheet into em, rem, vmax, vmin etc, or the other way around.
Can also be used to scale the current units.
Code fully commented, so it might be useful as reference for other plugin authors
Installation:
1) Download plugin .ZIP file.
2) Open WeBuilder and select "Plugins -> Manage Plugins" from the menu.
3) Click "Install" and select the .ZIP file you downloaded in step 1.
Usage:
1) Select a block of CSS code.
2) Activate the plugin from the "Plugins" menu or press the hotkey CTRL-ALT-U
3) Fill in the values for your conversion and click the "OK" Button.
How it works:
It finds the selected CSS unit and divides the number with the "Base Size" using formula: NewSize = UnitSize/BaseSize.
(If "Invert base size" is checked, then the formula is: NewSize = UnitSize*BaseSize.)
Feedback appreciated.
(I only use WeBuilder, so I haven't tested if it works in HTMLPad, Rapid CSS or Rapid PHP.)