Created
November 21, 2010 21:45
-
-
Save founddrama/709180 to your computer and use it in GitHub Desktop.
Sample code for "10 things I love about Sass"
This file contains hidden or 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
article { | |
$base_font_size: 12px; | |
$base_line_height: $base_font_size * 1.5; | |
font-size: $base_font_size; | |
line-height: $base_line_height; | |
/* simple math */ | |
h1 { font-size: $base_font_size * ($base_line_height + 1); } | |
h2 { font-size: $base_font_size + 4px; } | |
} | |
/* some looping with conditional logic */ | |
@for $i from 1 through 10 { | |
#flickr_badge_image#{$i} { | |
@if $i % 2 == 0 { | |
color: #3993FF; | |
} @else { | |
color: #ff1c92; | |
} | |
} | |
} |
This file contains hidden or 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
#container .post code, | |
#container .post tt, | |
#container .post pre { | |
font-family: Consolas, Courier, monospace; | |
} |
This file contains hidden or 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
#container .post { | |
code, tt, pre { | |
font-family: Consolas, Courier, monospace; | |
} | |
} |
This file contains hidden or 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
.styledText { | |
font-family: Georgia, Times, serif; | |
font-style: oblique; | |
} |
This file contains hidden or 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
.styledText { | |
font: { | |
family: Georgia, Times, serif; | |
style: oblique; | |
} | |
} |
This file contains hidden or 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
/* CSS: */ | |
@import url("_reset.css"); | |
/* Sass: */ | |
@import "reset"; |
This file contains hidden or 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
$theme_accent: #771100; | |
$theme_bg: #222222; | |
#container { | |
h1, h2, h3 { color: $theme_accent; } | |
.post { | |
border: { | |
$accent_border: 1px $theme_accent; | |
$dark_border: 1px $theme_bg; | |
top: $accent_border; | |
left: $accent_border; | |
bottom: $dark_border; | |
right: $dark_border; | |
} | |
} | |
} |
This file contains hidden or 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 rounded-top { | |
$side: top; | |
$radius: 10px; | |
border-#{$side}-radius: $radius; | |
-moz-border-radius-#{$side}: $radius; | |
-webkit-border-#{$side}-radius: $radius; | |
} | |
#navbar li { @include rounded-top; } | |
#footer { @include rounded-top; } |
This file contains hidden or 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
$my_color: #77110; | |
.post-title { color: saturate($my_color, 15%); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@see
http://blog.founddrama.net/2010/08/10-things-i-love-about-sass/