Skip to content

Instantly share code, notes, and snippets.

@mixin agenda($type: "Lesbian") {
@if (rand(100) < 3) {
&:before {
content: "#{$type} Kisses 👄👄";
display: none;
}
}
}
@chriseppstein
chriseppstein / number.cpp
Last active August 29, 2015 14:20
Experimenting with using properties instead of methods.
#include <nan.h>
#include "number.h"
#include "../create_string.h"
using namespace v8;
namespace SassTypes
{
Number::Number(Sass_Value* v) : SassValueWrapper(v) {}
@chriseppstein
chriseppstein / SassMeister-input.scss
Created November 20, 2014 23:22
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
@function extract-keyword-arg($argname, $args...) {
$kwargs: keywords($args);
@return map-get($kwargs, $argname);
}
@chriseppstein
chriseppstein / SassMeister-input.sass
Created October 20, 2014 17:32
Generated by SassMeister.com.
// ----
// Sass (v3.4.6)
// Compass (v1.0.1)
// ----
.button-base
background-color: #f0f0f0
border-radius: 20px
border: 1px solid #ccc
color: #333
@chriseppstein
chriseppstein / str-replace.scss
Created September 4, 2014 15:35
String Replacement function in pure-sass
@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}'";
}
@chriseppstein
chriseppstein / existence-check-shim.scss
Created September 2, 2014 23:49
How to shim sass 3.3 existence checks in older versions.
@function -my-function-exists($name) {
$name: unquote($name);
$result: function-exists($name);
@if $result == "function-exists(#{$name})" {
@return false;
} @else {
@return $result;
}
}
@chriseppstein
chriseppstein / Interview.md
Created August 28, 2014 18:27
An Interview I did for the Chinese launch of Sass & Compass in Action.

How did you come to be interested in Sass and then creating Compass?

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.

@chriseppstein
chriseppstein / compass_browser_support_thresholds.scss
Created August 7, 2014 20:45
This is how you can ask compass what the usage threshold cutoff for each browser version is.
@each $browser in browsers() {
.#{$browser} {
@each $version in browser-versions($browser) {
threshold: $version omitted-usage($browser, $version);
}
}
}