Created
August 6, 2014 21:54
-
-
Save Guilh/d189a6c0548e35fb0715 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<h3>Mixin example for <a href="http://blog.teamtreehouse.com/sass-tip-double-ampersand-selector">this blog post</a>.</h3> | |
<div class="btn-group"> | |
<a class="btn" href="#">Primary Action</a> | |
<a class="btn" href="#">Secondary Action</a> | |
</div> | |
<div class="row"> | |
<div class="col"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam suscipit in tortor non laoreet. In porttitor elit non tellus ultrices, eget mattis risus ornare. Nunc commodo consectetur fermentum. | |
</div> | |
<div class="col"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam suscipit in tortor non laoreet. In porttitor elit non tellus ultrices, eget mattis risus ornare. Nunc commodo consectetur fermentum. | |
</div> | |
<div class="col"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam suscipit in tortor non laoreet. In porttitor elit non tellus ultrices, eget mattis risus ornare. Nunc commodo consectetur fermentum. | |
</div> | |
</div> |
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
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.0.rc.1) | |
// ---- | |
// Boring stuff | |
body {font-family: sans-serif; line-height: 1.5;} | |
.btn-group {margin: 30px 0;} | |
// Double ampersand selector mixin | |
@mixin doubly($margin: 1.1em) { | |
& + & { | |
margin-left: $margin; | |
@content; | |
} | |
} | |
// Using them | |
.btn { | |
display: inline-block; | |
text-decoration: none; | |
background: dodgerblue; | |
color: white; | |
padding: 10px 20px; | |
border-radius: .5em; | |
@include doubly { | |
background: tomato; | |
} | |
} | |
.col { | |
width: 30%; | |
float: left; | |
@include doubly(5%); | |
} | |
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
body { | |
font-family: sans-serif; | |
line-height: 1.5; | |
} | |
.btn-group { | |
margin: 30px 0; | |
} | |
.btn { | |
display: inline-block; | |
text-decoration: none; | |
background: dodgerblue; | |
color: white; | |
padding: 10px 20px; | |
border-radius: .5em; | |
} | |
.btn + .btn { | |
margin-left: 1.1em; | |
background: tomato; | |
} | |
.col { | |
width: 30%; | |
float: left; | |
} | |
.col + .col { | |
margin-left: 5%; | |
} |
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
<h3>Mixin example for <a href="http://blog.teamtreehouse.com/sass-tip-double-ampersand-selector">this blog post</a>.</h3> | |
<div class="btn-group"> | |
<a class="btn" href="#">Primary Action</a> | |
<a class="btn" href="#">Secondary Action</a> | |
</div> | |
<div class="row"> | |
<div class="col"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam suscipit in tortor non laoreet. In porttitor elit non tellus ultrices, eget mattis risus ornare. Nunc commodo consectetur fermentum. | |
</div> | |
<div class="col"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam suscipit in tortor non laoreet. In porttitor elit non tellus ultrices, eget mattis risus ornare. Nunc commodo consectetur fermentum. | |
</div> | |
<div class="col"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam suscipit in tortor non laoreet. In porttitor elit non tellus ultrices, eget mattis risus ornare. Nunc commodo consectetur fermentum. | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment