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
@mixin default-arg($s: &) { | |
default-arg: inspect($s); | |
} | |
@mixin defaulted-in-body($s: null) { | |
$s: & !default; | |
defaulted-in-body: inspect($s); | |
} | |
output { |
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
@function index-of-last-class($selector) { | |
$index: null; | |
$counter: 1; | |
@each $component in $selector { | |
@if str-index($component, ".") == 1 { | |
$index: $counter; | |
} | |
$counter: $counter + 1; | |
} | |
@return $index; |
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.4.0.rc.1) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
nav{ | |
ul { | |
li { | |
$new-selector: append(nth(&, 1), unquote(".abc")); | |
@at-root #{$new-selector} { |
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.4.0.rc.1) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
#orchard .apple, .pear { | |
@at-root #{selector-append(".tree", &)} {example: selector-append;} | |
// Space after .tree doesn't do anything | |
@at-root #{selector-append(".tree ", &)} {example: selector-append;} | |
// Space before .tree throws an error |
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
➜ Projects ruby -rubygems test_race_condition.rb | |
FUCK | |
➜ Projects ruby -rubygems test_race_condition.rb | |
➜ Projects ruby -rubygems test_race_condition.rb | |
➜ Projects ruby -rubygems test_race_condition.rb | |
➜ Projects ruby -rubygems test_race_condition.rb | |
➜ Projects ruby -rubygems test_race_condition.rb | |
➜ Projects ruby -rubygems test_race_condition.rb | |
➜ Projects ruby -rubygems test_race_condition.rb | |
➜ Projects ruby -rubygems test_race_condition.rb |
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
= spans(!columns) | |
- for !column from 1 through !columns by 2 // though = .., to = ..., by = incrementor | |
+span(!column,!columns) | |
= span(!column, !columns) | |
.span-#{!column} | |
:width= 45px * !column + 15px | |
- if !column != !columns | |
:margin-right 15px | |
When I found Sass in 2007 it was version 1.8 and part of another open source project called Haml which is an HTML templating language for ruby. While Haml was good, I found Sass to be revolutionary. It didn't have most of the features it has today, but it had enough for me to see the promise of a system where stylesheet libraries (often called CSS frameworks) could be distributed like software libraries with proper APIs and none of the downsides that traditional CSS Frameworks had.
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
@function -my-function-exists($name) { | |
$name: unquote($name); | |
$result: function-exists($name); | |
@if $result == "function-exists(#{$name})" { | |
@return false; | |
} @else { | |
@return $result; | |
} | |
} |
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
@function str-replace($source, $substring, $replacement, $fail-silently: false) { | |
$start: str-index($source, $substring); | |
@if $start { | |
@return str-slice($source, 1, $start - 1) + $replacement + str-slice($source, $start + str-length($substring)) | |
} | |
@if $fail-silently { | |
@return $source; | |
} @else { | |
@error "'#{$substring}' was not found in '#{$source}'"; | |
} |