Guest User

Untitled

a guest
Feb 15th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. // HOW TO USE BREAKPOINT VARIABLES
  2. // `@media #{$desktop} {
  3. // CSS: GOES HERE;
  4. // }`
  5.  
  6. // Breakpoints (we use pixels so we can still have mobile-last queries)
  7. $tiny-phone-bp: 320px;
  8. $phone-bp: 780px;
  9. $tablet-bp: 900px;
  10. $desktop-bp: 1200px;
  11. $big-desktop-bp: 1800px;
  12.  
  13. // Mobile-first variables
  14. $tiny-phone-over: '(min-width: #{$tiny-phone-bp + 1})'; // No phone should be smaller than 320px, so yeah...
  15. $phone-over: '(min-width: #{$phone-bp})';
  16. $tablet-over: '(min-width: #{$tablet-bp})';
  17. $desktop-over: '(min-width: #{$desktop-bp})';
  18. $big-desktop-over: '(min-width: #{$big-desktop-bp})';
  19.  
  20. // Mobile-last variables (subtract a pixel so breakpoints match up)
  21. $phone-under: '(max-width: #{$tiny-phone-bp})';
  22. $tablet-under: '(max-width: #{$phone-bp - 1})';
  23. $desktop-under: '(max-width: #{$tablet-bp - 1})';
  24. $big-desktop-under: '(max-width: #{$desktop-bp - 1})';
  25. $big-desktop-under: '(max-width: #{$big-desktop-bp - 1})';
  26.  
  27. // Tiny phone media queries
  28. $tiny-phone: 'only screen and #{$phone-under}';
  29. $tiny-phone-only: $tiny-phone; // alias
  30. $over-tiny-phone: 'only screen and #{$tiny-phone-over}';
  31. $not-tiny-phone: $over-tiny-phone; // alias
  32.  
  33. // Phone media queries (Tiny phone include in phone besides under)
  34. $under-phone: $tiny-phone-only; // alias
  35. $phone: 'only screen and #{$tablet-under}';
  36. $phone-only: $phone; // alias
  37. $over-phone: 'only screen and #{$phone-over}';
  38. $not-phone: $over-phone; // alias
  39.  
  40. // Portrait tablet media queries
  41. $under-tablet: $phone-only; // alias
  42. $tablet: 'only screen and #{$phone-over}';
  43. $tablet-only: '#{$tablet} and #{$desktop-under}';
  44. $over-tablet: 'only screen and #{$tablet-over}';
  45. $not-tablet: '#{$under-tablet}, #{$over-tablet}';
  46.  
  47. // Landscape tablet (and small laptop) media queries
  48. $under-desktop: 'only screen and #{$desktop-under}';
  49. $desktop: $over-tablet; // alias
  50. $desktop-only: '#{$desktop} and #{$big-desktop-under}';
  51. $over-desktop: 'only screen and #{$desktop-over}';
  52. $not-desktop: '#{$under-desktop}, #{$over-desktop}';
  53.  
  54. // Desktop (and large laptop) media queries
  55. $under-desktop: 'only screen and #{$big-desktop-under}';
  56. $big-desktop: $over-desktop; // alias
  57. $big-desktop-only: '#{$big-desktop} and #{$big-desktop-under}';
  58. $over-desktop: 'only screen and #{$big-desktop-over}';
  59. $not-desktop: '#{$under-desktop}, #{$over-desktop}';
  60.  
  61. // Big monitor media queries
  62. $under-big-desktop: 'only screen and #{$big-desktop-under}';
  63. $big-desktop: $over-desktop; // alias
  64. $big-desktop-only: $big-desktop;
  65. $not-big-desktop: $under-big-desktop;
Add Comment
Please, Sign In to add comment