Skip to content

Instantly share code, notes, and snippets.

@founddrama
Created November 21, 2010 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save founddrama/709180 to your computer and use it in GitHub Desktop.
Save founddrama/709180 to your computer and use it in GitHub Desktop.
Sample code for "10 things I love about Sass"
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;
}
}
}
#container .post code,
#container .post tt,
#container .post pre {
font-family: Consolas, Courier, monospace;
}
#container .post {
code, tt, pre {
font-family: Consolas, Courier, monospace;
}
}
.styledText {
font-family: Georgia, Times, serif;
font-style: oblique;
}
.styledText {
font: {
family: Georgia, Times, serif;
style: oblique;
}
}
/* CSS: */
@import url("_reset.css");
/* Sass: */
@import "reset";
$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;
}
}
}
@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; }
$my_color: #77110;
.post-title { color: saturate($my_color, 15%); }
@founddrama
Copy link
Author

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