krokis/montblanc — pull request #4 by kaime (2014-03-21 21:12:41+00:00)
Title: `reset`

The `reset` mixin should allow to set default values for multiple properties at once. The "default value" depends on the property (or properties) being reset: it can be `auto` for `width` but `1` for `opacity`.

```
reset([property [, property...]])
```

This function should accept a list of zero or more property names, as literals or as strings. Property names can be "real" properties (ie: `height`, `font-size`) or shorthands which may expand to more than one "real" property. In the following example, `size` is a shorthand property, while `font-weight` is an actual CSS property:

```stylus
body
reset: size font-weight
```

```css
body {
width: auto;
height: auto;
font-weight: normal
}
```

We should be able to use `reset` multiple times on the same block and also with no arguments (in this case, nothing should happen).

`reset` should be able to handle `!important` and live together with other mixins:

```stylus
body
reset: box-shadow margin !important
```

```css
body {
-webkit-box-shadow: none !important;
box-shadow: none !important;
margin: 0 !important;
}
```

List of resettable properties and shorthands:

Property | Should expand to
------------------------------|-------------------------------
`width` | `width: auto`
`height` | `height: auto`
`size` | `width: auto`
`height: auto`
`box` | ???
`font` | ???
`font-size` | `font-size: 100%` ???
`font-family` | ???
`font-style` | `font-style: normal`
`font-weight` | `font-weight: normal`
`font-stretch` | `font-stretch: normal`
`text-decoration` | `text-decoration: none`
`text-transform` `case` | `text-transform: none`
`text-stroke` | ??
`line-height` | `line-height: normal`
`color` | ???
`cursor` | `cursor: default`
`margin` | `margin`
`margin-left` | `margin-left: 0`
`margin-right` | `margin-right: 0`
`margin-top` | `margin-top: 0`
`margin-bottom` | `margin-bottom: 0`
`padding` | `padding`
`padding-left` | `padding-left: 0`
`padding-right` | `padding-right: 0`
`padding-top` | `padding-top: 0`
`padding-bottom` | `padding-bottom: 0`
`background` | `background: none` ???
`background-image` | `background-image: none`
`background-color` | `background-color: transparent` ???
`background-repeat` | ???
`background-position` | ???
`background-size` | ???
`background-origin` | ???
`background-attachment` | ???
`background-quantity` | ???
`background-clip` | ???
`background-spacing` | ???
`position` | `position: static` ???
`left` | `left: auto`
`top` | `top: auto`
`right` | `right: auto`
`bottom` | `bottom: auto`
`box-shadow` | `box-shadow: none`
`text-shadow` | ???
`border` | `border: none`
`text-shadow` | ???
`border-width` | ???
`border-color` | ???
`border-style` | `border-style: normal`
`border-radius` | `border-radius: 0`
`border-top-left-radius` | `border-top-left-radius: 0`
`border-top-right-radius` | `border-top-right-radius: 0`
`border-bottom-right-radius` | `border-bottom-right-radius: 0`
`border-bottom-left-radius` | `border-bottom-left-radius: 0`
`opacity` | `opacity: 1`
`list` | ???
`list-item` |
`transition` | ???
`transform` | ???
`zoom` | ???
`visibility` | `visibility: visible`
`box-sizing` | ???
`float` | `float: none`
`flex` | ???
`animation` | ???

More?

Notes:

* Some versions of IE *need* an additional `background-image: none` for the `background: none` reset.
* `reset: list` and `reset: list-item` should reset lists default styles on `

` `

` `
` `

` `
` and `
` elements: `list-style` `margin` `padding`.
* Does it makes sense a: `reset: counter(name)`?

See:
- http://compass-style.org/reference/compass/reset/utilities/