Skip to content

Instantly share code, notes, and snippets.

@agmcleod
Created September 12, 2011 15:56
Show Gist options
  • Save agmcleod/1211615 to your computer and use it in GitHub Desktop.
Save agmcleod/1211615 to your computer and use it in GitHub Desktop.
SCSS Optimization
@mixin content-middle {
width:1100px;
margin:0 auto;
}
.top {
height:123px;
background-color:#fff;
.content {
@include content-middle;
}
}
.middle {
@include content-middle;
}
/* How it currently renders */
.top .content {
width: 1100px;
margin: 0 auto;
}
.middle {
width: 1100px;
margin: 0 auto;
}
/* What i'd like */
.top .content, .middle {
width: 1100px;
margin: 0 auto;
}
@patelprashant
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment