-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BsWiM
committed
Nov 14, 2013
1 parent
87dbf00
commit 4f2121c
Showing
1 changed file
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,50 @@ | ||
REM-PX | ||
====== | ||
|
||
Allows easy conversion of rem to px and px to rem. | ||
A Sublime Text plugin that allows easy conversion of rem to px and px to rem. | ||
|
||
## Installation | ||
You can easily install the pluing through Will Bond's excellent Package Control (https://sublime.wbond.net/). | ||
If you want to install this plugin manually for some reason, simply clone this repo into your packages directory (make sure not to put it in the user sub dir). | ||
|
||
## Instructions | ||
|
||
### Converting px to rem | ||
1. Select a px value (e.g. '16px') | ||
2. Hit ctrl+shift+r by default (cmd+shift+r on Mac OS) to convert the value to rem. (Can also be done by selecting 'Convert highlighted px to rem' under the tools menu) | ||
|
||
### Converting rem to px | ||
1. Select a rem value (e.g. '1rem') | ||
2. Hit ctrl+shift+x by default (cmd+shift+x on Mac OS) to convert the value to px. (Can also be done by selecting 'Convert highlighted rem to px' under the tools menu) | ||
|
||
## Supported Features | ||
- Convert px values to rem | ||
- Convert rem values to px | ||
- Checks to make sure the value is a valid px unit to convert to rem and visa versa | ||
|
||
## Notes | ||
1. The default size of 1rem is 16px which can be changed in the user settings. | ||
2. All values will remove trailing zero's (e.g. '1.500rem' would become '1.5rem'). | ||
|
||
## Examples (1rem = 16px) | ||
|
||
### Example 1 (rem to px) | ||
```css | ||
font-size: 1rem | ||
``` | ||
|
||
Will convert to: | ||
```css | ||
font-size: 16px | ||
``` | ||
|
||
### Example 2 (px to rem) | ||
|
||
```css | ||
font-size: 16px | ||
``` | ||
|
||
Will convert to: | ||
```css | ||
font-size: 1rem | ||
``` |