Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. // ----
  2. // Sass (vundefined)
  3. // Compass (vundefined)
  4. // dart-sass (v1.18.0)
  5. // ----
  6.  
  7. // $bp-min: 300px;
  8. //
  9. // .test {
  10. // color: red;
  11. // @include mq(min, $bp-min){
  12. // color: blue;
  13. // }
  14. // }
  15. // -----------------------------------
  16. // .test2 {
  17. // color: red;
  18. // @include mq(min, 300px){
  19. // color: blue;
  20. // }
  21. // }
  22. // -----------------------------------
  23. // .test3 {
  24. // color: red;
  25. // @include mq(min-max, 400px, 800px) {
  26. // color: blue;
  27. // }
  28. // }
  29.  
  30.  
  31. @mixin mq($dimension, $breakpoint, $breakpoint2:false) {
  32. @if $dimension == min {
  33. @media screen and (min-width: $breakpoint) {
  34. @content;
  35. }
  36. } @else if $dimension == max {
  37. @media screen and (max-width: $breakpoint) {
  38. @content;
  39. }
  40. } @else if $dimension == min-max {
  41. @media screen and (min-width: $breakpoint) and (max-width: $breakpoint2) {
  42. @content;
  43. }
  44. }
  45. }
  46.  
  47. .test1 {
  48. color: green;
  49.  
  50. @include mq(min, 400px){
  51. color: #000;
  52. }
  53. }
  54. .test2 {
  55. color: blue;
  56.  
  57. @include mq(max, 800px) {
  58. color: red;
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement