Last active
August 24, 2016 15:45
-
-
Save danyalette/221d1e2f5aa5c547b3e5999c8e445262 to your computer and use it in GitHub Desktop.
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
/* assuming you are programmatically adding the following classes to the body: | |
- text-zoom-70 | |
- text-zoom-100 | |
- text-zoom-130 | |
*/ | |
@mixin font-size-accessible($font-size) { | |
font-size: $font-size; | |
/* define possible suffixes of text-zoom-[percent] body class */ | |
$font-size-multipliers: 70 100 130; | |
@each $multiplier in $font-size-multipliers { | |
body.text-zoom-#{$multiplier} & { | |
font-size: $font-size*($multiplier/100); | |
/* if you are, conversely, trying to *reverse* a device's text zoom, do: | |
font-size: $font-size*(100/$multiplier); | |
*/ | |
} | |
} | |
} | |
.icon { | |
@include font-size-accessible(14px); | |
} | |
.caption { | |
@include font-size-accessible(11px); | |
} |
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
/* assuming you are programmatically adding the following classes to the body: - text-zoom-70 - text-zoom-100 - text-zoom-130 | |
*/ | |
.icon { font-size: 14px; } | |
body.text-zoom-70 .icon { font-size: 9.8px; } | |
body.text-zoom-100 .icon { font-size: 14px; } | |
body.text-zoom-130 .icon { font-size: 18.2px; } | |
.caption { font-size: 11px; } | |
body.text-zoom-70 .caption { font-size: 7.7px; } | |
body.text-zoom-100 .caption { font-size: 11px; } | |
body.text-zoom-130 .caption { font-size: 14.3px; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment