Documentation of media queries, grids, wrappers and layout utility classes.

Files

app/styles/utils/_media.scss
app/styles/layout/_grid.scss

Media queries

There are three main media queries for screen layouts: S, M, L; and two supplementary media queries XS and XL. Breakpoints for these layouts are described bellow.

Breakpoints

XL
width > 1240px
L
width < 1239px
M
width < 959px
S
width < 639px
XS
width < 479px

Mixins

Code:
@include media-w-xl {
  ... styles XL ...
}
@include media-w-l {
  ... styles L ...
}
@include media-w-m {
  ... styles M ...
}
@include media-w-s {
  ... styles S ...
}
@include media-w-xs {
  ... styles XS ...
}

Wrappers

By default there is one main wrapper class .wrapper-main.

wrapper-main
width: 960px
Code:
<div class='wrapper-main'>
  ...
</div>

Grid 12

Grid 12 consists of 12 columns and 5 different media layouts XL / L / M / S / XS.

Note

Start by creating horizontal container with a class of .row. Now you can add elements with a class of .col and specify width of each with .col-[xs/s/m/l/xl]-[1-12], where layout is one of xl/l/m/s/xs and width is number 1-12.

Warning

Media queries for layouts are set by max width, so for example stuff for layout M inherit also in S and XS.

Basic

Example:code
XL4L3M5S12
XL4L6M7S12
XL4L3M12S12
XL4L3M5S12
XL4L6M7S12
XL4L6S6XS12
XL4L6S6XS12
Code:
<div class="row">
  <div class="col col-l-3 col-xl-4 col-m-5 col-s-12"> ... </div>
  <div class="col col-l-6 col-xl-4 col-m-7 col-s-12"> ... </div>
  <div class="col col-l-3 col-xl-4 col-m-12 col-s-12"> ... </div>
</div>

<div class="row">
  <div class="col col-l-4 col-xl-4 col-m-5 col-s-12"> ... </div>
  <div class="col col-l-8 col-xl-8 col-m-7 col-s-12"> ... </div>
</div>

<div class="row">
  <div class="col col-l-6 col-xl-7 col-xs-12"> ... </div>
  <div class="col col-l-6 col-xl-5 col-xs-12"> ... </div>
</div>

Nesting

Rows and columns can be also nested.

Example:code
L3M12
Nested L6Nested XS12
Nested L6Nested XS12
Code:
<div class="row">
  <div class="col col-l-3 col-m-12"> ... </div>
  <div class="col col-l-9 col-m-12">
    <div class="row">
      <div class="col col-l-6 col-xs-12"> ... </div>
      <div class="col col-l-6 col-xs-12"> ... </div>
    </div>
  </div>
</div>

Offsets

Colums can be moved to the right by using classes like .ofst-[xs/s/m/l/xl]-[0-11]. You can also center column with class .ofst-[xs/s/m/l/xl]-center.

Example:code
L3M4S5, ofst S1XS6, ofst XS0
L8, ofst L1L8, ofst M0S10, ofst S1XS12, ofst XS0
L8, center LM10, center LXS 12, center L
Code:
<div class="row">
  <div class="col col-l-3 col-m-4 col-s-5 ofst-s-1 col-xs-6 ofst-xs-0">
    ...
  </div>
  <div class="col col-l-8 ofst-l-1 ofst-m-0 col-s-10 ofst-s-1 col-xs-12 ofst-xs-0">
    ...
  </div>
</div>
<div class="row">
  <div class="col col-l-8 ofst-l-center col-m-10 col-xs-12">
    ...
  </div>
</div>

Vertical space

Vertical space between rows can be created by using class .row-[xs/s/m/l/xl]-space and vertical space between columns can be created by using class .col-[xs/s/m/l/xl]-space.

Note

In case you need to reset space you can use .row-[xs/s/m/l/xl]-nospace and .col-[xs/s/m/l/xl]-nospace

Example:code
L12
L6M12, col space
L6M12, col space
Code:
<div class="row row-l-space row-m-nospace">
  <div class="col col-l-12">
    ...
  </div>
</div>
<div class="row row-l-space row-m-nospace">
  <div class="col col-l-6 col-m-12 col-m-space">
    ...
  </div>
  <div class="col col-l-6 col-m-12 col-m-space">
    ...
  </div>
</div>

Utilities

Grid utilities contains basic classes for utility like pull right/left, clearfix, margin/padding resets, hide classes etc.

Some utilities can be set for specific layout by adding postfix representing layout. These postfixes are not needed in case you don't want target specific layout.

List of utility classes:

  • .pull-[xs/s/m/l/xl]-left
  • .pull-[xs/s/m/l/xl]-right
  • .pull-[xs/s/m/l/xl]-center
  • .inline-block-[xs/s/m/l/xl]

Warning

Layout L (Large), don't need postix.
Use these classes wise and only if needed since they use !important directive !

Example:code
L: Pull leftM: Pull rightS: Inline blockXS: Pull center
Code:
<div class="clearfix">
  <div class="pull-left pull-m-right inline-block-s pull-xs-center">
    ...
  </div>
</div>

Layout hacks

These utilities provides hacks as clearfix or center-unknown.

List of layout hacks classes:

  • .clearfix
  • .center-unknown
  • .clear
Code:
<div class="clearfix">
  ... floating elements ...
</div>

<div class="center-unknown">
  ... unknown element to be centered ...
</div>

<div class="clear"> ... </div>

Space resets

Use classes like .no-pad or .no-mrg to reset margins or paddings. Target specific layout with .no-mrg-[xs/s/m/xl] and .no-pad-[xs/s/m/xl].

Code:
<div class="no-mrg"> reset margins </div>
<div class="no-mrg-top"> reset top margin </div>
<div class="no-mrg-bottom"> reset bottom margin </div>
<div class="no-mrg-left"> reset left margin </div>
<div class="no-mrg-right"> reset right margin </div>
<div class="no-mrg-vertical"> reset top and bottom margin </div>
<div class="no-mrg-horizontal"> reset left and right margin </div>

<div class="mrg-t-10"> set top margin 10px </div>

<div class="no-pad"> reset padding </div>
<div class="no-pad-top"> reset padding-top </div>
<div class="no-pad-bottom"> reset padding-bottom </div>
<div class="no-pad-left"> reset left padding </div>
<div class="no-pad-right"> reset right padding </div>
<div class="no-pad-vertical"> reset top and bottom padding </div>
<div class="no-pad-horizontal"> reset left and right padding </div>

Hide

You can hide elements for specific layout by using classes like .hide-[xs/s/m/l/xl]-only or for all layouts lower including specified by classes like .hide-[xs/s/m/l/xl].

Note

Hide for 'XL and lower' and 'XS and lower' are worthless. In first case you hide for all layouts and in second case there is no lower than XS.

Example:
Active layout: XLLMSXS
XL
 
Hide for XL only
L
Hide for L and lower
Hide for L only
M
Hide for M and lower
Hide for M only
S
Hide for S and lower
Hide for S only
XS
 
Hide for XS only