bem

mixins

element

@mixin element($element) { ... }

Description

Creates an element for a block using human-readable code

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$element

element to create

String or List none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

// SCSS
.menu {
  @include element('item')
}

// CSS
.menu {
}

.menu__item {
}

Links

if-its

@mixin if-its($state) { ... }

Description

Creates an state based class using human-readable code - .is-

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$state

state to use

String or List none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

// SCSS
.menu {
  @include if-its('open')
} 

// CSS
.menu {
}

.menu.is-open {
}

Links

modifier

@mixin modifier($name) { ... }

Description

Creates a modifier syntax for BEM notation

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

Name of modifier

String none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

// Source
.button {
	background: blue;

	@include modifier(save) {
		background: green;
	}
}

// Output
.button {
	background: blue;
}
.button--save {
 	background: green;
}

Links

new

@mixin new($name, $type: null) { ... }

Description

Creates a new block selector using human-readable code

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

block to create

String or List none
$type

adds a dash to the selector

Stringnull

Content

This mixin allows extra content to be passed (through the @content directive).

Example

// SCSS
 @include new('menu');
 @include new('menu', 'component')
 @include new('page', 'object')
 
// CSS
.menu {}
.c-menu {}
.o-page {}

Links

parent-option

@mixin parent-option($name) { ... }

Description

Allows a component to respond to modifiers on its parent.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

Name of parent modifier

String none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

// Source
.button {
background: blue;
	
	@include parent-option(create) {
		background: green;
	}
}

// Output
.button {
	background: blue;
}
.parent--create .button {
 	background: green;
}

Links

when-inside

@mixin when-inside($context) { ... }

Description

Creates a nested selector using human-readable code

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$context

parent element

String or List none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

// SCSS
.el {
  color: $c-blizzardblue;
    
  @include when-inside('.sidebar') {
    color: $c-frostbite;
  }
} 

// CSS
.el {
  color: #ace5ee;
}

.sidebar .el {
  color: #e936a7;
}

Used by

Links

when

@mixin when($modifier) { ... }

Description

Creates a modifier based on a block using human-readable code

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$modifier

modifier to create

String or List none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

// SCSS
.menu {
  @include when('fixed')
} 

// CSS
.menu {
}

.menu--fixed{
}

Links

checks

functions

contains

@function contains($list, $value) { ... }

Description

Checks if a $list contains $value

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$list

List of items

List none
$value

Value to check in for in the list

Any none

Returns

Bool

Used by

Links

is-bool

@function is-bool($var) { ... }

Description

Tests whether a $var is a bool

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for bool type

Literal none

Returns

Bool

Example

is-bool(true)    // returns true
is-bool(false)   // returns true
is-bool(test)    // returns false
is-bool(1)       // returns false
is-bool(null)    // returns false

Links

is-color

@function is-color($var) { ... }

Description

Tests whether $var is color.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for color type

Literal none

Returns

Bool

Example

is-color(#333)   //returns true
is-color(black)  //returns true
is-color(test)   //returns false

Links

is-empty

@function is-empty($var) { ... }

Description

Tests whether $var is empty.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for emptiness

Literal none

Returns

Bool

Example

is-empty('')     //returns true
is-empty(())     //returns true
is-empty('test') //returns false

Links

is-float

@function is-float($var) { ... }

Description

Tests whether $var is float.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for float type

Literal none

Returns

Bool

Example

is-float(-1.5) //returns true
is-float(1.5) //returns true
is-float(1)   //returns false
is-float(1em) //returns false

Requires

Links

is-integer

@function is-integer($var) { ... }

Description

Tests whether $var is integer.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for integer type

Literal none

Returns

Bool

Example

is-integer(1)   //returns true
is-integer(-50) //returns true
is-integer(1.5) //returns false
is-integer(1em) //returns false

Requires

Used by

Links

is-length

@function is-length($value) { ... }

Description

Checks whether the given $value is a valid length.
Can be any valid CSS length

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$value

Value to validate

Any none

Returns

Bool

Requires

Used by

Links

is-list

@function is-list($var) { ... }

Description

Tests whether $var is list.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for list type

Literal none

Returns

Bool

Example

is-list(a b)          //returns true
is-list(1 2 3)        //returns true
is-list((test, test)) //returns true
is-list(test)         //returns false
is-list(1)            //returns false

Links

is-negative

@function is-negative($var) { ... }

Description

Tests whether $var is negative.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check whether $var is negative

Literal none

Returns

Bool

Example

is-negative(-1)   //returns true
is-negative(0)   //returns true
is-negative(1)   //returns false

Requires

Links

is-null

@function is-null($var) { ... }

Description

Tests whether $var is bool.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for bool type

Literal none

Returns

Bool

Example

is-null(null)  //returns true
is-null(false) //returns false
is-null(0) //returns false

Links

is-number

@function is-number($var) { ... }

Description

Tests whether $var is number.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for numeric type

Literal none

Returns

Bool

Example

is-number(1)   //returns true
is-number('1') //returns false
is-number(1em) //returns false

Used by

Links

is-positive

@function is-positive($var) { ... }

Description

Tests whether $var is positive.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check whether $var is positive

Literal none

Returns

Bool

Example

is-positive(1)   //returns true
is-positive(0)   //returns true
is-positive(-1)   //returns false

Requires

Used by

Links

is-size

@function is-size($value) { ... }

Description

Checks if the $value is a valid size.
Includes checks for new CSS intrinsic sizing

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$value

Value to validate

Any none

Returns

Bool

Requires

Links

is-string

@function is-string($var) { ... }

Description

Tests whether $var is string.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

check for string type

Literal none

Returns

Bool

Example

is-string(test) //returns true
is-string(1)    //returns false

Used by

Links

mixins

after-first

@mixin after-first($num) { ... }

Description

Select all children after the first to $num.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of the child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the items after the first 4 items red colored

ul li {
    @include after-first(4) { color: red; }
}

Throws

  • $num is not a valid number for after-first

Links

all-but-first-last

@mixin all-but-first-last($num) { ... }

Description

Select all children between the $num first and the $num last.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make all but the first/last items red colored

ul li {
    @include all-but-first-last(3, 9) { color: red; }
}

Throws

  • $num is not a valid number for all-but-first-last

Links

all-but

@mixin all-but($num) { ... }

Description

Select all children but $num.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make all but the 4th item red colored

ul li {
    @include all-but(3, 9) { color: red; }
}

Throws

  • $num is not a valid number for all-but

Links

at-least

@mixin at-least($count, $selector: null) { ... }

Description

Query when total items is at least $count items

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$count

Quantity to match (equal or more)

Number none
$selector

Selector to filter with

Stringnull

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the items color red when there are 4 items or more

ul li {
    @include at-least(4) { color: red; }
}

Make the items color blue when there are 6 items or more and use * (element agnostic) as the item selector

ul li {
    @include at-least(6, '*') { color: blue; }
}

Throws

  • $count is not a valid number for at-least

  • $selector is not a valid selector for at-least

Links

at-most

@mixin at-most($count, $selector: null) { ... }

Description

Query when the total items is at most $count items

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$count

Quantity to match (equal or less)

Number none
$selector

Selector to filter with

Stringnull

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the items color red when there are 4 items or less

ul li {
    @include at-most(4) { color: red; }
}

Make the items color blue when there are 6 items or less and use '*' (element agnostic) as the item selector

ul li {
    @include at-most(6, '*') { color: blue; }
}

Throws

  • $count is not a valid number for at-most.

  • $selector is not a valid selector for at-most

Links

between

@mixin between($first, $last, $selector: null) { ... }

Description

Query when the total number of items is at least $first and less than $last items

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$first

Lower quantity of items to match

Number none
$last

Higher quantity of items to match

Number none
$selector

Selector to filter with

Stringnull

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the items color red when there are at least 4 and at most 8 items

ul li {
    @include between(4, 8) { color: red; }
}

Make the items color blue when there are at least 6 items and at most 10 items and use '*' (element agnostic) as the item selector

ul li {
     @include between(6, 10, '*') { color: blue; }
}

Throws

  • $first is not a valid number for between

  • $last is not a valid number for between

  • $first cant be larger than $last for between

  • $selector is not a valid selector for between

Links

child-index

@mixin child-index($num, $direction: forward, $index: 0) { ... }

Description

This mixin is used to automatically sort z-index in numerical order. But it can also sort them in anti-numerical order, depending the parameters you use.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

Number of children

Number none
$direction

Direction of the sort

Stringforward
$index

Index of the sorting

Number0

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the non-unique child red colored

ul li {
    @include not-unique() { color: red; }
}

Links

even-between

@mixin even-between($first, $last) { ... }

Description

Select all even children between $first and $last.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$first

starting id

Number none
$last

ending id

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the even items betwen the 4th and 10th red colored

ul li {
    @include even-between(4, 10) { color: red; }
}

Throws

  • $first is not a valid number for even-between

  • $last is not a valid number for even-between

Links

even

@mixin even() { ... }

Description

Select all even children

Parameters

None.

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the even children red colored

ul li {
    @include even() { color: red; }
}

Links

every

@mixin every($num) { ... }

Description

Select children every $num.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make all but the 4th item red colored

ul li {
    @include every(3, 9) { color: red; }
}

Throws

  • $num is not a valid number for every

Links

exactly

@mixin exactly($count) { ... }

Description

Query when total items is exactly N items

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$count

Quantity to match (equal)

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the items color red when there are exactly 4 items

ul li {
    @include exactly(4) { color: red; }
}

Make the items color blue when there are exactly 6 items and use '*' (element agnostic) as the item selector

ul li {
    @include exactly(6, '*') { color: blue; }
}

Throws

  • $count is not a valid number for exactly

  • $selector is not a valid selector for exactly

Links

first-child

@mixin first-child() { ... }

Description

Select the first exact child

Parameters

None.

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the first child red colored

ul li {
    @include first-child() { color: red; }
}

Links

first-last

@mixin first-last() { ... }

Description

Select the first and last children

Parameters

None.

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the first/last children red colored

ul li {
    @include first-last() { color: red; }
}

Links

first-of

@mixin first-of($limit) { ... }

Description

This quantity-query mixin will only select the first of $limit items. It will not work if there is not as much as item as you set in $limit.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$limit

items to select

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the first 3 items red colored

ul li {
    @include first-of(3) { color: red; }
}

Throws

  • $limit is not a valid number for first-of

Links

first

@mixin first($num) { ... }

Description

Select all children from the first to $num.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of the child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the first 4 items red colored

ul li {
    @include first(4) { color: red; }
}

Throws

  • $num is not a valid number for first

Links

from-end

@mixin from-end($num) { ... }

Description

Select all children before $num from the last.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of the child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the items after the first 4 items red colored

ul li {
    @include from-end(4) { color: red; }
}

Throws

  • $num is not a valid number for from-end

Links

from-first-last

@mixin from-first-last($num) { ... }

Description

Select the $num child from the start and the $num child from the last.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make 2nd item from the start and end red colored

ul li {
    @include from-first-last(3, 9) { color: red; }
}

Throws

  • $num is not a valid number for from-first-last

Links

last-child

@mixin last-child() { ... }

Description

Select the last exact child

Parameters

None.

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the last child red colored

ul li {
    @include last-child() { color: red; }
}

Links

last-of

@mixin last-of($limit) { ... }

Description

This quantity-query mixin will only select the last of $limit items. It will not work if there is not as much as item as you set in $limit.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$limit

items to select

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the last 3 items red colored

ul li {
    @include last-of(3) { color: red; }
}

Throws

  • $limit is not a valid number for last-of

Links

last

@mixin last($num) { ... }

Description

Select all children from the last to $num.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of the child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the last 4 items red colored

ul li {
    @include last(4) { color: red; }
}

Throws

  • $num is not a valid number for last

Links

middle

@mixin middle($num) { ... }

Description

Select the item in the middle of $num child. Only works with odd number chain.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

id of child

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the middle item red colored

ul li {
    @include middle(3, 9) { color: red; }
}

Throws

  • $num is not a valid number for middle

  • $num needs to be an odd number for middle

Links

n-between

@mixin n-between($num, $first, $last) { ... }

Description

Select all $num children between $first and $last.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

number of children

Number none
$first

starting id

Number none
$last

ending id

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the nth items betwen the 3rd and 9th red colored

ul li {
    @include n-between(3, 9) { color: red; }
}

Throws

  • $num is not a valid number for n-between

  • $first is not a valid number for n-between

  • $last is not a valid number for n-between

Links

not-unique

@mixin not-unique() { ... }

Description

Will only select children if they are not unique. Meaning if there is at least 2 children, the style is applied.

Parameters

None.

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the non-unique child red colored

ul li {
    @include not-unique() { color: red; }
}

Links

odd-between

@mixin odd-between($first, $last) { ... }

Description

Select all odd children between $first and $last.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$first

starting id

Number none
$last

ending id

Number none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the odd items betwen the 3rd and 9th red colored

ul li {
    @include odd-between(3, 9) { color: red; }
}

Throws

  • $first is not a valid number for odd-between

  • $last is not a valid number for odd-between

Links

odd

@mixin odd() { ... }

Description

Select all odd children

Parameters

None.

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the odd children red colored

ul li {
    @include odd() { color: red; }
}

Links

only

@mixin only() { ... }

Description

Will only select the child if it’s unique.

Parameters

None.

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Make the only child red colored

ul li {
    @include only() { color: red; }
}

Links

color palette

variables

base-palette

$base-palette: (
  "base": #F2614E, 
  "colors": (#D1DFEA, #BFB9C5, #CA8F91, #F2614E, #B7493A, #7A3027, #6E2B22)
) !default;

Description

Initial palette used to define the diff between the base color and each color from the palette.
See color palatte group for helpful mixins

Type

Map

Map structure

Map key NameMap key DescriptionMap key TypeMap key Value
$base-palette.base

Base color for color palette creation

String#F2614E

Links

functions

create-named-palette

@function create-named-palette($base-color) { ... }

Description

Create a list of colors from the base color then turn it into a map with explicit keys.
See Color Palette group, get_ functions

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$base-color

base color for the palette

Color none

Returns

Map

Used by

Links

get_lightest

@function get_lightest($palette) { ... }

Description

Retrieves the lighest color from a map generated with create-named-palette.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$palette

Map of colors with associated names

Map none

Returns

String

single color matching the given keyword

Example

// Usage
.el {
    color: get-lightest($green-palette);
}

// Output
.el {
    color: #f4f1f3;
}

Requires

get_lighter

@function get_lighter($palette) { ... }

Description

Retrieves the lighter color from a map generated with create-named-palette.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$palette

Map of colors with associated names

Map none

Returns

String

single color matching the given keyword

Example

// Usage
.el {
    color: get-lighter($green-palette);
}

// Output
.el {
    color: #d5d5d5;
}

Requires

get_light

@function get_light($palette) { ... }

Description

Retrieves the light color from a map generated with create-named-palette.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$palette

Map of colors with associated names

Map none

Returns

String

single color matching the given keyword

Example

// Usage
.el {
    color: get-light($green-palette);
}

// Output
.el {
    color: #c2c3c0;
}

Requires

get_base

@function get_base($palette) { ... }

Description

Retrieves the base color from a map generated with create-named-palette.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$palette

Map of colors with associated names

Map none

Returns

String

single color matching the given keyword

Example

// Usage
.el {
    color: get-base($green-palette);
}

// Output
.el {
    color: lightgreen;
}

Requires

get_dark

@function get_dark($palette) { ... }

Description

Retrieves the dark color from a map generated with create-named-palette.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$palette

Map of colors with associated names

Map none

Returns

String

single color matching the given keyword

Example

// Usage
.el {
    color: get-dark($green-palette);
}

// Output
.el {
    color: #79b079
}

Requires

get_darker

@function get_darker($palette) { ... }

Description

Retrieves the darker color from a map generated with create-named-palette.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$palette

Map of colors with associated names

Map none

Returns

String

single color matching the given keyword

Example

// Usage
.el {
    color: get-darker($green-palette);
}

// Output
.el {
    color: #4f864f;
}

Requires

get_darkest

@function get_darkest($palette) { ... }

Description

Retrieves the darkest color from a map generated with create-named-palette.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$palette

Map of colors with associated names

Map none

Returns

String

single color matching the given keyword

Example

// Usage
.el {
    color: get-darkest($green-palette);
}

// Output
.el {
    color: #497c49;
}

Requires

debug

variables

layout-debug-outline

$layout-debug-outline: false !default;

Description

Enables layout debugging, where it applies a unique colored outline to each html element on the page based on its type, to help figure out where any layout issues are coming from.

Links

namespace-debug

$namespace-debug: false !default;

Description

Enables Namespace visual debugging, where it applies a unique color to each namespaced class based on its type, to see help see how different classes are used throughout the site.

Links

legacy-debug

$legacy-debug: false !default;

Description

Highlight potentially broken, malformed or legacy (X)HTML.

Links

defaults

variables

breakpoints

$breakpoints: (
    'sm'   : 30em,   // 480px  - Mobile Landscape
    'md'   : 48em,   // 768px  - Tablet
    'lg'   : 62em,   // 992px  - Laptop
    'xl'   : 80em,   // 1200px - Desktop
    'huge' : 100em,  // 1600px - Huge
) !default;

Description

Breakpoints for responsive design, any name/pair can go here. These are used to create scoped versions of all classes so responsive behavior can be applied directly using classes, with the label as the prefix. All media queries are generated with screen and min-width().

Example

.mt-4 { margin-top: 1rem; }

@include media screen and (min-width >= 48em) {
  .md:mt-4 { margin-top: 1rem; }
}

@include media screen and (min-width >= 62em) {
  .lg:mt-4 { margin-top: 1rem; }
}
<div class="mt-4 md:mt-6 lg:mt-8"></div>

Used by

font-families

$font-families: (
    'sans'  : ('source-sans-pro', 'Helvetica Neue', Helvetica, Arial, sans-serif),
    'serif' : ('source-serif-pro', Georgia, 'Times New Roman', Times, serif),
    'mono'  : ('source-code-pro', 'Inconsolata', 'Menlo', Consolas, 'Andale Mono WT', 'Andale Mono',
                'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono',
                'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace),
) !default;

Description

Generates classes to set the font family based on the keys of the map, while the stack is the value of that array.

Example

.sans { font-family: 'source-sans-pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; }
<p class="sans"></p>

font-sizes

$font-sizes: (
    'xs'   : .75rem,    // 12px
    'sm'   : .875rem,   // 14px
    'base' : 1rem,      // 16px
    'md'   : 1.125rem,  // 18px
    'lg'   : 1.25rem,   // 20px
    'xl'   : 1.5rem,    // 24px
    '2xl'  : 1.875rem,  // 30px
    '3xl'  : 2.25rem,   // 36px
    '4xl'  : 3rem       // 48px
) !default;

Description

Generates font size classes in rem units with px fallbacks, as well as prefixed versions for each breakpoint.

Example

.text-xs { font-size: 12px; font-size: .75rem; }
.text-lg { font-size: 20px; font-size: 1.25rem; }
<h1 class="text-3xl md:text-4xl"></h1>

font-weights

$font-weights: (
    'hairline' : 200,
    'thin'     : 300,
    'regular'  : 400,
    'medium'   : 600,
    'bold'     : 700,
) !default;

Description

Generates classes for font-weight with names that should match the font.

Example

.text-hairline { font-weight: 200 }
.text-regular  { font-weight: 400 }
<h1 class="text-regular"></h1>

letter-spacing

$letter-spacing: (
    'tight'  : -.05em,
    'normal' : 0,
    'wide'   : .2em,
) !default;

Description

Generates classes to the control the tracking of text.

Example

.tracking-tight { letter-spacing: -.05em; }
.tracking-wide  { letter-spacing: .2em; }
<h3 class="tracking-wide"></h3>

line-heights

$line-heights: (
    'none'  : 1,
    'tight' : 1.25,
    'normal': 1.5,
    'loose' : 2,
) !default;

Description

Generates classes to control the leading of text.

Example

.leading-none   { line-height: 1; }
.leading-normal { line-height: 1.5; }
<p class="leading-normal"></p>

background-positions

$background-positions: (
    'top-left'     : (left top),
    'top'          : (center top),
    'top-right'    : (right top),
    'bottom-right' : (right bottom),
    'bottom'       : (center bottom),
    'bottom-left'  : (left bottom),
    'right'        : (right center),
    'left'         : (left center),
    'center'       : (center center),
) !default;

Description

Generates classes to position the background in one of the 9 basic directions by default, with prefixes for each breakpoint.

Example

.bg-top-left { background-position: left top; }
.bg-center   { background-position: center center; }
.bg-right    { background-position: right center; }
<div class="bg-center"></div>

backgrounds

$backgrounds: (
    'base' : #fff,
) !default;

Description

Generates classes to set the background color, including both hover and focus versions.

Example

.bg-base             { background-color: #fff; }
.hover:bg-base:hover { background-color: #fff; }
.focus:bg-base:focus { background-color: #fff; }
<button class="bg-base hover:bg-base"></button>

text-colors

$text-colors: (
    'base' : #111,
) !default;

Description

Generates colors to change the color of text, as well as the text-decoration-color. Also generates hover and focus versions of the classes to apply colors in those states.

Example

.color-base             { color: #111; }
.hover:color-base:hover { color: #111; }
.focus:color-base:focus { color: #111; }
<p class="color-base focus:color-base"></p>

border-colors

$border-colors: (
    'base' : #aaa,
) !default;

Description

Generates classes used to color the borders of an element, including both hover and focus versions.

Example

.bd-base             { border-color: #aaa; }
.hover:bd-base:hover { border-color: #aaa; }
.focus:bd-base:focus { border-color: #aaa; }
<p class="bd-base focus:bd-base"></p>

border-widths

$border-widths: (
    '0' : 0,
    '1' : 1px,
    '2' : 2px,
) !default;

Description

Generates classes to set the width of borders. Also generates direction specific versions so that individual sides can be set.

Example

.bd-0 { border-width: 0; }
.bd-t-1 { border-top-width: 1px; }
<p class="bd-t-1"></p>

border-radius

$border-radius: (
    '0'    : 0,
    'sm'   : .125rem,
    'md'   : .25rem,
    'lg'   : .5rem,
    'pill' : 9999px
) !default;

Description

Generates classes to round the corners of an element, currently only does all sides.

Example

.rounded-0    { border-radius: 0; }
.rounded-pill { border-radius: 9999px; }
<div class="rounded-pill"></div>

box-shadows

$box-shadows: (
    'base' : (0 2px 4px rgba(black, .5)),
) !default;

Description

Generates classes to set the box-shadow of an element, including hover and focus variants

Example

.b-shadow-base             { box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.hover:b-shadow-base:hover { box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.focus:b-shadow-base:focus { box-shadow: 0 2px 4px rgba(0,0,0,.5); }
<div class="b-shadow-base focus:b-shadow-base"></div>

spacings

$spacings: (
    '0'  : 0,         // 0px
    '1'  : 0.25rem,   // 4px
    '2'  : 0.5rem,    // 8px
    '3'  : 0.75rem,   // 12px
    '4'  : 1rem,      // 16px
    '5'  : 1.25rem,   // 20px
    '6'  : 1.5rem,    // 24px
    '8'  : 2rem,      // 32px
    '10' : 2.5rem,    // 40px
    '12' : 3rem,      // 48px
    '13' : 3.25rem,   // 52px
    '15' : 3.75rem,   // 60px
    '16' : 4rem,      // 64px
    '24' : 6rem,      // 96px
) !default;

Description

Generates classes for both margins and paddings. Classes are created for each side as well as all sides, and negative versions of each.

sizing-common

$sizing-common: (
    '1px'  : 1px,
    '2px'  : 2px,
    '0'    : 0,
    '1'    : 0.25rem,
    '2'    : 0.5rem,
    '3'    : 0.75rem,
    '4'    : 1rem,
    '5'    : 1.25rem,
    '6'    : 1.5rem,
    '8'    : 2rem,
    '10'   : 2.5rem,
    '12'   : 3rem,
    '13'   : 3.25rem,
    '15'   : 3.75rem,
    '16'   : 4rem,
    '24'   : 6rem,
    'auto' : auto,
    'full' : 100%,
) !default;

Description

Shared Sizing - both widths and heights

sizing-heights

$sizing-heights: (
    'screen' : 100vh,
) !default;

Description

Height specific sizes

sizing-widths

$sizing-widths: (
    '1#{\/}2'  : 50%,
    '1#{\/}3'  : ( calc(1 / 3 * 100%) ),
    '2#{\/}3'  : ( calc(2 / 3 * 100%) ),
    '1#{\/}4'  : 25%,
    '3#{\/}4'  : 75%,
    '1#{\/}5'  : 20%,
    '2#{\/}5'  : 40%,
    '3#{\/}5'  : 60%,
    '4#{\/}5'  : 80%,
    '1#{\/}6'  : ( calc(1 / 6 * 100%) ),
    '5#{\/}6'  : ( calc(5 / 6 * 100%) ),
    '1#{\/}12' : ( calc(1 / 12 * 100%) ),
) !default;

Description

Width specific sizes

max-widths

$max-widths: (
    'xs'   : 18rem,  // 288px
    'sm'   : 32rem,  // 512px
    'md'   : 38rem,  // 608px
    'lg'   : 42rem,  // 672px
    'xl'   : 60rem,  // 960px
    'none' : 100%,
) !default;

Description

Max Widths

text-shadows

$text-shadows: (
    'hero' : (0 2px 5px rgba(black, .5)),
) !default;

Description

Generates classes to set the text-shadow of an element, including hover and focus variants

Example

.t-shadow-base             { text-shadow: 0 2px 5px rgba(0,0,0,.5); }
.hover:t-shadow-base:hover { text-shadow: 0 2px 5px rgba(0,0,0,.5); }
.focus:t-shadow-base:focus { text-shadow: 0 2px 5px rgba(0,0,0,.5); }
<div class="t-shadow-base focus:t-shadow-base"></div>

transitions

$transitions: (
    'all'    : all $default-time linear,
    'button' : (background-color $default-time linear,
                color $default-time linear),
) !default;

Description

Transitions

Used by

opacities

$opacities: (
    '0' : 0,
    '1' : 1,
) !default;

Description

Opacity

aspect-ratios

$aspect-ratios: (
    '16x9' : 56.25%,
    '9x16' : 177.77%,
    '4x3'  : 75%,
    '3x4'  : 133.33%,
    '6x4'  : 66.6%,
    '4x6'  : 150%,
    '8x5'  : 62.5%,
    '5x8'  : 160%,
    '7x5'  : 71.42%,
    '5x7'  : 140%,
    '1x1'  : 100%,
) !default;

Description

Aspect Ratios

z-index

$z-index: (100, 200, 300, 400, 500) !default;

Description

Z-Index

getters

functions

config

@function config($name, $map) { ... }

Description

Grabs a value from the pre-defined settings

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

Named item to get size for

String none
$map

Name of map to get size from

Map none

Returns

String

Named value to get size for from sass map

Example

.navbar { height: config('navbar', $sizing-heights); }
.site-red { background-color: config('base', $backgrounds); }
.navbar { height: 3em; }
.site-red { background-color: # }

math

variables

pi

$pi: 3.14159265359 !global;

Description

Pi value used for trig functions

Used by

Links

functions

pow

@function pow($number, $exp) { ... }

Description

Raise a number to a specific power

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$number

base number to raise

Number none
$exp

number of times to multiply base

Number none

Example

// Usage
.foo {
    margin-bottom: pow(2, 2) + 0px;
}

.foo {
    margin-bottom: 4px;
}

Used by

Links

fact

@function fact($number) { ... }

Description

Find the factorial of a number, by multipling each number from 1 to the given

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$number

number to start with

Number none

Example

// Usage
.foo {
    $num: fact(3);
}

.foo {
    $num: 6;
}

Used by

Links

rad

@function rad($angle) { ... }

Description

Convert an angle to radians

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$angle

angle to convert

Number none

Requires

  • [variable] pi

Used by

Links

sin

@function sin($angle) { ... }

Description

Find the sin value of an angle

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$angle

angle to convert

Number none

Requires

Used by

Links

cos

@function cos($angle) { ... }

Description

Find the cos value of an angle

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$angle

angle to convert

Number none

Requires

Used by

Links

tan

@function tan($angle) { ... }

Description

Find the tan value of an angle

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$angle

angle to convert

Number none

Requires

Links

randomizers

functions

rand-num

@function rand-num($min, $max) { ... }

Description

Custom random function to allow minimum value

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$min

lower boundry

Int none
$max

upper boundry

Int none

Returns

Int

Random number between upper and lower boundries

Example

$items : rand(5, 10);

styling

variables

theme

$theme: 'default' !default;

Description

Sets the active theme name, useful for creating different css files where this single value is changed and the output is then based on the that.

Example

.class {
  color: black;

  @include theme('red') { color: red; }
  @include theme('blue') { color: blue; }
}

// app.scss
$theme: 'default';

// red.scss
$theme: 'red';

// blue.scss
$theme: 'blue';
/* app.css */
.class { color: black; }

/* red.css */
.class { color: red; }

/* blue.css */
.class { color: blue; }

Used by

Links

functions

crayola

@function crayola($color) { ... }

Description

Returns a Crayola crayon color

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$color

Named color to get

String none

Returns

Color

Hex color value for Crayola crayon code

Example

// Usage
.el {
    color: crayola('blackcoralpearl');
}

// Output
.el {
    color: #54626f;
}

Links

pantone

@function pantone($color) { ... }

Description

Returns a Pantone Coated color

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$color

Named color to get

String none

Returns

Color

Hex color value for Pantone Coated Code

Example

// Usage
.el {
    color: pantone('Reflex-Blue-C');
}

// Output
.el {
    color: #001489;
}

Links

stripes

@function stripes($colors, $direction: 90deg, $random: false) { ... }

Description

Generates bg stripes from a list of $colors

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$colors

list of colors to use, with or without color stops

List none
$direction

Direction of colors for linear gradiant

Int90deg
$random

Choose to use random stops

Boolfalse

Returns

String

linear gradient to apply to item

Example

$colors: #1abc9c #2ecc71 #3498db #9b59b6 #34495e #f1c40f #e67e22 #e74c3c #ecf0f1 #95a5a6;
$custom-stops: #1abc9c 10%, #2ecc71 12.5%, #3498db 28%, #9b59b6 35%, #34495e 60%, #f1c40f 69%, #e67e22 83%, #e74c3c 88%, #ecf0f1 96%, #95a5a6 100%;

 // Equal stops
 background: stripes($colors, $direction);

 // Random stops
 background: stripes($colors, 90deg, true); 

 // Custom stops
 background: stripes($custom-stops, 90deg);

Links

long-shadow

@function long-shadow($direction, $length, $color, $fade: false, $shadow-count: 100) { ... }

Description

Generates a long shadow on an element Property-agnostic: works with both text and box shadow.

  • false means no fade, shadow is $color
  • true means fading from $color to transparent
  • a color means fading from $color to $fade

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$direction

shadow's direction (ang or keyword)

Direction none
$length

shadow's length

Length none
$color

shadow's color

Color none
$fade

Whether or not shadow should fade

Bool or Colorfalse
$shadow-count

number of shadows

Number100

Returns

List

list of shadows

Example

// Usage
.foo {
    text-shadow: long-shadow(42deg, 1em, #16a085');
}

.bar {
    box-shadow: long-shadow(to top left, 150px, hotpink, tomato);
}

Requires

Links

Author

  • Hugo Giraudel

shade

@function shade($color, $percentage) { ... }

Description

Slightly darken a color

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$color

color to shade

Color none
$percentage

percentage of $color in returned color

Number none

Returns

Color

Example

// Usage
.el {
    background-color: darken(#C6538C, 30%);
    background-color: shade(#C6538C, 30%);
}

// Output
.el {
   background-color: #602040;
   background-color: #8a3a62;
}

Links

tenue-shadow

@function tenue-shadow($steps: 70, $ratio: .005, $op: .85, $angle: -133deg, $col: #000, $bg: null) { ... }

Description

Creates a tenue shadow effect on text

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$steps

number of shadows, max 128

Int70
$ratio

space between shadow steps

Int.005
$op

opacity of each step

Int.85
$angle

angle of shadow

Degree-133deg
$col

starter color, usually same as text color

String#000
$bg

ending color, usually same as bg color

Stringnull

Returns

List

list of text shadows

Example

// SCSS
.tenue-shadow {
    color: #f0f;
    text-shadow: tenue-shadow(
                    $steps: 10,
                    $ratio: .03,
                    $op: .75,
                    $angle: -30deg,
                    $color: $color,
                    $bg: $bg
               );
} 

// CSS
.tenue-shadow {
    color: #f0f;
    text-shadow: -0.03em 0.02598em 0.4px rgba(229, 0, 229, 0.75), -0.045em 0.05196em 0.8px rgba(204, 0, 204, 0.75), -0.075em 0.07794em 1.2px rgba(178, 0, 178, 0.75), -0.09em 0.10392em 1.6px rgba(153, 0, 153, 0.75), -0.12em 0.1299em 2px rgba(127, 0, 127, 0.75), -0.135em 0.15588em 2.4px rgba(102, 0, 102, 0.75), -0.165em 0.18187em 3.4px rgba(76, 0, 76, 0.75), -0.18em 0.20785em 4.4px rgba(51, 0, 51, 0.75), -0.21em 0.23383em 5.4px rgba(25, 0, 25, 0.75), -0.225em 0.25981em 6.4px rgba(0, 0, 0, 0.75);
}

Requires

Links

tint

@function tint($color, $percentage) { ... }

Description

Slightly lightens a color

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$color

color to alter

Color none
$percentage

percentage of $color in returned color

Number none

Returns

Color

Example

// Usage
.el {
    background-color: lighten(#C6538C, 30%);
    background-color: shade(#C6538C, 30%);
}

// Output
.el {
   background-color: #ecc6d9;
   background-color: #d786ae;
}

Links

mixins

fluid-prop

@mixin fluid-prop($properties, $min-value, $max-value, $min-width: 'tablet', $max-width: 'desktop') { ... }

Description

Allows a property to be fluid between min and max values

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$properties

properties to make fluid

Array none
$min-value

minimium size

Value none
$max-value

maximium size

Value none
$min-width

minimium breakpoint

String'tablet'
$max-width

max breakpoint

String'desktop'

Example

.el {
    @include fluid-prop(font-size, 16px, 20px);
}
.el {
    font-size: 16px;
    font-size: 1rem;
}

@media (min-width: 48em) {
    .el {
        font-size: calc(16px + 4 * (100vw - 48em) / 27);
        font-size: calc(1rem + 4 * (100vw - 48em) / 27);
    }
}

@media (min-width: 75em) {
    .el {
        font-size: 20px;
        font-size: 1.25rem;
    }
}

Requires

Links

ff

@mixin ff($stack-name, $map: $font-stacks) { ... }

Description

Outputs a font stack.
See $font-stack under Global Styling

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$stack-name

Short name for font stack

String none
$map

Name of map of font stacks

Map$font-stacks

Example

// Usage
.el {
    @include ff("Helvetica");
}

// Output
.el {
	   font-family: Helvetica, Arial, sans-serif;
}

fs

@mixin fs($font-size, $line-height) { ... }

Description

Shortened name for Typecsset font size mixin.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$font-size

Font size in px to convert to rem

Int none
$line-height

(true) - Choose whether to include line-height in the output

Boolean none

Example

// Usage
.el {
    @include fs(16px);
}

// Output
.el {
	   font-size: 16px;
	   font-size: 1rem;
	   line-height: 1.5rem;
}

Used by

hanging-indent

@mixin hanging-indent($indent: 1em) { ... }

Description

Indents all lines but the first

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$indent

size of the indent

Int1em

Example

// SCSS
.el {
    @include hanging-indent(1.5em);
}

// CSS
.el {
    padding-left: 1.5em;
    text-indent: -1.5em;
}

Requires

Links

hyphenate

@mixin hyphenate() { ... }

Description

Hyphenates extra long words using css so they stay inside their containers

Parameters

None.

Links

ig-filter

@mixin ig-filter($name) { ... }

Description

Applies an Instagram-like filter to an img element using filters and blend-modes.
Images with filters need to be wrapped by another element, such as a <figure>

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

{String} - name of filter to apply

none

Example

<figure class="filter-aden">
  <img src='...'>
</figure>
// SCSS
.el {
  @include ig-filter(aden);
}

// CSS
.el {
  position: relative;
  filter: hue-rotate(-20deg) contrast(0.9) saturate(0.85) brightness(1.2);
}

.el:after {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  content: '';
  display: block;
  pointer-events: none;
  opacity: 1;
  background: linear-gradient(to right, rgba(66, 10, 14, 0.2), transparent);
  mix-blend-mode: darken; 
}

Requires

Links

loader

@mixin loader($name, $color: #0052ec, $size: 56px, $height: 20px, $border-size: 8px, $gap: 12px, $duration: 1s, $align: middle) { ... }

Description

A set of mixins for single element loaders and spinners

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

name of loader style

String none
$color

color of loader

String#0052ec
$size

size of the loader

Integer56px
$height

height of loader elements

Integer20px
$border-size

size for circle versionse

Integer8px
$gap

space between elements

Integer12px
$duration

timing for animation

Integer1s
$align

alignment for items

Stringmiddle

Example

<div class="loader01"></div>
.loader01 {
    @include loader('circle-cutout')
}

// CSS
  .loader01 { height: 56px; width: 56px; -webkit-animation: loader-rotate 1s linear infinite; animation: loader-rotate 1s linear infinite; border-radius: 50%; border-right-color: transparent; border: 8px solid #0052ec; position: relative; top: 50%; margin: -28px auto 0; }
  @-webkit-keyframes loader-rotate { from { -webkit-transform: rotate(0); transform: rotate(0); }
    to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
  @keyframes loader-rotate { from { -webkit-transform: rotate(0); transform: rotate(0); }
    to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
    
.loader01::after { top: -1px; left: 33px; position: absolute; height: 8px; width: 8px; content: ''; background: #0052ec; border-radius: 50%; }

Requires

Links

mq

@mixin mq($name, $map: $breakpoints) { ... }

Description

Mixin for inserting a media query. Can also be used to insert tweakpoints.
See $breakpoints under Global Styling
Tweakpoint maps are defined on a per component basis

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

Names breakpoint to get

String none
$map

Name of map of breakpoints

Map$breakpoints

Content

This mixin allows extra content to be passed (through the @content directive).

Example

// Usage
.selector {
    font-size: 1rem;
    
    @include mq("tablet") {
        font-size: 1.4rem;
    }
}

$tweakpoints: (
    "medium" : (screen and min-width: 20em)
)
.el {
    width: 50%;
    
    @include mq("medium", $tweakpoints) {
        width: 45%;
    }
}

// Output
 .selector {
     font-size: 1rem;
 }
 @media only screen and (min-width: 48em) {
     .selector {
          font-size: 1.4rem;
     }
 }
 
 .el {
    width: 50%;
 }
 @media only screen and (min-width: 20em) {
     .el {
          width: 45%;
     }
 }

Throws

  • Warning: if named breakpoint/tweakpoint is not found

absolute

@mixin absolute($args) { ... }

Description

Absolute position mixin using _position function.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$args

List of offsets and values

List none

Example

// Usage
.el {
    @include absolute(top 5px left 50%);
}

// Output
.el {
    position: absolute;
    top: 5px;
    left: 50%;
}

Throws

  • Warning: will not output any selector for position other than 'top right bottom left'

  • Warning: will not output value other and a number or 'auto'

Used by

relative

@mixin relative($args) { ... }

Description

Relative position mixin using _position function.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$args

List of offsets and values

List none

Example

// Usage
.el {
    @include relative(top 50% right 0 left 0);
}

// Output
.el {
    position: relative;
    top: 50%;
    right: 0;
    left: 0;
}

Throws

  • Warning: will not output any selector for position other than 'top right bottom left'

  • Warning: will not output value other and a number or 'auto'

fixed

@mixin fixed($args) { ... }

Description

Fixed position mixin using _position function.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$args

List of offsets and values

List none

Example

// Usage
.el {
    @include fixed(top 0 right 0 bottom 0 left 0)
}

// Output
.el {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

Throws

  • Warning: will not output any selector for position other than 'top right bottom left'

  • Warning: will not output value other and a number or 'auto'

rem

@mixin rem($property, $values) { ... }

Description

Adds rem & px fallback values for property passed in.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$property

CSS property you want to apply a value to

String none
$values

Rem values you want to apply to $property

Int none

Example

//  Usage
.el {
    @include rem(font-size, 1.6rem);
    @include rem(padding, 1rem .5rem)
}

// Output
.el {
    font-size: 16px;
    font-size: 1.6rem;
    padding: 10px 5px;
    padding: 1rem .5rem;
}

scrollbar

@mixin scrollbar($size, $primary, $secondary) { ... }

Description

Webkit (and IE) scrollbar styling. Include in layout/_base.scss if required.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$size

width for vertical scrollbars, height for horizontal scrollbars

Int none
$primary

main color (scrollbar)

String none
$secondary

secondary color (background)

String none

Example

// Usage
  @include scrollbar(5px, #333, #ccc);


// Output
::-webkit-scrollbar: {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background: #333;
}

::-webkit-scrollbar-track {
    background: #ccc;
}

body {
  scrollbar-face-color: #333;
  scrollbar-track-color: #ccc;
}

side-lines

@mixin side-lines($height: 1px, $space: .5em, $color: inherit, $style: solid, $v-adjust: false, $double: false) { ... }

Description

Creates a solid line(s) extending across the screen around an element

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$height

size of lines

Int1px
$space

how far away from element lines start

Int.5em
$color

color of the lines

Stringinherit
$style

style of lines, accepts border-style values

Stringsolid
$v-adjust

adds space to bottom of lines

Boolfalse
$double

double the lines by adding a value for the distance between the two lines

Boolfalse

Example

// SCSS
.el {
  @include side-lines();
}

// CSS
.el {
  display: block;
  overflow: hidden;
  text-align: center;
}

.el:before,
.el:after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  position: relative;
  width: 50%;
  border-top-style: solid
  border-top-width: 1px;
}
.el:before {
  right: .5em;
  margin-left: -50%;
}
.el:after {
  left: .5em;
  margin-right: -50%;
}

Requires

Links

size

@mixin size($width, $height: $width) { ... }

Description

Sets the width and height of the element in one statement.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$width noneNumber (with unit) or String none
$height noneNumber (with unit) or String$width

Example

.first-element {
  @include size(2em);
}

// CSS Output
.first-element {
  width: 2em;
  height: 2em;
}
.second-element {
  @include size(auto, 10em);
}

// CSS Output
.second-element {
  width: auto;
  height: 10em;
}

Throws

  • #{$height} is not a valid length for the $height argument in the size mixin.

  • #{$width} is not a valid length for the $width argument in the size mixin.

Used by

strikethrough

@mixin strikethrough() { ... }

Description

Creates an animated strikethrough that enters from left and exits on the right

Parameters

None.

Example

.el {
  @include strikethrough
}

Requires

svg-color

@mixin svg-color($color, $stroke: $color) { ... }

Description

Styles svg elements using the given $color

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$color

color to use for fill

Color none
$stroke

color to use for the stroke

Color$color

Example

// Usage
.el {
    @include svg-color(red);
}

// Output
.el {
    fill: red;
    stroke: red;
}

Links

theme

@mixin theme($name) { ... }

Description

SMACSS Theming

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

theme name

String none

Content

This mixin allows extra content to be passed (through the @content directive).

Example

.foobar {
  background: #ff3377;
  @include theme(beccapurple){
    background: #663399;
  }
}

Throws

  • $name is not a string

Requires

Links

trans

@mixin trans($transition-name: all) { ... }

Description

Outputs a specific type of transition with duration and easing type.
See $transitions variable

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$transition-name

Name for transition type

Stringall

Example

// Usage
.el {
    @include transition("border");
}

// Output
.el {
		transition: border 0.3s linear;
}

Requires

triangle

@mixin triangle($element, $direction, $position, $color: inherit, $size: 1em) { ... }

Description

Mixin for adding a triangle to a :before or :after psuedo element.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$element

psuedo element to use, only allows "before" or "after"

String none
$direction

direction for the arrow to face

String none
$position

List of offsets and values

List none
$color

color for arrow

Stringinherit
$size

size of arrow

Int1em

Example

// Usage
.el {
    @include triangle(after, left, top 50% right -10px, #333, 12px);
}

// Output
.el {
    &:after {
      position: absolute;
      top: 50%;
      right: -10px;
      width: 0;
      height: 0;
      content: '';
      z-index: 2;
      border-right: 12px solid #333;
      border-top: 12px solid transparent;
      border-bottom: 12px solid transparent;
    }
}

Throws

  • Warning if $element is not 'before' or 'after'

  • Watning if $direction is not 'top right bottom left'

Requires

video-wrapper

@mixin video-wrapper() { ... }

Description

Wraps a video embed with aspect ratio specific padding

Parameters

None.

Example

.el {
    @extend %video-holder;
}
<div class="video-holder [landscape || portrait]">
    <video></video>
    <iframe></iframe>
    <embed></embed>
</div>

Requires

utility

functions

aspect-ratio

@function aspect-ratio($ratio) { ... }

Description

Create a percentage based on an aspect ratio

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$ratio

2 numbers seperated by a space

List none

Example

// Usage
.el {
    padding-bottom: aspect-ratio(16 9);
    padding-bottom: aspect-ratio(4 3);
}

// Output
.el {
    padding-bottom: 56.25%;
    padding-bottom: 75%;
}

Requires

Used by

easing

@function easing($name, $delay: null) { ... }

Description

Returns a cubic besier curve for various easings

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

easing name

String none
$delay

animation delay

Intnull

Returns

Map

cubic bezier easing syntax

Requires

Links

strip-units

@function strip-units($number) { ... }

Description

Simple function to remove the units from a value

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$number

{Int} - Number to remove units from

none

Example

// Usage
 $base-lh : 1.5em;

.el {
    line-height: strip-units($base-lh);
}

// Output
.el {
    line-height: 1.5;
}

Used by

variables

easings

$easings: (
	"linear"         : (0.250, 0.250, 0.750, 0.750),
	"ease"           : (0.250, 0.100, 0.250, 1.000),
	"ease-in"        : (0.420, 0.000, 1.000, 1.000),
	"ease-out"       : (0.000, 0.000, 0.580, 1.000),
	"ease-in-out"    : (0.420, 0.000, 0.580, 1.000),

	"easeInQuad"     : (0.550, 0.085, 0.680, 0.530),
	"easeInCubic"    : (0.550, 0.055, 0.675, 0.190),
	"easeInQuart"    : (0.895, 0.030, 0.685, 0.220),
	"easeInQuint"    : (0.755, 0.050, 0.855, 0.060),
	"easeInSine"     : (0.470, 0.000, 0.745, 0.715),
	"easeInExpo"     : (0.950, 0.050, 0.795, 0.035),
	"easeInCirc"     : (0.600, 0.040, 0.980, 0.335),
	"easeInBack"     : (0.600, -0.280, 0.735, 0.045),

	"easeOutQuad"    : (0.250, 0.460, 0.450, 0.940),
	"easeOutCubic"   : (0.215, 0.610, 0.355, 1.000),
	"easeOutQuart"   : (0.165, 0.840, 0.440, 1.000),
	"easeOutQuint"   : (0.230, 1.000, 0.320, 1.000),
	"easeOutSine"    : (0.390, 0.575, 0.565, 1.000),
	"easeOutExpo"    : (0.190, 1.000, 0.220, 1.000),
	"easeOutCirc"    : (0.075, 0.820, 0.165, 1.000),
	"easeOutBack"    : (0.175, 0.885, 0.320, 1.275),

	"easeInOutQuad"  : (0.455, 0.030, 0.515, 0.955),
	"easeInOutCubic" : (0.645, 0.045, 0.355, 1.000),
	"easeInOutQuart" : (0.770, 0.000, 0.175, 1.000),
	"easeInOutQuint" : (0.860, 0.000, 0.070, 1.000),
	"easeInOutSine"  : (0.445, 0.050, 0.550, 0.950),
	"easeInOutExpo"  : (1.000, 0.000, 0.000, 1.000),
	"easeInOutCirc"  : (0.785, 0.135, 0.150, 0.860),
	"easeInOutBack"  : (0.680, -0.550, 0.265, 1.550),
);

Description

Map of easing values

Used by

Links

mixins

clearfix

@mixin clearfix() { ... }

Description

Clearfix: contain floats

For modern browsers

  1. The space content is one way to avoid an Opera bug when the contenteditable attribute is included anywhere else in the document. Otherwise it causes space to appear at the top and bottom of elements that receive the clearfix class.
  2. The use of table rather than block is only necessary if using :before to contain the top-margins of child elements.

Parameters

None.