Skip to content

Commit

Permalink
Fix @extends rule
Browse files Browse the repository at this point in the history
  • Loading branch information
felipefialho committed May 6, 2016
1 parent 1f745b4 commit 895402e
Showing 1 changed file with 17 additions and 27 deletions.
44 changes: 17 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ Separate nested ruleset by a blank line and blocks ruleset by a double blank lin
float left
```

Use **$** for the variables and mixins.
Use **$** for the variables.

```css
// Good
Expand All @@ -833,19 +833,6 @@ $gray = #555
$gray-light = #aaa
$gray-lighter = #ECF1F5
$gray-white = #fbfbfb


$reset(arg = '')

if (arg == list)
margin 0
padding-left 0
list-style none

if (arg == form)
background 0
border 0
padding 0
```

<a name="preprocessors-performance"></a>
Expand All @@ -865,23 +852,26 @@ Warning with nesting rules of preprocessors. Continue keep without nesting.
...
```

Create mixins and use [@extends](https://learnboost.github.io/stylus/docs/extend.html) to add in various elements.
**Do not use @extends**, [always use mixins](http://csswizardry.com/2016/02/mixins-better-for-performance/).

```css
$clearfix
&:before,
&:after
content " "
display table

&:after
clear both
reset(arg = '')

if (arg == list)
margin 0
padding-left 0
list-style none

if (arg == form)
background 0
border 0
padding 0

.header
@extends $clearfix
.nav
reset(list)

.footer
@extends $clearfix
.btn
reset(form)
```

<a name="preprocessors-media-queries"></a>
Expand Down

0 comments on commit 895402e

Please sign in to comment.