JasperM

SASS & Flexbox ftw

Sep 13th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.67 KB | None | 0 0
  1. .grid {
  2.     display: flex;
  3.     flex-direction: row;
  4.     flex-wrap: wrap;
  5.  
  6.     .row {
  7.         display: flex;
  8.         flex-wrap: wrap;
  9.  
  10.         @for $i from 1 to $grid-columns + 1 {
  11.             .col-#{$i} {
  12.                 @if $grid-gutter > 0 {
  13.                     width: calc(#{percentage(1 / $grid-columns * $i)} - #{$grid-gutter});
  14.                     padding-right: $grid-gutter;
  15.                 } @else {
  16.                     width: percentage(1 / $grid-columns * $i);
  17.                 }
  18.  
  19.                 &:last-of-type {
  20.                     width: percentage(1 / $grid-columns * $i);
  21.                     padding-right: 0;
  22.                 }
  23.  
  24.                 @include breakpoint(small) {
  25.                     width: 100%;
  26.                 }
  27.             }
  28.         }
  29.  
  30.         @include breakpoint(small) {
  31.             display: block;
  32.         }
  33.     }
  34.  
  35.     @include breakpoint(small) {
  36.         display: block;
  37.     }
  38. }
Add Comment
Please, Sign In to add comment