_grids.scss 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // a very basic grid system
  2. // ======================================================================
  3. // use like this:
  4. // <div class="grid">
  5. // <div class="grid__column"> Your content </div>
  6. // <div class="grid__column"> Your content </div>
  7. // </div>
  8. // The grids by default try to put everything stacked on each other
  9. // on sizes below the l-breakpoint, and columns after that
  10. // you can throw grids into each other to create custom layouts
  11. .grid {
  12. @include spacing(l -1);
  13. @include spacing-inner(a 0);
  14. display: flex;
  15. flex-direction: column;
  16. flex-wrap: wrap;
  17. justify-content: space-between;
  18. list-style: none; // if applied on a list, remove list-styles
  19. // try to fit everything into a row on larger displays, in
  20. // effect making columns out of every grid__column
  21. @include mediaquery(l) {
  22. flex-direction: row;
  23. }
  24. }
  25. .grid__column {
  26. @include spacing-inner(l 1);
  27. flex: 1;
  28. }
  29. // custom grid, this one starts 'columnizing' at ~600px width
  30. // for 2 elements, at around 900px for 3 elements etc. pp.
  31. // ======================================================================
  32. .grid--custom {
  33. flex-direction: row;
  34. > .grid__column {
  35. flex: 1 0 300px;
  36. }
  37. }