Skip to content

Instantly share code, notes, and snippets.

@eduardoboucas
Created July 29, 2015 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduardoboucas/c3d7d4953d00d10141d3 to your computer and use it in GitHub Desktop.
Save eduardoboucas/c3d7d4953d00d10141d3 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// Include Media (v1.3.0)
// ----
@import 'include-media';
// ----- Plugin starts here -----
$emBreakpoints: ();
/// Function converts / calculates px to em
/// @param {number} $size - Width in px
/// @param {number} $base - Base size in px, defaults 16px
/// @return {number} Width in em
@function em-calc($size, $base: 16px) {
@return $size / $base * 1em;
}
@each $breakpoint in $breakpoints {
$emBreakpoints: map-merge($emBreakpoints, (nth($breakpoint, 1): em-calc(nth($breakpoint, 2))));
}
$breakpoints: $emBreakpoints;
// ----- Plugin ends here -----
@include media('>=tablet') {
.module1 {
color: tomato;
}
}
@media (min-width: 48em) {
.module1 {
color: tomato;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment