Last active
August 29, 2015 14:04
-
-
Save klongdesigns/b02c7ab5630781947302 to your computer and use it in GitHub Desktop.
Less file for setting font sizes in rem
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
//mixin declaration | |
.font-size(@sizeValue) { | |
@remValue: @sizeValue; | |
@pxValue: @sizeValue; | |
font-size: ~"@{pxValue}px"; | |
font-size: ~"@{remValue}rem"; | |
} | |
//media queries set | |
font-size: .9px; | |
/* Small devices (tablets, 768px and up) */ | |
@media (min-width: @screen-sm-min) { | |
html { | |
font-size: .8px; | |
} | |
} | |
/* Medium devices (desktops, 992px and up) */ | |
@media (min-width: @screen-md-min) { | |
html { | |
font-size: 1px; | |
} | |
} | |
/* Large devices (large desktops, 1200px and up) */ | |
@media (min-width: @screen-lg-min) { | |
} |
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
This of course assumes you are using font-size = 1px. | |
@mixin font-size($sizeValue) { | |
font-size: ($sizeValue) + px; | |
font-size: $sizeValue + rem; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment