maxmx / bootstrap-stylus

Port of Bootstrap to Stylus
MIT License
585 stars 113 forks source link

How would i go about adding a XL grid breakpoint with this? #123

Closed peteringram0 closed 8 years ago

kane-c commented 8 years ago

Adding your own grid size is the same as regular Bootstrap.

Add some extra vars (as per variables.styl) - I just made up these sizes; adjust for your requirements

$container-xl = (1540 + $grid-gutter-width)
$screen-xl-min = 1600px
$screen-lg-max = ($screen-xl-min - 1)

Make the container and grid classes, as per grid.styl

.container
  @media (min-width $screen-xl-min)
    width $container-xl

@media (min-width $screen-xl-min)
  make-grid(xl)

You might also need this (based on mixins/grid-framework.styl)

for $index in 1..$grid-columns
  .col-xl-{$index}
    @extend $col

Optional, if you make custom grids (as per mixins/grid.styl)

// Generate the extra large columns
make-xl-column($columns, $gutter = $grid-gutter-width)
  position relative
  min-height 1px
  padding-left ($gutter / 2)
  padding-right ($gutter / 2)

  @media (min-width $screen-xl-min)
    float left
    width percentage(($columns / $grid-columns))

make-xl-column-offset($columns)
  @media (min-width $screen-xl-min)
    margin-left percentage(($columns / $grid-columns))

make-xl-column-push($columns)
  @media (min-width $screen-xl-min)
    left percentage(($columns / $grid-columns))

make-xl-column-pull($columns)
  @media (min-width $screen-xl-min)
    right percentage(($columns / $grid-columns))
peteringram0 commented 8 years ago

Really useful thanks for this.