Guest User

Untitled

a guest
Feb 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $breakpoints: (
  2. 'sm': 767px,
  3. 'md': 992px,
  4. 'lg': 1200px
  5. ) !default;
  6.  
  7. /// Mixin to manage responsive breakpoints
  8. /// author: Hugo Giraudel
  9. /// @param {String} $breakpoint - Breakpoint name
  10. /// @require $breakpoints
  11. @mixin bp($breakpoint) {
  12. // If the key exists in the map
  13. @if map-has-key($breakpoints, $breakpoint) {
  14. // Prints a media query based on the value
  15. @media (min-width: map-get($breakpoints, $breakpoint)) {
  16. @content;
  17. }
  18. }
  19.  
  20. // If the key doesn't exist in the map
  21. @else {
  22. @warn "Unfortunately, no value could be retrieved from `#{$breakpoint}`. "
  23. + "Available breakpoints are: #{map-keys($breakpoints)}.";
  24. }
  25. }
Add Comment
Please, Sign In to add comment