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. You can pull in Normalize.css by adding this <link>
element on your page:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/purecss@3.0.0/build/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.
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.