Skip to content

Compass Core: Reset Module

mrajcok edited this page Sep 13, 2010 · 16 revisions

The Reset Module provides mixins that allow you to reset your html so that every element has browser-supplied no styling. The source of the reset module can be found here (and ultimately here).

Importing

To import the Compass Reset Module to any Sass File:

@import compass/reset

This will automatically add reset styles to the generated css.

Class and Element Mixins

+global-reset Resets everything just like Eric Meyer’s Reset. Note, using the above @import directive will automatically invoke this mixin.
+nested-reset Invokes the box-model and font reset mixins on many HTML tags. Use this to reset elements within a nested context (i.e., beneath a selector). To reset the selector itself, mixin the appropriate reset mixin for that element type as well. This could be useful if you want to style a part of your page in a dramatically different way. But if you find yourself using selective resets frequently, you’re probably not scoping your selectors well enough.
+reset-html5 Resets HTML5 tags, e.g., section, article, header, etc.

Style Mixins

Style mixins provide styles that can be mixed into any selector.

+reset-box-model Resets the box model: margin, padding, border, outline
+reset-font Resets the typography
+reset-focus Resets the focus state (outline: 0)
+reset-list-style Resets list-style to none
+reset-quotation Use with the blockquote and q tags
+reset-table-cell Resets table cell properties; use with th, td and caption tags
+reset-table Resets table properties
+reset-image-anchor-border Resets border to none
+reset-body Resets line-height, color, and background. Normally used with the body tag
+reset-display Reset the display property to the default state. This one is a little strange, read the docs.
Clone this wiki locally