Last active
August 29, 2015 14:09
-
-
Save halofx/f00853e0607af378f111 to your computer and use it in GitHub Desktop.
PX to Rem with reset
This file contains hidden or 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
| // ---- | |
| // Sass (v3.4.7) | |
| // Compass (v1.0.1) | |
| // ---- | |
| // set rem and em to 10px | |
| html { font-size: 62.5%; } | |
| $base-font-size: 10px; | |
| $rem-ratio: $base-font-size / 1rem; | |
| @mixin rem($key,$px) { | |
| #{$key}: $px; | |
| #{$key}: $px/$rem-ratio; | |
| } | |
| // Usage | |
| p { | |
| @include rem(font-size,14px); | |
| } |
This file contains hidden or 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
| html { | |
| font-size: 62.5%; | |
| } | |
| p { | |
| font-size: 14px; | |
| font-size: 1.4rem; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment