Plugin: CSS Unit Converter v1.0

Browse, download and discuss plugins for Blumentals code editors
Post Reply
User avatar
pmk65
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Plugin: CSS Unit Converter v1.0

Post by pmk65 »

WeBuilder Plugin: CSS Unit Converter v1.0

Image

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.)
Attachments
CSS Unit Converter.zip
(4.49 KiB) Downloaded 672 times
There are 10 types of people in the world: Those who understand binary and those who don't.
Post Reply