Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $breakpoints: (
- 'sm': 767px,
- 'md': 992px,
- 'lg': 1200px
- ) !default;
- /// Mixin to manage responsive breakpoints
- /// author: Hugo Giraudel
- /// @param {String} $breakpoint - Breakpoint name
- /// @require $breakpoints
- @mixin bp($breakpoint) {
- // If the key exists in the map
- @if map-has-key($breakpoints, $breakpoint) {
- // Prints a media query based on the value
- @media (min-width: map-get($breakpoints, $breakpoint)) {
- @content;
- }
- }
- // If the key doesn't exist in the map
- @else {
- @warn "Unfortunately, no value could be retrieved from `#{$breakpoint}`. "
- + "Available breakpoints are: #{map-keys($breakpoints)}.";
- }
- }
Add Comment
Please, Sign In to add comment