_functions.breakpoints.scss 1019 B

123456789101112131415161718192021222324252627282930313233
  1. // Based upon the fine work and thoughts from Bootstrap v4.
  2. //
  3. // Copyright 2011-2018 The Bootstrap Authors
  4. // Copyright 2011-2018 Twitter, Inc.
  5. // Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  6. // Name of the next breakpoint, or null for the last breakpoint.
  7. //
  8. // >> breakpoint-next(sm)
  9. // md
  10. @function breakpoint-next($name) {
  11. $breakpoint-names: map-keys($breakpoints);
  12. $n: index($breakpoint-names, $name);
  13. @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
  14. }
  15. // Minimum breakpoint width. Null for the smallest (first) breakpoint.
  16. //
  17. // >> breakpoint-min(sm)
  18. // 50em
  19. @function breakpoint-min($name) {
  20. $min: map-get($breakpoints, $name);
  21. @return if($min != 0, $min, null);
  22. }
  23. // Maximum breakpoint width. Null for the largest (last) breakpoint.
  24. //
  25. // >> breakpoint-max(sm)
  26. // 56.1875em
  27. @function breakpoint-max($name) {
  28. $next: breakpoint-next($name);
  29. @return if($next, breakpoint-min($next) - 0.0625em, null);
  30. }