bem

variables

element-separator

$element-separator: '__' !default;

Used by

  • [mixin] e
  • [mixin] e

Author

modifier-separator

$modifier-separator: '--' !default;

Used by

Author

functions

[private] contains-modifier

@function contains-modifier($selector) { ... }

Description

Check if a selector contains modifier

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$selector noneString none

Returns

Boolean

Requires

Used by

  • [mixin] e

Author

[private] selector-to-string

@function selector-to-string($selector) { ... }

Description

Convert selector to string

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$selector noneString none

Returns

String

Used by

Author

[private] get-block

@function get-block($selector) { ... }

Description

Get the block from a selector

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$selector noneString none

Returns

String

Requires

Used by

  • [mixin] e

Author

mixins

b

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

Description

Create a block from element

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$element noneString none

Example

// Input
@include b(block) {
   background: red;

   @include e(header){
       font-size: 14px;

       @include m(css) {
           font-size: 18px;
       }
   };
}

// Output
.block {
    background: red;
}
.block__header {
   font-size: 14px;
}
.block__header--css {
   font-size: 18px;
}

Author

e

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

Description

Create an element from element

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$element noneString none

Example

// Input
@include b(block) {
   background: red;

   @include e(header){
       font-size: 14px;

       @include m(css) {
           font-size: 18px;
       }
   };
}

// Output
.block {
    background: red;
}
.block__header {
   font-size: 14px;
}
.block__header--css {
   font-size: 18px;
}

Requires

Author

m

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

Description

Create a modifier from element

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$element noneString none

Example

// Input
@include b(block) {
   background: red;

   @include e(header){
       font-size: 14px;

       @include m(css) {
           font-size: 18px;
       }
   };
}

// Output
.block {
    background: red;
}
.block__header {
   font-size: 14px;
}
.block__header--css {
   font-size: 18px;
}

Requires

Author

helpers

mixins

aspect-ratio

@mixin aspect-ratio($shape: rect) { ... }

Description

Specifies aspect ratio for an element

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$shape

The shape of the aspect ratio.

Rect or Squarerect

Example

@include aspect-ratio(rect);
@include aspect-ratio(square);

Links

Author

auto-grid

@mixin auto-grid($min-size: 16rem, $gap: 1rem) { ... }

Description

Progressively enhanced, fully responsive grid layout without any media queries using CSS Grid

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$min-size

Minimum size of a grid column.

Number16rem
$gap

Space between grid columns.

Number1rem

Example

@include auto-grid(16rem, 1rem);

Links

Author

font-size

@mixin font-size($size, $rem: 16) { ... }

Description

Set font size in REMs and provide PX fallback

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$size

Font size in pixels.

Number none
$rem

REM font size in pixels.

Number16

Example

@include font-size(20);
@include font-size(20, 12);

Links

Author

full-bleed

@mixin full-bleed() { ... }

Description

Make an element get the full browser width

Parameters

None.

Example

@include full-bleed;

Author

grid

@mixin grid($items: 4, $gutter: $grid-gutter) { ... }

Description

A responsive grid based on CSS Flexbox layout including different sizes based on device width.

This mixin uses several predefined variables which can be modified:

$grid-cols: 12 - maximum number of columns in the grid.

$grid-sizes: 1, 2, 3, 4, 6 - list of sizes of the columns in the grid.

$grid-gutter: 16px - spacing between columns in the grid.

$grid-element: '.o-grid' - selector for the grid element.

$grid-output-css: true - boolean which indicates if CSS should be outputted.

$grid-breakpoints - a map of named media query breakpoints.

(
    'small': 0px,
    'medium': 768px,
    'large': 1024px
)

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$items

Number of items per row

Number4
$gutter

Spacing between items

Number$grid-gutter

Example

@include grid(4, 12);

Requires

Links

Author

loader

@mixin loader($svg: $loader, $repeat: no-repeat, $position: 50% 50%, $size: 2rem 2rem) { ... }

Description

An animated SVG loader A default variable $loader is available. Looks like this:

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$svg

Valid SVG image code.

String$loader
$repeat

Background repeat value.

Stringno-repeat
$position

Background position value.

Number50% 50%
$size

Background size value.

Number2rem 2rem

Example

@include loader;
@include loader($your-svg-string, no-repeat, 0 0, 3rem 1rem);

Requires

Author

rainbow

@mixin rainbow($colors, $stops, $direction: horizontal) { ... }

Description

Create a single background image using CSS gradients without blur between color stops.

This can be achieved with a single linear-gradient, but only Firefox will render it properly.

All other browsers will blur the edges of the stops.

This mixin uses two maps - one with colors and one with color stops.

It is important to know the keys of both maps should be the same.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$colors

Map with named colors.

Map none
$stops

Map with names color stops.

Map none
$direction

Direction of the gradient.

Horizontal or Verticalhorizontal

Example

 @include rainbow(
  $colors: (
    'blue': blue,
    'green': green,
    'orange': orange,
    'purple': purple,
    'red': red
  ),
  $stops: (
    'blue': 30%,
    'green': 45%,
    'orange': 62%,
    'purple': 87%,
    'red': 100%
  ),
  horizontal
);

Links

Author

scroll-shadow

@mixin scroll-shadow($background: #fff, $color: #000, $size: 5) { ... }

Description

Create a scrolling shadow as explained in http://lea.verou.me/2012/04/background-attachment-local/

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$background

HEX background color.

String#fff
$color

HEX color.

String#000
$size

Size of the shadow.

Number5

Example

@include scroll-shadow(#000, #fff, 4);

Links

Author

select

@mixin select($text-color: #444, $border-color: #444, $background-color: #fff, $shadow-color: #000) { ... }

Description

Cross browser mixin for native select field style.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$text-color

HEX color for the text.

String#444
$border-color

HEX color for the border.

String#444
$background-color

HEX color for the background.

String#fff
$shadow-color

HEX color for the box shadow.

String#000

Example

@include select(#222, #333, #fafafa, #000);

Requires

Links

Author

text-truncate

@mixin text-truncate($overflow-style: ellipsis) { ... }

Description

Keep a line of text on a single line and add ellipsis if the text overflows.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$overflow-style

Value for the text-overflow property.

Stringellipsis

Example

@include text-truncate;
@include text-truncate(clip);

Author

triangle

@mixin triangle($size: 2rem, $background: red, $radius: true) { ... }

Description

A triangle with (or without) rounded corners

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$size

Width and height of the triangle.

Number2rem
$background

Background of the triangle.

Stringred
$radius

Enable/disable border radius.

Booleantrue

Example

@include font-size(20);
@include font-size(20, 12);

Links

Author

unbreak

@mixin unbreak($hyphens: auto) { ... }

Description

Prevent text from flowing out of its container

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$hyphens

Value for the hyphens property.

None or Manual or Autoauto

Example

@include unbreak;
@include unbreak(none);

Author

variables

grid-cols

$grid-cols: 12 !default;

Used by

grid-sizes

$grid-sizes: 1, 2, 3, 4, 6 !default;

grid-gutter

$grid-gutter: 16px !default;

Used by

grid-element

$grid-element: '.o-grid' !default;

grid-output-css

$grid-output-css: false !default;

grid-breakpoints

$grid-breakpoints: (
	'small': 0px,
	'medium': 768px,
	'large': 1024px
) !default;

loader

$loader: '<svg width="100" height="100" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#000"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".5" cx="18" cy="18" r="18"></circle><path d="M36 18c0-9.94-8.06-18-18-18" transform="rotate(0 18 18)"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1.5s" repeatCount="indefinite"></animateTransform></path></g></g></svg>' !default;

triangle-before

$triangle-before: '<svg width="19" height="11" viewBox="0 0 19 11"><path fill="';

Used by

triangle-after

$triangle-after: '" d="M18.6067065,0.422572289 C18.3723515,0.182891566 18.0945495,0.0631506024 17.7735597,0.0631506024 L1.18500341,0.0631506024 C0.863883959,0.0631506024 0.586276451,0.182891566 0.351726962,0.422572289 C0.117177474,0.662518072 0,0.946198795 0,1.27414458 C0,1.6020241 0.117177474,1.88570482 0.351726962,2.12545181 L8.64603754,10.6012169 C8.88084642,10.8408976 9.15845392,10.9609036 9.47931399,10.9609036 C9.80017406,10.9609036 10.078041,10.8408976 10.3123959,10.6012169 L18.6067065,2.12538554 C18.8409966,1.88570482 18.958628,1.6020241 18.958628,1.27407831 C18.958628,0.946198795 18.8409966,0.662518072 18.6067065,0.422572289 Z"/></svg>';

Used by

functions

[private] grid-item-width

@function grid-item-width() { ... }

Parameters

None.

Requires

Used by

tools

variables

asset-base-path

$asset-base-path: '../assets' !default;

Description

Base path for assets (fonts, images...), should not include trailing slash

Type

String

Used by

breakpoints

$breakpoints: (
	'phone': 320px,
	'phone-wide': 480px,
	'phablet': 560px,
	'tablet-small': 640px,
	'tablet': 768px,
	'tablet-wide': 1024px,
	'desktop': 1280px,
	'desktop-wide': 1440px
) !default;

Used by

  • [mixin] mq
  • [mixin] mq

sides

$sides: (top, bottom, left, right, all) !default;

Used by

spaceamounts

$spaceamounts: (0, 10, 20, 30, 50) !default;

Used by

functions

[private] asset

@function asset($type, $file) { ... }

Description

Asset URL builder

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$type

Asset type, matching folder name

String none
$file

Asset file name, including extension

String none

Returns

Url

A url() function leading to the asset

Requires

Used by

image

@function image($file) { ... }

Description

Image asset helper

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$file

Asset file name, including extension

String none

Returns

Url

A url() function leading to the image

Requires

font

@function font($file) { ... }

Description

Font asset helper

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$file

Asset file name, including extension

String none

Returns

Url

A url() function leading to the font

Requires

half-negative-number

@function half-negative-number($num) { ... }

Description

Get the half and negative value of a given number

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

A number

Number none

Example

.element {
  $size: 100px;
  width: $size;
  top: half-negative-number($size);
}

Requires

Author

half-number

@function half-number($num) { ... }

Description

Get the half of a given number

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

A number

Number none

Example

.element {
  $size: 100px;
  width: $size;
  height: half-number($size);
}

Used by

Author

negative-number

@function negative-number($num) { ... }

Description

Get the negative value of a given number

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$num

A number

Number none

Example

.element {
  $size: 100px;
  width: $size;
  top: negative-number($size);
}

Used by

Author

shade

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

Description

Slightly darken a color

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$color

Valid CSS color

String none
$percentage

Weight of the darkening

Number none

Example

shade(#444, 20%)
shade($theme-color, 50%)

Author

str-replace

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

Description

Replace a string in another string

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$string

String to search in.

String none
$search

String to search for.

String none
$replace

String to replace with.

String''

Returns

String

The replaced string.

Example

str-replace('hello world', 'world', 'people');

Used by

Author

svg-url

@function svg-url($svg) { ... }

Description

URL encode a valid SVG string

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$svg

Valid SVG image code.

String none

Example

svg-url($svg);

Requires

Used by

Author

tint

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

Description

Slightly lighten a color

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$color

Valid CSS color

String none
$percentage

Weight of the lightening

Number none

Example

tint(#444, 20%)
tint($theme-color, 50%)

Author

to-boolean

@function to-boolean($value) { ... }

Description

Convert a value to boolean

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$value

Any kind of value

Any none

Example

to-boolean(0)           // false
to-boolean(false)       // false
to-boolean(null)        // false
to-boolean("")          // false
to-boolean(())          // false
to-boolean(1)           // true
to-boolean(true)        // true
to-boolean("abc")       // true
to-boolean(0 1 2)       // true
to-boolean((a: 1, b: 2) // true

Used by

Author

v

@function v($var, $fallback: null) { ... }

Description

A function to speed up and simplify usage of CSS custom properties in SCSS

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$var

Name of a CSS custom property with the leading dashes.

String none
$fallback

CSS custom property fallback

String or Nullnull

Example

:root {
  --theme-color: red;
}

body { color: v(theme-color); }
p { color: v(theme-color, #ff0); }

Author

z

@function z($name, $list) { ... }

Description

Easy z-index management based on list of element names

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

Name of the element.

String none
$list

List of element names.

List none

Example

$z-indexes: ('modal', 'site-nav', 'site-header', 'site-content', 'site-footer');

// Usage:
.modal { z-index: z(modal); }
.site-nav { z-index: z(site-nav); }
.site-header { z-index: z(site-header); }
.site-content { z-index: z(site-content); }
.site-footer { z-index: z(site-footer; }

// Output
.modal { z-index: 5; }
.site-nav { z-index: 4; }
.site-header { z-index: 3; }
.site-content { z-index: 2; }
.site-footer { z-index: 1; }

Links

Author

mixins

hover

@mixin hover() { ... }

Description

Enable hover states on devices which support hover media feature and on IE10 and IE11

Detailed info about the Hover CSS Media Feature can be found here. This media query is implemented in almost all modern browsers and works as expected.

The modern browsers include Chrome, Opera, Safari, Edge, Brave, Vivaldi, etc.

Internet Explorer and Firefox do not understand this media feature and therefore will simply ignore all rules inside the query.

Parameters

None.

Example

@include hover {  };

Author

mq

@mixin mq($breakpoint, $type: min, $breakpoints: $breakpoints) { ... }

Description

Get a media query for a given breakpoint. A predefined map of breakpoints is available and can be modified:

$breakpoints: (
  'phone': 320px,
  'phone-wide': 480px,
  'phablet': 560px,
  'tablet-small': 640px,
  'tablet': 768px,
  'tablet-wide': 1024px,
  'desktop': 1280px,
  'desktop-wide': 1440px
);

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$breakpoint

A key from the $breakpoints map.

String none
$type

"min" makes it mobile-first, "max" makes it desktop-first.

Min or Maxmin
$breakpoints

A map of named breakpoints.

Map$breakpoints

Example

@include mq(phone);
@include mq(tablet, max, $breakpoints);

Requires

Author

reset

@mixin reset($all: true, $box-sizing: true, $image: true, $table: true, $textarea: true, $contenteditable: true) { ... }

Description

A modern CSS reset

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$all

If true, reset all properties for all elements effectively removing all user agent styles. This does not apply to the display property.

Booleantrue
$box-sizing

If true, sets the box-sizing property to border-box on all elements.

Booleantrue
$image

If true, disallows images to exceed their container's width.

Booleantrue
$table

If true, removes the spacing between table cells.

Booleantrue
$textarea

If true, reverts the white-space property for textarea elements on Safari.

Booleantrue
$contenteditable

If true, fixes a bug on Chromium browsers with the contenteditable attribute.

Booleantrue

Example

@include reset();
@include reset($all: true, $box-sizing: true, $image: true, $table: true, $textarea: true, $contenteditable: false);

Author

spacing-helpers

@mixin spacing-helpers($sides: $sides, $spaceamounts: $spaceamounts, $paddingPrefix, $marginPrefix, $shorten: false) { ... }

Description

Generates padding and margin helpers classes

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$sides

List with sides.

List$sides
$spaceamounts

List with numbers.

List$spaceamounts
$paddingPrefix

Prefix for padding classes. If falsy, no padding classes will be generated.

String none
$marginPrefix

Prefix for margin classes. If falsy, no margin classes will be generated.

String none
$shorten

If true, the first letter of each side is used. Otherwise the full side is used.

Booleanfalse

Example

@include spacing-helpers($sides, $spaceamounts, 'padding', '', false);

Requires

Links

Author

multi-background-svg

@mixin multi-background-svg($backgrounds) { ... }

Description

Create a CSS multiple background declaration out of multiple SVG backgrounds

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$backgrounds

List of SVG strings

List none

Example

@include multi-background-svg($svg1, $svg2, ...);

Requires

Author

background-svg

@mixin background-svg($svg, $repeat: no-repeat, $position: 0 0, $size: 100% 100%) { ... }

Description

Create a CSS background declaration out of any valid SVG code

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$svg

Valid SVG image code.

String none
$repeat

Background repeat value.

Stringno-repeat
$position

Background position value.

Number0 0
$size

Background size value.

Number100% 100%

Example

@include background-svg($svg, repeat-x, 50% 50%, cover);

Requires

Used by

Author