Created
November 10, 2013 22:43
-
-
Save seanirby/7404927 to your computer and use it in GitHub Desktop.
Mixins
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
<h1>Write Less With 'mixins'</h1> | |
<div id="container"> | |
<div></div> | |
<div></div> | |
<div></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.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
body{ | |
background-color: #505050; | |
} | |
h1,h2,h3{ | |
text-align: center; | |
color: white; | |
font-family: Helvetica; | |
} | |
#container { | |
margin-left: 33%; | |
> div{ | |
margin: 10px; | |
width: 100px; | |
height: 100px; | |
background-color: orange; | |
display: inline-block; | |
vertical-align: top; | |
} | |
> :nth-child(1) { | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
-ms-border-radius: 20px; | |
-o-border-radius: 20px; | |
border-radius: 20px; | |
} | |
> :nth-child(2) { | |
-webkit-border-radius: 40px; | |
-moz-border-radius: 40px; | |
-ms-border-radius: 40px; | |
-o-border-radius: 40px; | |
border-radius: 40px; | |
} | |
> :nth-child(3) { | |
-webkit-border-radius: 50%; | |
-moz-border-radius: 50%; | |
-ms-border-radius: 50%; | |
-o-border-radius: 50%; | |
border-radius: 50%; | |
} | |
} | |
// @mixin border-radius($radius){ | |
// -webkit-border-radius: $radius; | |
// -moz-border-radius: $radius; | |
// -ms-border-radius: $radius; | |
// -o-border-radius: $radius; | |
// border-radius: $radius; | |
// } | |
// @mixin rel-position($top, $left){ | |
// position: relative; | |
// top: $top; | |
// left: $left; | |
// } |
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 { | |
background-color: #505050; | |
} | |
h1, h2, h3 { | |
text-align: center; | |
color: white; | |
font-family: Helvetica; | |
} | |
#container { | |
margin-left: 33%; | |
} | |
#container > div { | |
margin: 10px; | |
width: 100px; | |
height: 100px; | |
background-color: orange; | |
display: inline-block; | |
vertical-align: top; | |
} | |
#container > :nth-child(1) { | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
-ms-border-radius: 20px; | |
-o-border-radius: 20px; | |
border-radius: 20px; | |
} | |
#container > :nth-child(2) { | |
-webkit-border-radius: 40px; | |
-moz-border-radius: 40px; | |
-ms-border-radius: 40px; | |
-o-border-radius: 40px; | |
border-radius: 40px; | |
} | |
#container > :nth-child(3) { | |
-webkit-border-radius: 50%; | |
-moz-border-radius: 50%; | |
-ms-border-radius: 50%; | |
-o-border-radius: 50%; | |
border-radius: 50%; | |
} |
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
<h1>Write Less With 'mixins'</h1> | |
<div id="container"> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment