frontline-css-reset

7.0.0 • Public • Published

Frontline CSS Reset

npm version gzip file size

Background

All browsers include some basic default styles, like heading sizes, list item bullets, table borders, form field styles, etc. These are known as the user agent styles. If you’d like to see what they look like here’s a collection from the past and present.

When developers began using CSS in the late 1990s and early 2000s they found themselves having to cancel out the user agent styles more often than not, particularly default margins. In an effort to reduce the amount of CSS they had to write on every project, some developers created their own reusable global styles they would include on every project, before their own custom styles. These became known as CSS resets. If you’re interested in the history of CSS reset, check out these resources:

CSS resets typically do a combination of the following:

  • Remove unwanted default browser styles
    • e.g. remove default margins
  • Fix browser bugs and inconsistencies
    • e.g. remove rounded corners on buttons in iOS
  • Apply custom global styles
    • e.g. set box-sizing: border-box; on all elements

Our CSS reset focuses on removing unwanted default styles. There aren’t many browser inconsistencies to worry about these days, and we prefer to let developers add their own global styles rather than include any opinionated styles in the reset (i.e. unlike normalize.css which aims to improve upon the user agent styles rather than reset them).

Usage

Download frontline-css-reset.min.css and include it in your project before any other custom styles.

It can also be downloaded via npm: $ npm install frontline-css-reset

Browser Support

This reset uses :where() as much as possible to reduce specificity to zero, making it easier for devs to override any of the styles later. It’s fully supported in all browser that support :where() (see https://caniuse.com/mdn-css_selectors_where).

If your project requires deeper browser support try using version 6.0.1, which doesn’t use :where().

License

Frontline CSS Reset is free software and may be redistributed under the terms of the MIT license.

Thanks

We’re very thankful to the many developers and open-source projects that informed our work. Special thanks to Eric Meyer, Paul Irish, Nicolas Gallagher, Jonathan Neal, Andy Bell, Chris Coyier, and Josh Comeau.

Our reset was heavily influenced by these other resets:

About Threespot

Threespot is a design and development agency from Washington, DC. We work for organizations that we believe are making a positive change in the world. Find out more about us, our projects or hire us!

Threespot

Package Sidebar

Install

npm i frontline-css-reset

Weekly Downloads

163

Version

7.0.0

License

MIT

Unpacked Size

17.5 kB

Total Files

7

Last publish

Collaborators

  • mbrady
  • tedw