Skip to content

Instantly share code, notes, and snippets.

@hanspagel
Created March 16, 2015 10:50
Show Gist options
  • Save hanspagel/418aeb18c1a152e91c75 to your computer and use it in GitHub Desktop.
Save hanspagel/418aeb18c1a152e91c75 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
// Breakpoints
$tiny: 320;
$small: 480;
$medium: 800;
// Mixin
@mixin font-sizes($default, $sizes) {
font-size: $default;
@each $breakpoint, $size in $sizes {
@media all and (min-width: $breakpoint) {
font-size: $size;
}
}
}
// Example
.h1 {
@include font-sizes(
36,
(
$tiny: 40,
$small: 50,
$medium: 70
));
}
.h1 {
font-size: 36;
}
@media all and (min-width: 320) {
.h1 {
font-size: 40;
}
}
@media all and (min-width: 480) {
.h1 {
font-size: 50;
}
}
@media all and (min-width: 800) {
.h1 {
font-size: 70;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment