Utility classes

In addition to Normalize.css rules, Pure's Base module contains some common styles that are used by most websites.

@import "_variables.scss";

Hiding things

Add the hidden attribute to an HTML element to hide it from the screen via display: none !important;.

Alternatively, for compatibility with old IE, you may use the CSS classname .hidden.

.hidden,
[hidden] {
    display: none !important;
}

Responsive Images

Add the .cw-img class name to an <img> element to make it scale with the viewport. This is handy when building responsive websites.

.cw-img {
    max-width: 100%;
    height: auto;
    display: block;
}

Spacing helpers

Based on helpers from https://github.com/stubbornella/oocss/blob/master/core/spacing/space.css

  • p, m == padding, margin
  • a, t, r, b, l, h, v == all, top, right, bottom, left, horizontal, vertical
  • s, m, l, xl, n == small, medium, large, x-large, none

Here's how you can use them:

.cw-ptn, .cw-pvn, .cw-pan{ padding-top: $space-none !important; }
.cw-pts, .cw-pvs, .cw-pas{ padding-top: $space-small !important; }
.cw-ptm, .cw-pvm, .cw-pam{ padding-top: $space-medium !important; }
.cw-ptl, .cw-pvl, .cw-pal{ padding-top: $space-large !important; }
.cw-ptxl, .cw-pvxl, .cw-paxl{ padding-top: $space-x-large !important; }
.cw-prn, .cw-phn, .cw-pan{ padding-right: $space-none !important; }
.cw-prs, .cw-phs, .cw-pas{ padding-right: $space-small !important; }
.cw-prm, .cw-phm, .cw-pam{ padding-right: $space-medium !important; }
.cw-prl, .cw-phl, .cw-pal{ padding-right: $space-large !important; }
.cw-prxl, .cw-phxl, .cw-paxl{ padding-right: $space-x-large !important; }
.cw-pbn, .cw-pvn, .cw-pan{ padding-bottom: $space-none !important; }
.cw-pbs, .cw-pvs, .cw-pas{ padding-bottom: $space-small !important; }
.cw-pbm, .cw-pvm, .cw-pam{ padding-bottom: $space-medium !important; }
.cw-pbl, .cw-pvl, .cw-pal{ padding-bottom: $space-large !important; }
.cw-pbxl, .cw-pvxl, .cw-paxl{ padding-bottom: $space-x-large !important; }
.cw-pln, .cw-phn, .cw-pan{ padding-left: $space-none !important; }
.cw-pls, .cw-phs, .cw-pas{ padding-left: $space-small !important; }
.cw-plm, .cw-phm, .cw-pam{ padding-left: $space-medium !important; }
.cw-pll, .cw-phl, .cw-pal{ padding-left: $space-large !important; }
.cw-plxl, .cw-phxl, .cw-paxl{ padding-left: $space-x-large !important; }
.cw-mtn, .cw-mvn, .cw-man{ margin-top: $space-none !important; }
.cw-mts, .cw-mvs, .cw-mas{ margin-top: $space-small !important; }
.cw-mtm, .cw-mvm, .cw-mam{ margin-top: $space-medium !important; }
.cw-mtl, .cw-mvl, .cw-mal{ margin-top: $space-large !important; }
.cw-mtxl, .cw-mvxl, .cw-maxl{ margin-top: $space-x-large !important; }
.cw-mrn, .cw-mhn, .cw-man{ margin-right: $space-none !important; }
.cw-mrs, .cw-mhs, .cw-mas{ margin-right: $space-small !important; }
.cw-mrm, .cw-mhm, .cw-mam{ margin-right: $space-medium !important; }
.cw-mrl, .cw-mhl, .cw-mal{ margin-right: $space-large !important; }
.cw-mrxl, .cw-mhxl, .cw-maxl{ margin-right: $space-x-large !important; }
.cw-mbn, .cw-mvn, .cw-man{ margin-bottom: $space-none !important; }
.cw-mbs, .cw-mvs, .cw-mas{ margin-bottom: $space-small !important; }
.cw-mbm, .cw-mvm, .cw-mam{ margin-bottom: $space-medium !important; }
.cw-mbl, .cw-mvl, .cw-mal{ margin-bottom: $space-large !important; }
.cw-mbxl, .cw-mvxl, .cw-maxl{ margin-bottom: $space-x-large !important; }
.cw-mln, .cw-mhn, .cw-man{ margin-left: $space-none !important; }
.cw-mls, .cw-mhs, .cw-mas{ margin-left: $space-small !important; }
.cw-mlm, .cw-mhm, .cw-mam{ margin-left: $space-medium !important; }
.cw-mll, .cw-mhl, .cw-mal{ margin-left: $space-large !important; }
.cw-mlxl, .cw-mhxl, .cw-maxl{ margin-left: $space-x-large !important; }
.cw-mra, .cw-mha{ margin-right: auto !important; }
.cw-mla, .cw-mha{ margin-left: auto !important; }