media-queries.scss 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // media aliases and breakpoints
  2. $screen-sm-min: 600px;
  3. $screen-md-min: 960px;
  4. $screen-lg-min: 1280px;
  5. $screen-xl-min: 1920px;
  6. $screen-xs-max: 599px;
  7. $screen-sm-max: 959px;
  8. $screen-md-max: 1279px;
  9. $screen-lg-max: 1919px;
  10. $screen-xl-max: 5000px;
  11. // media devices
  12. @mixin xs {
  13. @media screen and (max-width: #{$screen-xs-max}) {
  14. @content;
  15. }
  16. }
  17. @mixin sm {
  18. @media screen and (min-width: #{$screen-sm-min}) and (max-width: #{$screen-sm-max}) {
  19. @content;
  20. }
  21. }
  22. @mixin md {
  23. @media screen and (min-width: #{$screen-md-min}) and (max-width: #{$screen-md-max}) {
  24. @content;
  25. }
  26. }
  27. @mixin lg {
  28. @media screen and (min-width: #{$screen-lg-min}) and (max-width: #{$screen-lg-max}) {
  29. @content;
  30. }
  31. }
  32. @mixin xl {
  33. @media screen and (min-width: #{$screen-xl-min}) and (max-width: #{$screen-xl-max}) {
  34. @content;
  35. }
  36. }
  37. // media lt queries
  38. @mixin lt-sm {
  39. @media screen and (max-width: #{$screen-xs-max}) {
  40. @content;
  41. }
  42. }
  43. @mixin lt-md {
  44. @media screen and (max-width: #{$screen-sm-max}) {
  45. @content;
  46. }
  47. }
  48. @mixin lt-lg {
  49. @media screen and (max-width: #{$screen-md-max}) {
  50. @content;
  51. }
  52. }
  53. @mixin lt-xl {
  54. @media screen and (max-width: #{$screen-lg-max}) {
  55. @content;
  56. }
  57. }
  58. // media gt queries
  59. @mixin gt-xs {
  60. @media screen and (min-width: #{$screen-sm-min}) {
  61. @content;
  62. }
  63. }
  64. @mixin gt-sm {
  65. @media screen and (min-width: #{$screen-md-min}) {
  66. @content;
  67. }
  68. }
  69. @mixin gt-md {
  70. @media screen and (min-width: #{$screen-lg-min}) {
  71. @content;
  72. }
  73. }
  74. @mixin gt-lg {
  75. @media screen and (min-width: #{$screen-xl-min}) {
  76. @content;
  77. }
  78. }