Skip to content

Instantly share code, notes, and snippets.

@hail2u
Last active October 6, 2015 07:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hail2u/2958126 to your computer and use it in GitHub Desktop.
Save hail2u/2958126 to your computer and use it in GitHub Desktop.
レスポンシブフォwww
@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));
}
@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));
}
@wozozo
Copy link

wozozo commented Jun 20, 2012

レスポンシブフォwww

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment