Skip to content

Instantly share code, notes, and snippets.

@IainIsCreative
Last active October 27, 2015 00:00
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 IainIsCreative/73ea36ca8e4d332f0b2c to your computer and use it in GitHub Desktop.
Save IainIsCreative/73ea36ca8e4d332f0b2c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin breakpoint($breakpoint) {
// The following code no longer works in libSass 3.3.0
// It will return an error and say it can't pass a content block
//Check if the value passed in is a unitless number
@if not unitless($breakpoint) {
//Pass an error if not unitless.
@error 'Your value for `$breakpoint` is not unitless. Please try again.';
} @else {
$bp: ($breakpoint / 16) * 1em;
//Set Media Query and pass through a number.
@media screen and (min-width: $bp) {
@content;
}
}
}
@include breakpoint(600) {
.element {
width: 480px;
}
}
@media screen and (min-width: 37.5em) {
.element {
width: 480px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment