$foo
@mixin
@extend, &
@if, @for, @each, @while
$foo : #fffff;
$bar : (1px * 2em) / 4px;
border : 1px solid black;
$my-list : 1px solid black;
$my-list2 : 1px, solid, black;
$my-list3 : (1px solid black);
border : $my-list;
Sass::Script::List.new(['1px', 'solid', 'black'], ',')
length($list)
nth($list, $n)
join($list1, $list2, [$separator])
@function get-stops($colors, $stops) {
$out:();
@each $color in $colors {
$i: index($colors, $color);
$stop: 0% + nth($stops, $i);
$out: append($out, $color $stop, 'comma');
}
@return $out;
}
@mixin menu-level2-active {
$args: get-stops($menu-active-colors, $menu-active-stops);
@include background(linear-gradient($menu-active-direction, $args));
}
a {
color : $link-color;
&:hover {
color : $link-hover-color;
}
}
a { color : blue; }
a:hover { color : red; }
.foo {
font-size : 10px;
}
.bar {
@extend .foo;
}
.foo, .bar {
font-size : 10px;
}
def sprite(map, sprite, offset_x = ZERO, offset_y = ZERO)
sprite = convert_sprite_name(sprite)
verify_map(map)
unless sprite.is_a?(Sass::Script::String)
raise Sass::SyntaxError
end
url = sprite_url(map)
position = sprite_position(map, sprite, offset_x, offset_y)
Sass::Script::List.new([url] + position.value, :space)
end
Sass::Script::Functions.declare :sprite, [:map, :sprite]
Sass::Script::Functions.declare :sprite, [:map, :sprite, :offset_x]
Sass::Script::Functions.declare :sprite, [:map, :sprite, :offset_x, :offset_y]
$orange : rgb(138, 182, 225) !default;
$blue : rgb(33,89,167) !default;
$lighter-blue : rgb(138, 182, 225) !default;
$gray : rgb(63,63,63) !default;
$dark-gray : rgb(33,33,33) !default;
$light-gray : rgb(109,109,109) !default;
$lighter-gray : rgb(150,150,150) !default;
$lightest-gray : rgb(188,188,188) !default;
.foo {
color : $blue;
}
// dark gray
$text-color : rgb(33,33,33) !default;
// lightest gray
$text-compliment-color : rgb(188,188,188) !default;
//h1, h2
$title-color : rgb(63,63,63) !default;
// blue
$primary-accent-color : rgb(33,89,167) !default;
// blue on dark
$primary-accent-compliment-color : rgb(138, 182, 225) !default;
//orange - link color
$secondary-accent-color : rgb(199, 105, 0) !default;
// light gray
$ancillary-color : rgb(109,109,109) !default;
// lighter gray
$ancillary-compliment-color : rgb(150,150,150) !default;
// _pallet.scss
$orange : rgb(138, 182, 225) !default;
$blue : rgb(33,89,167) !default;
$lighter-blue : rgb(138, 182, 225) !default;
$gray : rgb(63,63,63) !default;
$light-gray : rgb(109,109,109) !default;
$lighter-gray : rgb(150,150,150) !default;
$lightest-gray : rgb(188,188,188) !default;
// _colors.scss
//text
$text-color : $dark-gray;
$text-compliment-color : $lightest-gray;
$title-color : $gray;
$primary-accent-color : $blue;
$primary-accent-compliment-color : $lighter-blue;
$secondary-accent-color : $orange;
$ancillary-color : $light-gray;
$ancillary-compliment-color : $lighter-gray;
$height : 2px;
// There are 100 lines before this
.content_head {
@include clearfix;
.hr {
padding-top : (rhythm(1) / 2) - $height;
width : 100%;
border-bottom : $height solid $secondary-accent-color;
margin-bottom : 10px;
display : block;
@extend .float-right;
}
.release_identifiers {
@extend .float-right;
text-align : right;
font-family : $ancillary-font;
}
}
/* Local Variables */
$release-content-height : rhythm(2);
$section-side-width : column-width(4) + $sidebar-width;
$group-image-height : rhythm(6);
.show {
h1 {
@include header(3);
@include trailer;
color : $primary-accent-color;
}
// ... goes on for 100+ lines
$wrapper-width : 960px;
$sidebar-width : 50px;
$main-content-width : $wrapper - $sidebar;
.wrapper {
width : $wrapper-width;
}
.sidebar {
width : $sidebar-width;
}
.content {
width : $main-content-width;
}
@for $i from 1 through 4 {
h#{$i} {
@include header($i);
}
}
.play {
left: ($width / 2) - (global-sprite-width(play_movie) / 2);
top: ($height / 2) - (global-sprite-height(play_movie) / 2);
}
.foo {
width: 5px;
.bar {
height: 20px;
.baz {
color : red;
.what-comes-after-baz {
border : green solid 1px;
&.something {
@extend .float-left;
}
}
}
}
}
.release_title a{
@extend h3;
@include adjust-font-size-to(20px, 1);
@include trailer;
text-decoration : none;
display : block;
&:hover {
color:$hover-color;
}
}
@import "my-icons/*.png";
@include all-my-icons-sprites;
.my-icons-sprite,
.my-icons-delete,
.my-icons-edit,
.my-icons-new,
.my-icons-save {
background: url('/images/my-icons-s34fe0604ab.png') no-repeat;
}
.my-icons-delete { background-position: 0 0; }
.my-icons-edit { background-position: 0 -32px; }
.my-icons-new { background-position: 0 -64px; }
.my-icons-save { background-position: 0 -96px; }
@import "my-buttons/*.png";
a {
@include my-buttons-sprite(glossy)
}
.my-buttons-sprite, a {
background: url('/my-buttons-sedfef809e2.png') no-repeat;
}
a {
background-position: 0 0;
}
a:hover, a.glossy-hover {
background-position: 0 -40px;
}
a:target, a.glossy-target {
background-position: 0 -60px;
}
a:active, a.glossy-active {
background-position: 0 -20;
}
.grid {
@include grid-background($total, $column, $gutter, $baseline,
$offset, $column-color, $gutter-color,
$baseline-color, $force-fluid)
}
$release-content-height : rhythm(2);
$section-side-width : column-width(4);
$primary-image-caption-line-height : floor($base-line-height / 2);
$group-image-height : rhythm(6);
.contents .show {
h1 {
@include header(3);
@include padding-leader;
@include trailer;
color : $primary-accent-color;
}
// etc ...
http://coding.smashingmagazine.com/2009/04/03/8-simple-ways-to-improve-typography-in-your-designs/
@content
@mixin do-something {
font-size : 12px;
color : red;
@content;
}
p {
@include do-something {
color : blue;
}
}
p {
font-size : 12px;
color : red;
color : blue;
}
https://github.com/chriseppstein/compass