Skip to content

Instantly share code, notes, and snippets.

@taupecat
Last active August 29, 2015 14:16
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 taupecat/ddda78b8ed608d3edf6c to your computer and use it in GitHub Desktop.
Save taupecat/ddda78b8ed608d3edf6c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// Breakpoint (v2.5.0)
// ----
@import "breakpoint";
/** Breakpoint settings */
$breakpoints: (
"medium": 690px,
"wide": 960px,
"hidpi": 1.5dppx
);
/**
* bp: return the requested breakpoint
* @param {string} $value The key in the Sass map
* @return {number} The value in the Sass map
*
* Requires $breakpoints Sass map to be set.
*/
@function bp( $value ) {
@if not map-has-key( $breakpoints, $value ) {
@error "ERROR: Requested value '#{$value}' was not found in the breakpoints map.";
}
$breakpoint: map-get( $breakpoints, $value );
@return $breakpoint;
}
.icon {
background-image: url("../images/icon.png");
@include breakpoint( bp( "hdpi" ) ) { // Note the misspelling
background-image: url("../images/icon@2x.png");
}
}
ERROR: Requested value 'hdpi' was not found in the breakpoints map.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment