Skip to content

Instantly share code, notes, and snippets.

@cscottmills
cscottmills / full-bleed.scss
Last active August 10, 2018 14:47
This is the SCSS mixin I've been using to style elements whose background color extends to the edges of the viewport.
// Full bleed
// $direction accepts 'up', 'down' or 'none';
// NB using 'up' or 'down' causes the shadow to extend
// to (and beyond) the top or bottom of the viewport
// Only use 'none' on relatively wide elements,
// and set $width to the width of the element
// --------------------------
@mixin full-bleed($color, $direction: none, $width: 400em) {
@if $color == 'none' {
box-shadow: none;
@cscottmills
cscottmills / cascade.scss
Created February 28, 2014 04:38
An SCSS mixin to sequence the transitions of a known number of elements
// Cascade
// $count accepts any whole number > 1
// $delay & $duration accept values in seconds
// NB you'll need to handle vendor prefixes yourself
// --------------------------
@mixin cascade($count, $property, $delay: 0s, $duration: 0.2s, $timing: ease) {
transition-property: $property;
transition-timing-function: $timing;
@for $i from 1 through $count {
&:nth-child(#{$i}) {