Last active
October 6, 2015 07:28
-
-
Save hail2u/2958126 to your computer and use it in GitHub Desktop.
レスポンシブフォwww
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
@mixin optimize-font-size($sizes) { | |
@each $r in $sizes { | |
$w: $safe-for-full * $r * $r; | |
@media (min-width: $w) { | |
font-size: percentage($r); | |
} | |
} | |
} | |
html { | |
font-size: 100%; | |
@include optimize-font-size((1.125, 1.3125, 1.5, 1.6875, 1.875)); | |
} |
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
@mixin adjust-font-size($sizes) { | |
@each $s in $sizes { | |
$r: $s / 16px; | |
$f: min-width; | |
$v: 58.24969em * $r * 1.25; | |
@if ($r < 1) { | |
$f: max-width; | |
$v: $safe-for-content * $r * 0.75; | |
} | |
@media ($f: $v) { | |
font-size: percentage($r); | |
} | |
} | |
} | |
html { | |
font-size: 100%; | |
-webkit-text-size-adjust: 100%; | |
-ms-text-size-adjust: 100%; | |
@include adjust-font-size((14px, 18px, 21px, 24px, 27px, 30px)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
レスポンシブフォwww