main

functions

easing

@function easing() { ... }
View source

Description

Custom easing function

Parameters

None.

Requires

em

@function em($values, $context: 16px) { ... }
View source

Description

Convert px to em

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$values

Value or values to convert

Number or Map none
$context

Base font size

Number16px

Returns

Any type —

Converted value or list of values

Throws

  • πŸ”΄ #{$context} size must be in pixels

scale-clamp

@function scale-clamp($map, $units: vw) { ... }
View source

Description

Generate clamp() to smoothly scale a value between two breakpoints

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$map

Map of breakpoints and values

Map none
$units

Optionally specify container query units

Stringvw

Returns

String

Custom clamp() formula

Example

p {
  font-size: scale-clamp((375px: 16px, 960px: 20px));
}

Used by

Links

svg-url

@function svg-url($svg, $props) { ... }
View source

Description

Inline SVG in url() for background-image

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$svg

SVG markup

String none
$props

SVG attributes

Map none

Returns

String

Inline SVG as url("data:image/svg+xml,…")

Example

.foo {
  background-image: svg-url('chevDown', (fill: none, stroke: red, stroke-width: 1px));
}

Requires

Links

mixins

absolute-fill

@mixin absolute-fill() { ... }
View source

Description

Absolutely position an element and fill available space

Parameters

None.

burger

@mixin burger() { ... }
View source

Description

Burger menu icon mixin

Parameters

None.

Example

.icon {
  --burger-icon-gutter: 6px;
  --burger-icon-stroke-width: 2px;
  --burger-icon-width: 30px;
  // Default vars
  // --burger-icon-color: currentColor;
  // --burger-icon-radius: 0;
  // --burger-icon-speed: 200ms;
  // --burger-icon-cross-angle: 45deg;
  @include burger;

  &.is-active {
    @include burger-to-cross;
  }
}

Links

Author

  • Joren Van Hee

burger-to-cross

@mixin burger-to-cross() { ... }
View source

Description

Animate burger icon to a cross

Parameters

None.

Example

.icon {
  --burger-icon-cross-angle: 30deg;
  --burger-icon-cross-color: megenta;
  @include burger;

  &.is-active {
    @include burger-to-cross;
  }
}

font-smoothing

@mixin font-smoothing($enabled) { ... }
View source

Description

Apply font smoothing in Safari, Chrome, and Firefox. Use sparringly!

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$enabled

Enable or disable smoothing

Boolean none

Links

scale

@mixin scale($properties, $map, $initial: true) { ... }
View source

Description

Scale a value for any number of properites relative to the viewport width

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$properties

Properties to scale

String or List none
$map

Map of breakpoints and values

Map none
$initial

Output initial value (not inside media query)

Booleantrue

Throws

  • scale() requires at least two breakpoints

Requires

Links

visually-hidden

@mixin visually-hidden() { ... }
View source

Description

Hide visually but still be available to screenreaders

Parameters

None.

Used by

Links

visually-hidden-focusable

@mixin visually-hidden-focusable() { ... }
View source

Description

Only hide when not focused or child is focused

Parameters

None.

Requires

Links

undo-visually-hidden

@mixin undo-visually-hidden() { ... }
View source

Description

Undo visually hidden styles

Parameters

None.

Links

break-word

@mixin break-word() { ... }
View source

Description

Break long words, hyphenate if possible (requires lang attribute)

Parameters

None.

Links

variables

easings

$easings: (
  'linear'         : '0.25, 0.25, 0.75, 0.75',
  'ease'           : '0.25, 0.1, 0.25, 1',
  'ease-in'        : '0.42, 0, 1, 1',
  'ease-out'       : '0, 0, 0.58, 1',
  'ease-in-out'    : '0.42, 0, 0.58, 1',
  'easeInBack'     : '0.6, -0.28, 0.735, 0.045',
  'easeInCirc'     : '0.6, 0.04, 0.98, 0.335',
  'easeInCubic'    : '0.55, 0.055, 0.675, 0.19',
  'easeInExpo'     : '0.95, 0.05, 0.795, 0.035',
  'easeInQuad'     : '0.55, 0.085, 0.68, 0.53',
  'easeInQuart'    : '0.895, 0.03, 0.685, 0.22',
  'easeInQuint'    : '0.755, 0.05, 0.855, 0.06',
  'easeInSine'     : '0.47, 0, 0.745, 0.715',
  'easeInOutBack'  : '0.68, -0.55, 0.265, 1.55',
  'easeInOutCirc'  : '0.785, 0.135, 0.15, 0.86',
  'easeInOutCubic' : '0.645, 0.045, 0.355, 1',
  'easeInOutExpo'  : '1, 0, 0, 1',
  'easeInOutQuad'  : '0.455, 0.03, 0.515, 0.955',
  'easeInOutQuart' : '0.77, 0, 0.175, 1',
  'easeInOutQuint' : '0.86, 0, 0.07, 1',
  'easeInOutSine'  : '0.445, 0.05, 0.55, 0.95',
  'easeOutBack'    : '0.34, 1.56, 0.64, 1',
  'easeOutCirc'    : '0.075, 0.82, 0.165, 1',
  'easeOutCubic'   : '0.215, 0.61, 0.355, 1',
  'easeOutExpo'    : '0.19, 1, 0.22, 1',
  'easeOutQuad'    : '0.25, 0.46, 0.45, 0.94',
  'easeOutQuart'   : '0.165, 0.84, 0.44, 1',
  'easeOutQuint'   : '0.23, 1, 0.32, 1',
  'easeOutSine'    : '0.39, 0.575, 0.565, 1',
) !default;
View source

Description

Custom easings map

Type

Map

Used by

Links

escape-chars

$escape-chars: (
  '"': '\'',
  '%': '%25',
  '#': '%23',
  '<': '%3C',
  '>': '%3E',
) !default;
View source

Description

Characters to escape from SVGs

Type

Map

Used by

selectors

mixins

static

@mixin static() { ... }
View source

Description

Alias for :any-link

Parameters

None.

attention

@mixin attention() { ... }
View source

Description

Alias for :is(:hover, :focus, :active)

Parameters

None.

all-states

@mixin all-states() { ... }
View source

Description

Alias for :is(:any-link, :hover, :focus, :active)

Parameters

None.

root-add

@mixin root-add($selector) { ... }
View source

Description

Add selector to root (requires Sass 3.4+)

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$selector

Selector to add to root

String none

Example

.foo {
  @include root-add(a) {
    content: 'a.foo';
  }

  @include root-add('.bar') {
    content: '.foo.bar';
  }
}

Throws

  • πŸ”΄ selector-append() is not supported. Please upgrade to Sass 3.4+

Links

root-before

@mixin root-before($selector) { ... }
View source

Description

Prepend selector (requires Sass 3.4+)

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$selector

Selector to insert before root

String none

Example

.foo {
  @include root-before(a) {
    content: 'a .foo';
  }

  @include root-before('.bar') {
    content: '.bar .foo';
  }
}

Throws

  • πŸ”΄ selector-nest() is not supported. Please upgrade to Sass 3.4+

Links

text-inputs

@mixin text-inputs() { ... }
View source

Description

Helper to select all text input types

Parameters

None.

utilities

functions

str-replace

@function str-replace($string, $search, $replace: '') { ... }
View source

Description

Replace $search with $replace in $string

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$string

Initial string

String none
$search

Substring to replace

String none
$replace

New value

String''

Returns

String

Updated string

Example

str-replace("abcde", "bc", "a") => "aade"

Used by

Links

Author

  • Kitty Giraudel

strip-unit

@function strip-unit($arg) { ... }
View source

Description

Strip units

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$arg

Value to strip

Number none

Returns

Number

Stripped value

Throws

  • πŸ”΄ strip-unit(#{inspect($arg)} is not a valid number

Links

url-encode

@function url-encode($string) { ... }
View source

Description

URL-encode string

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$string

String to encode

String none

Returns

String

URL-encoded string

Requires

Used by