Created
September 12, 2011 15:56
-
-
Save agmcleod/1211615 to your computer and use it in GitHub Desktop.
SCSS Optimization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin content-middle { | |
width:1100px; | |
margin:0 auto; | |
} | |
.top { | |
height:123px; | |
background-color:#fff; | |
.content { | |
@include content-middle; | |
} | |
} | |
.middle { | |
@include content-middle; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* How it currently renders */ | |
.top .content { | |
width: 1100px; | |
margin: 0 auto; | |
} | |
.middle { | |
width: 1100px; | |
margin: 0 auto; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* What i'd like */ | |
.top .content, .middle { | |
width: 1100px; | |
margin: 0 auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey mate,
You need to try to convert that mixin into class itself or a placeholder and then extend it to use.
You will get that rendered as "what_id_like.css"
Mixins are mainly use to override the properties as and when require.
I mean to say as a functions.
Hope this helps.