Guest User

Untitled

a guest
May 27th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. # A real two-dimensional _CSS Grid_ grid-system
  2.  
  3. Use `css-grid-system.scss` to generate a real two-dimensional **CSS Grid** grid-system.
  4.  
  5. Notes:
  6.  
  7. 1. Unlike the traditional columnar 12-col grid systems, here _you get to choose_ how many columns you need for your layout: 1,2,3,4,5 or 6 (max).
  8. 2. You will probably never need to use more than 6 columns (in fact, usually you will use less than 6). But if you do, then change the `$grid--max-cols` variable. **Warning:** don't go much higher than 6 columns, because this will massively increase your outputted CSS!
  9. 3. RTL and LTR languages are supported.
  10.  
  11. ## Grid system (at all viewport widths)
  12.  
  13. ### Grid Classes
  14.  
  15. * `.grid`
  16. * `.grid--cols-1` ... `.grid--cols-6` -- choose to have 1,2,3,4,5 or 6 columns.
  17. * `.grid--gap`
  18.  
  19. ### Grid-item Classes
  20.  
  21. * `.col--1` ... `.col--6` -- single-column items in positions 1,2,3,4,5 or 6 (to be paired with your chosen `.grid--cols-1` ... `.grid--cols-6`).
  22. * **Column spanning** -- multiple permutations, e.g.:
  23. * `.col--1-3` -- spans columns 1-3.
  24. * `.col--2-4` -- spans columns 2-4.
  25. * `.row--1` ... `.row--6` -- single-row items in positions 1,2,3,4,5 or 6.
  26. * **Row spanning** -- multiple permutations, e.g.:
  27. * `.row--1-3` -- spans rows 1-3.
  28. * `.row--2-4` -- spans rows 2-4.
  29. * **Justification (horizontal)** -- within grid area:
  30. * `.justify--left`
  31. * `.justify--right`
  32. * `.justify--center`
  33. * `.justify--stretch`
  34. * **Alignment (vertical)** -- within grid area:
  35. * `.align--top`
  36. * `.align--bottom`
  37. * `.align--center`
  38. * `.align--stretch`
  39.  
  40. ## Responsive (viewport width) modifiers
  41.  
  42. ### Grid Classes
  43.  
  44. * `.grid--cols-1` ... `.grid--cols-6` -- all viewport widths
  45. * `.grid-md--cols-1` ... `.grid-md--cols-6` -- 768px width up
  46. * `.grid-lg--cols-1` ... `.grid-lg--cols-6` -- 1024px width up
  47.  
  48. ### Grid-item Classes
  49.  
  50. * All viewport widths:
  51. * `col-`
  52. * `row-`
  53. * `justify-`
  54. * `align-`
  55. * Viewport widths 768px up:
  56. * `col-md-`
  57. * `row-md-`
  58. * `justify-md-`
  59. * `align-md-`
  60. * Viewport widths 1024px up:
  61. * `col-lg-`
  62. * `row-lg-`
  63. * `justify-lg-`
  64. * `align-lg-`
  65.  
  66. ## Examples
  67.  
  68. Simple:
  69.  
  70. ```
  71. <div class="grid grid--cols-3">
  72. <div>First grid item</div>
  73. <div>Second grid item</div>
  74. <div>Third grid item</div>
  75. <div>Fourth grid item</div>
  76. <div>Fifth grid item</div>
  77. <div>sixth grid item</div>
  78. </div>
  79. ```
  80.  
  81. Row spanning:
  82.  
  83. ```
  84. <div class="grid grid--cols-2 grid--gap">
  85. <div class="col--1 row--1-3">First grid item</div>
  86. <div>Second grid item</div>
  87. <div>Third grid item</div>
  88. <div>Fourth grid item</div>
  89. </div>
  90. ```
  91.  
  92. Layout 1 (all viewport widths):
  93.  
  94. ```
  95. <div class="grid grid--cols-4">
  96. <div class="col--1-4">Header</div>
  97. <div class="col--1-4">Menubar</div>
  98. <div class="col--1-3 row--3-5">Main article</div>
  99. <div>Sidebar (right) -- top third</div>
  100. <div>Sidebar (right) -- middle third</div>
  101. <div>Sidebar (right) -- bottom third</div>
  102. <div class="col--1-4">Footer</div>
  103. </div>
  104. ```
  105.  
  106. Layout 2 (viewport widths 768px up) -- exemplifying grid nesting, column re-ordering and center-justifying:
  107.  
  108. ```
  109. <div class="grid grid-md--cols-4">
  110. <div class="col-md--1 col-lg--4">Sidebar</div>
  111. <div class="col-md--2-4 col-lg--1-3 row-md--1">
  112. <div>Article<div>
  113. <div class="grid grid-md--cols-3">
  114. <div>Nested<div>
  115. <div>Nested<div>
  116. <div>Nested<div>
  117. </div>
  118. </div>
  119. <div class="justify-md--center">Centered footer</div>
  120. </div>
  121. ```
Add Comment
Please, Sign In to add comment