Base

Leveraging Normalize.css, an HTML5-ready alternative to CSS resets.

The Foundation

All modules in Pure build on top of Normalize.css. It's our foundational layer to maintain some degree of cross-browser consistency. We use Normalize v1.x because it supports older versions of Internet Explorer. We like Normalize so much that we put it on our CDN. You can pull in Normalize.css by adding this <link> element on your page:

<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/base-min.css">

A bit about Normalize.css

Normalize.css is an open-source project by Nicolas Gallagher and Jonathan Neal. In their own words:

Normalize.css is a small CSS file that provides better cross-browser consistency in the default styling of HTML elements. It’s a modern, HTML5-ready, alternative to the traditional CSS reset."

Normalize.css comes with great documentation and a thorough guide explaining how it differs from a traditional reset. You can also check out YUI's CSSNormalize module, which includes the generic Normalize along with a contextual version. The contextual version of Normalize only applies normalized styles to elements that are children of an element with the class name yui3-normalized.

Extras

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

Hiding Elements

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

<input type="text" name="_csrf" hidden>

Responsive Images

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

<img class="pure-img" src="...">

Moving beyond Normalize

Normalize.css is a great starting place for your project, but some HTML elements such as forms, tables, and menus require more styling than what's provided by Normalize.

We made a more opinionated look and feel for these elements, while keeping them minimal enough so that you can customize them for your site or app's needs. Check out our CSS for Forms, Tables, and Menus.