sass-bem

functions

[private] bem-index

@function bem-index($string) { ... }
View source

Description

Get index of separator.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$string

Name of selector, where we should find separator

Stringnone

Returns

Number

Index of separators

Requires

Used by

[private] block-selector (aliased as b-selector )

@function block-selector($block) { ... }
View source

Description

Selector of block.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$block

Name of block that will come after "."

Stringnone

Returns

String

.[block]

Used by

See

b-selector (alias for block-selector)

@function b-selector() { ... }
View source

Refer to block-selector.

[private] component-selector (aliased as c-selector )

@function component-selector($component, $namespace) { ... }
View source

Description

Selector of component.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$component

Name of component that will come after ".c-"

Stringnone
$namespace

Namespace of component.

Stringnone

Returns

String

.c-[component]

Used by

See

c-selector (alias for component-selector)

@function c-selector() { ... }
View source

Refer to component-selector.

[private] element-selector (aliased as e-selector ee-selector )

@function element-selector($element, $nested: false) { ... }
View source

Description

Selector of element.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$element

Name of element that will come after ".[block]__"

Stringnone
$nested

If element is nested with another element

Booleanfalse

Returns

String

.[block]__[element]

Requires

Used by

See

e-selector (alias for element-selector)

@function e-selector() { ... }
View source

Refer to element-selector.

ee-selector (alias for element-selector)

@function ee-selector() { ... }
View source

Refer to element-selector.

[private] explode

@function explode($string, $separator) { ... }
View source

Description

Explode string to get list of strings.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$string

String which should be exploded

Stringnone
$separator

Separator which will explode string to pieces

Stringnone

Returns

List

List of exploded string

Used by

[private] get-block

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

Description

Get block element from selector.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selector

Selector, from where we will take block

Stringnone

Returns

String

Block element

Requires

Used by

[private] hack-selector (aliased as _-selector )

@function hack-selector($hack, $namespace) { ... }
View source

Description

Selector of hack.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$hack

Name of hack that will come after "._"

Stringnone
$namespace

Namespace of hack.

Stringnone

Returns

String

._[hack]

Used by

See

[private] _-selector (alias for hack-selector)

@function _-selector() { ... }
View source

Refer to hack-selector.

[private] has-pseudo

@function has-pseudo($selector) { ... }
View source

Description

Check if selector contains pseudo element.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selector

Selector, which we will check for pseudo

Stringnone

Returns

Boolean

Used by

[private] has-state

@function has-state($selector) { ... }
View source

Description

Check if selector contains state.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selector

Selector, which we will check for state

Stringnone

Returns

Boolean

Requires

Used by

[private] implode

@function implode($list, $glue: '', $is-nested) { ... }
View source

Description

Implode list to get string.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$list

List which will be imploded

Listnone
$glue

Separator which will glue list

String''
$is-nested

List is nested or not

Booleannone

Returns

String

Imploded list

Used by

[private] is-block

@function is-block($selector) { ... }
View source

Description

Check if selector is block.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selector

Selector, which we will check for block

Stringnone

Returns

Boolean

Requires

Used by

[private] is-element

@function is-element($selector) { ... }
View source

Description

Check if selector is element.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selector

Selector, which we will check for element

Stringnone

Returns

Boolean

Requires

Used by

[private] is-modifier

@function is-modifier($selector) { ... }
View source

Description

Check if selector is modifier.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selector

Selector, which we will check for modifier

Stringnone

Returns

Boolean

Requires

Used by

[private] math-min

@function math-min($a, $n, $default: 0) { ... }
View source

Description

Get minimum number from two of them, or get default.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$a

First number to be checked

Stringnone
$n

Second number to be checked

Stringnone
$default

Default number to be returned if min wasn't found

String0

Returns

Number

Minimum number from two of them

Used by

[private] modifier-selector (aliased as m-selector )

@function modifier-selector($modifier) { ... }
View source

Description

Selector of modifier.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$modifier

Name of modifier that will come after ".[block]--"

Stringnone

Returns

String

.[block]--[modifier]

Requires

Used by

See

m-selector (alias for modifier-selector)

@function m-selector() { ... }
View source

Refer to modifier-selector.

[private] object-selector (aliased as o-selector )

@function object-selector($object, $namespace) { ... }
View source

Description

Selector of object.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$object

Name of object that will come after ".o-"

Stringnone
$namespace

Namespace of object.

Stringnone

Returns

String

.o-[object]

Used by

See

o-selector (alias for object-selector)

@function o-selector() { ... }
View source

Refer to object-selector.

[private] first-selector

@function first-selector() { ... }
View source

Description

Pseudo selector with end of first-of-type.

Parameters

None.

Returns

String

&:first-of-type

See

[private] last-selector

@function last-selector() { ... }
View source

Description

Pseudo selector with end of last-of-type.

Parameters

None.

Returns

String

&:last-of-type

See

[private] even-selector

@function even-selector() { ... }
View source

Description

Pseudo selector with end of nth-child(even).

Parameters

None.

Returns

String

&:nth-child(even)

See

[private] odd-selector

@function odd-selector() { ... }
View source

Description

Pseudo selector with end of nth-child(odd).

Parameters

None.

Returns

String

&:nth-child(odd)

See

[private] before-selector

@function before-selector() { ... }
View source

Description

Pseudo selector with end of before.

Parameters

None.

Returns

String

&::before

See

[private] after-selector

@function after-selector() { ... }
View source

Description

Pseudo selector with end of after.

Parameters

None.

Returns

String

&::after

See

at-selector

@function at-selector($modifier) { ... }
View source

Description

Selector(s) of at relationship.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$modifier

List of modifier that will come after ".[block]--"

Stringnone

Returns

String

.[block]--[modifier]

Requires

Used by

  • [mixin] at

See

  • [mixin] at

next-selector

@function next-selector($element) { ... }
View source

Description

Selector of adjacent relationship.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$element

Name of element that will come after ".[block]__"

Stringnone

Returns

String

& + .[block]__[element]

Requires

Used by

See

duo-selector

@function duo-selector() { ... }
View source

Description

Selector of duo relationship.

Parameters

None.

Returns

String

& + &

Requires

Used by

See

with-selector

@function with-selector($element) { ... }
View source

Description

Selector of sibling relationship.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$element

Name of element that will come after ".[block]__"

Stringnone

Returns

String

& ~ .[block]__[element]

Requires

Used by

See

while-selector

@function while-selector($modifier) { ... }
View source

Description

Selector(s) of while relationship.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$modifier

List of modifiers that will come after ".[block]--"

Stringnone

Returns

String

.[block]--[modifier]

Requires

Used by

See

[private] scope-selector (aliased as s-selector )

@function scope-selector($scope, $namespace) { ... }
View source

Description

Selector of scope.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$scope

Name of scope that will come after ".s-"

Stringnone
$namespace

Namespace of scope.

Stringnone

Returns

String

.s-[scope]

Used by

See

s-selector (alias for scope-selector)

@function s-selector() { ... }
View source

Refer to scope-selector.

[private] splice

@function splice($list, $value, $recursive: false) { ... }
View source

Description

Unset item from list.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$list

List from where will be removed

Listnone
$value

What to be removed

Stringnone
$recursive

List is nested or not

Booleanfalse

Returns

List

Used by

[private] state-selector (aliased as is-selector has-selector js-selector )

@function state-selector($state, $namespace: null) { ... }
View source

Description

Selector of state.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$state

Name of state that will come after ".[is|has|js]-"

Stringnone
$namespace

Namespace of state. [is|has|js]

Stringnull

Returns

String

.[is|has|js]-[state]

Used by

See

is-selector (alias for state-selector)

@function is-selector() { ... }
View source

Refer to state-selector.

has-selector (alias for state-selector)

@function has-selector() { ... }
View source

Refer to state-selector.

js-selector (alias for state-selector)

@function js-selector() { ... }
View source

Refer to state-selector.

[private] hover-selector

@function hover-selector() { ... }
View source

Description

Pseudo selector with end of hover.

Parameters

None.

Returns

String

&:hover

See

[private] focus-selector

@function focus-selector() { ... }
View source

Description

Pseudo selector with end of focus.

Parameters

None.

Returns

String

&:focus

See

[private] active-selector

@function active-selector() { ... }
View source

Description

Pseudo selector with end of active.

Parameters

None.

Returns

String

&:active

See

[private] visited-selector

@function visited-selector() { ... }
View source

Description

Pseudo selector with end of visited.

Parameters

None.

Returns

String

&:visited

See

[private] checked-selector

@function checked-selector() { ... }
View source

Description

Pseudo selector with end of checked.

Parameters

None.

Returns

String

&:checked

See

[private] disabled-selector

@function disabled-selector() { ... }
View source

Description

Selector with state of disabled.

Parameters

None.

Returns

String

&[disabled]

See

[private] readonly-selector

@function readonly-selector() { ... }
View source

Description

Selector with state of readonly.

Parameters

None.

Returns

String

&[readonly]

See

[private] contenteditable-selector (aliased as editable-selector )

@function contenteditable-selector() { ... }
View source

Description

Selector with state of contenteditable.

Parameters

None.

Returns

String

&[contenteditable='true']

Used by

See

editable-selector (alias for contenteditable-selector)

@function editable-selector() { ... }
View source

Refer to contenteditable-selector.

[private] str-replace

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

Description

Replace string with another string.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$string

String from which will be replaced

Stringnone
$search

String which will be removed

Stringnone
$replace

String which will be placed

String''

Returns

String

Used by

[private] test-selector (aliased as qa-selector )

@function test-selector($test, $namespace) { ... }
View source

Description

Selector of test.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$test

Name of test that will come after ".qa-"

Stringnone
$namespace

Namespace of test.

Stringnone

Returns

String

.qa-[test]

Used by

See

qa-selector (alias for test-selector)

@function qa-selector() { ... }
View source

Refer to test-selector.

[private] theme-selector (aliased as t-selector )

@function theme-selector($theme, $namespace) { ... }
View source

Description

Selector of theme.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$theme

Name of theme that will come after ".t-"

Stringnone
$namespace

Namespace of theme.

Stringnone

Returns

String

.t-[theme]

Used by

See

t-selector (alias for theme-selector)

@function t-selector() { ... }
View source

Refer to theme-selector.

[private] utility-selector (aliased as u-selector )

@function utility-selector($utility, $namespace) { ... }
View source

Description

Selector of utility.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$utility

Name of utility that will come after ".u-"

Stringnone
$namespace

Namespace of utility.

Stringnone

Returns

String

.u-[utility]

Used by

See

u-selector (alias for utility-selector)

@function u-selector() { ... }
View source

Refer to utility-selector.

mixins

block (aliased as b )

@mixin block($block) { ... }
View source

Description

Block selector that will be parent of some elements, modifiers, states...

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$block

Name of block that will come after "."

Stringnone

Content

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

Example

Usage

@include block('list') {
    color: black;
}

@include b('list') {
    color: black;
}

Output

.list {
    color: black;
}

.list {
    color: black;
}

Requires

Used by

  • [mixin] b

b (alias for block)

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

Refer to block.

component (aliased as c )

@mixin component($component, $namespace: null) { ... }
View source

Description

Signify that something is a Component. This is a concrete, implementation-specific piece of UI. All of the changes you make to its styles should be detectable in the context you’re currently looking at. Modifying these styles should be safe and have no side effects.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$component

Name of component that will come after ".c-"

Stringnone
$namespace

Component element namespace.

Stringnull

Content

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

Example

Usage

@include component('list') {
    color: black;
}

 @include c('list') {
    color: black;
}

Output

.c-list {
    color: black;
 }

.c-list {
    color: black;
}

Requires

Used by

  • [mixin] c

c (alias for component)

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

Refer to component.

element (aliased as e ee )

@mixin element($element, $nested: false) { ... }
View source

Description

Element selector, that is generated from parent block

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$element

Name of element that will come after ".[block]__"

Stringnone
$nested

If element is nested with other element

Booleanfalse

Content

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

Example

Usage

@include block('list') {
    @include element('item') {
        color: black;
    }
}

@include b('list') {
    @include e('item') {
        color: black;
    }
}

@include b('list') {
    @include e('item') {
        @include ee('link') {
            color: black;
        }
    }
}

@include b('list') {
    @include e(('item', 'link')) {
        color: black;
    }
}

Output

.list__item {
    color: black;
}

.list__item {
    color: black;
}

.list__item__link {
    color: black;
}

.list__item, .list__link {
    color: black;
}

Requires

Used by

  • [mixin] e
  • [mixin] ee

e (alias for element)

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

Refer to element.

ee (alias for element)

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

Refer to element.

hack (aliased as _ )

@mixin hack($hack, $namespace: null) { ... }
View source

Description

Signify that this class is the worst of the worst—a hack! Sometimes, although incredibly rarely, we need to add a class in our markup in order to force something to work. If we do this, we need to let others know that this class is less than ideal, and hopefully temporary (i.e. do not bind onto this).

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$hack

Name of hack that will come after "._"

Stringnone
$namespace

Hack element namespace.

Stringnull

Content

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

Example

Usage

@include hack('clearfix') {
    color: black;
}

@include _('clearfix') {
    color: black;
}

Output

._clearfix {
    color: black;
}

._clearfix {
    color: black;
}

Requires

Used by

  • [mixin] _

[private] _ (alias for hack)

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

Refer to hack.

modifier (aliased as m )

@mixin modifier($modifier) { ... }
View source

Description

Modifier selector, that is generated from parent block.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$modifier

Name of modifier that will come after ".[block]--"

Stringnone

Content

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

Example

Usage

@include block('list') {
    @include modifier('inline') {
        color: black;
    }
}

@include b('list') {
    @include m('inline') {
        color: black;
    }
}

@include b('list') {
    @include m(('inline', 'ordered')) {
        color: black;
    }
}

Output

.list--inline {
    color: black;
}

.list--inline {
    color: black;
}

.list--inline, .list--ordered {
    color: black;
}

Requires

Used by

  • [mixin] m

m (alias for modifier)

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

Refer to modifier.

object (aliased as o )

@mixin object($object, $namespace: null) { ... }
View source

Description

Signify that something is an Object, and that it may be used in any number of unrelated contexts to the one you can currently see it in. Making modifications to these types of class could potentially have knock-on effects in a lot of other unrelated places. Tread carefully.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$object

Name of object that will come after ".o-"

Stringnone
$namespace

Object element namespace.

Stringnull

Content

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

Example

Usage

@include object('button') {
    color: black;
}

@include o('button') {
    color: black;
}

Output

.o-button {
    color: black;
}

.o-button {
    color: black;
}

Requires

Used by

  • [mixin] o

o (alias for object)

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

Refer to object.

parse (aliased as p )

@mixin parse($selectors) { ... }
View source

Description

Parse multiple mixins, pseudo elements and other states.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selectors

List or String of arguments, to generate selector.

String or Listnone

Content

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

Example

Usage

@include b('list') {
    @include parse('&', 'm:inline', ':hover', '[disabled]') {
        color: black;
    }
}

Output

.list, .list--inline, .list:hover, .list[disabled] {
    color: black;
}

Throws

  • Mixin #{nth($parts, 1)} doesn

Requires

Used by

  • [mixin] p

p (alias for parse)

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

Refer to parse.

first

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

Description

Pseudo selector with end of first-of-type.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include first {
        color: black;
    }
}

Output

.list:first-of-type {
    color: black;
}

last

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

Description

Pseudo selector with end of last-of-type.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include last {
        color: black;
    }
}

Output

.list:last-of-type {
    color: black;
}

even

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

Description

Pseudo selector with end of nth-child(even).

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include even {
        color: black;
    }
}

Output

.list:nth-child(even) {
    color: black;
}

odd

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

Description

Pseudo selector with end of nth-child(odd).

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include odd {
        color: black;
    }
}

Output

.list:nth-child(odd) {
    color: black;
}

before

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

Description

Pseudo selector with end of before.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include before {
        color: black;
    }
}

Output

.list:before {
    color: black;
}

after

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

Description

Pseudo selector with end of after.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include after {
        color: black;
    }
}

Output

.list:after {
    color: black;
}

at

@mixin at($modifiers) { ... }
View source

Description

Relationship of parent element with current modifiers.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$modifiers

List of modifiers that will make parent element child.

Stringnone

Content

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

Example

Usage

@include b('list') {
    @include e('item') {
        @include at('inline') {
            color: black;
        }
    }
}

@include b('list') {
    @include e('item') {
        @include at('inline', 'inverse') {
            color: black;
        }
    }
}

Output

.list--inline .list__item {
    color: black;
}

.list--inline.list--inverse .list__item {
    color: black;
}

Requires

next

@mixin next($element) { ... }
View source

Description

Element with next element separated by plus sign.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$element

Name of element that will be styled with parent element.

Stringnone

Content

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

Example

Usage

@include b('list') {
    @include e('item') {
        @include next('title') {
            color: black;
        }
    }
}

Output

.list__item + .list__title {
    color: black;
}

Requires

duo

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

Description

Element with same element separated by plus sign.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include e('item') {
        @include duo {
            color: black;
        }
    }
}

Output

.list__item + .list__item {
    color: black;
}

Requires

with

@mixin with($element) { ... }
View source

Description

Element with sibling elements separated by equivalency sign.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$element

Name of element that will be styled with parent element.

Stringnone

Content

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

Example

Usage

@include b('list') {
    @include e('item') {
        @include with('title') {
            color: black;
        }
    }
}

Output

.list__item ~ .list__title {
    color: black;
}

Requires

while

@mixin while($modifier) { ... }
View source

Description

While two selectors are on same modifier.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$modifier

Name modifier that will follow parent modifier.

Stringnone

Content

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

Example

Usage

@include b('list') {
    @include m('inline') {
        @include while('ordered') {
            color: black;
        }
    }
}

Output

.list--inline.list--ordered {
    color: black;
}

Requires

scope (aliased as s )

@mixin scope($scope, $namespace: null) { ... }
View source

Description

Signify that a class creates a new styling context or Scope. Similar to a Theme, but not necessarily cosmetic, these should be used sparingly—they can be open to abuse and lead to poor CSS if not used wisely.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$scope

Name of scope that will come after ".s-"

Stringnone
$namespace

Scope element namespace.

Stringnull

Content

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

Example

Usage

@include scope('paper') {
    color: black;
}

@include s('paper') {
    color: black;
}

Output

.s-paper {
    color: black;
}

.s-paper {
    color: black;
}

Requires

Used by

  • [mixin] s

s (alias for scope)

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

Refer to scope.

state (aliased as is has js )

@mixin state($state, $namespace: null) { ... }
View source

Description

Signify that the piece of UI in question is currently styled a certain way because of a state or condition. This stateful namespace is gorgeous, and comes from SMACSS. It tells us that the DOM currently has a temporary, optional, or short-lived style applied to it due to a certain state being invoked.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$state

Name of state that will come after ".[is|has|js]-"

Stringnone
$namespace

State element namespace.

Stringnull

Content

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

Example

Usage

@include b('list') {
    @include state('active', 'is') {
        color: black;
    }
}

Output

.list.is-active {
    color: black;
}

Requires

Used by

is (alias for state)

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

Refer to state.

has (alias for state)

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

Refer to state.

js (alias for state)

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

Refer to state.

hover

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

Description

Pseudo selector with end of hover.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include hover {
        color: black;
    }
}

Output

.list:hover {
    color: black;
}

focus

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

Description

Pseudo selector with end of focus.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include focus {
        color: black;
    }
}

Output

.list:focus {
    color: black;
}

active

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

Description

Pseudo selector with end of active.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include active {
        color: black;
    }
}

Output

.list:active {
    color: black;
}

visited

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

Description

Pseudo selector with end of visited.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include visited {
        color: black;
    }
}

Output

.list:visited {
    color: black;
}

checked

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

Description

Pseudo selector with end of checked.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include checked {
        color: black;
    }
}

Output

.list:checked {
    color: black;
}

disabled

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

Description

Selector with state of disabled.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include disabled {
        color: black;
    }
}

Output

.list[disabled] {
    color: black;
}

readonly

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

Description

Selector with state of readonly.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include readonly {
        color: black;
    }
}

Output

.list[readonly] {
    color: black;
}

contenteditable (aliased as editable )

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

Description

Selector with state of contenteditable.

Parameters

None.

Content

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

Example

Usage

@include b('list') {
    @include contenteditable {
        color: black;
    }
}

Output

.list[contenteditable="true"] {
    color: black;
}

editable (alias for contenteditable)

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

Refer to contenteditable.

test (aliased as qa )

@mixin test($test, $namespace: null) { ... }
View source

Description

Signify that a QA or Test Engineering team is running an automated UI test which needs to find or bind onto these parts of the DOM. Like the JavaScript namespace, this basically just reserves hooks in the DOM for non-CSS purposes.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$test

Name of state that will come after ".[is|has|js]-"

Stringnone
$namespace

State element namespace.

Stringnull

Content

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

Example

Usage

@include test('list') {
    color: black;
}

@include qa('list') {
    color: black;
}

Output

.list.is-active {
    color: black;
}

.list.is-active {
    color: black;
}

Requires

Used by

  • [mixin] qa

qa (alias for test)

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

Refer to test.

theme (aliased as t )

@mixin theme($theme, $namespace: null) { ... }
View source

Description

Signify that a class is responsible for adding a Theme to a view. It lets us know that UI Components’ current cosmetic appearance may be due to the presence of a theme.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$theme

Name of theme that will come after ".t-"

Stringnone
$namespace

Theme element namespace.

Stringnull

Content

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

Example

Usage

@include theme('dark') {
    color: black;
}

@include t('dark') {
    color: black;
}

Output

.t-dark {
    color: black;
}

.t-dark {
    color: black;
}

Requires

Used by

  • [mixin] t

t (alias for theme)

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

Refer to theme.

utility (aliased as u )

@mixin utility($utility, $namespace: null) { ... }
View source

Description

Signify that this class is a Utility class. It has a very specific role (often providing only one declaration) and should not be bound onto or changed. It can be reused and is not tied to any specific piece of UI. You will probably recognise this namespace from libraries and methodologies like SUIT.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$utility

Name of utility that will come after ".u-"

Stringnone
$namespace

Utility element namespace.

Stringnull

Content

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

Example

Usage

@include utility('uppercase') {
    color: black;
}

@include u('uppercase') {
    color: black;
}

Output

.u-uppercase {
    color: black;
}

.u-uppercase {
    color: black;
}

Requires

Used by

  • [mixin] u

u (alias for utility)

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

Refer to utility.

variables

bem

$bem: (
	'debug': false,
	'separator': (
		'element': "__",
		'modifier': "--",
		'state': "-",
	),
	'namespace': (
		'component': "c",
		'hack': "_",
		'object': "o",
		'scope': "s",
		'test': "qa",
		'theme': "t",
		'utility': "u",
	),
	'shortcodes': (
		'ab': ('before', 'after')
	)
) !default;
View source

Description

Default sass-bem configuration settings.

Type

Map

Map structure

map keyNamemap keyDescriptionmap keyTypemap keyValue
debug

Turn debug mode on/off. To get outlines on selectors.

Booleanfalse
separator.element

Element separator from parent block.

String__
separator.modifier

Modifier separator from parent block.

String--
separator.state

States separator from parent block.

String-
namespace.component

Component selector namespace.

Stringc
namespace.hack

Hack selector namespace.

String_
namespace.object

Object selector namespace.

Stringo
namespace.scope

Scope selector namespace.

Strings
namespace.test

Test selector namespace.

Stringqa
namespace.theme

Theme selector namespace.

Stringt
namespace.utility

Utility selector namespace.

Stringu
shortcodes

Shortcodes list for parsing.

Listnone

bem-debug

$bem-debug: map-get($bem, 'debug') !default;
View source

Description

Turn debug mode on/off. To get outlines on selectors.

Type

Boolean

Used by

bem-element-separator

$bem-element-separator: map-get(map-get($bem, 'separator'), 'element') !default;
View source

Description

Element separator from parent block.

Type

String

Used by

bem-modifier-separator

$bem-modifier-separator: map-get(map-get($bem, 'separator'), 'modifier') !default;
View source

Description

Modifier separator from parent block.

Type

String

Used by

bem-state-separator

$bem-state-separator: map-get(map-get($bem, 'separator'), 'state') !default;
View source

Description

States separator from parent block.

Type

String

Used by

bem-component-namespace

$bem-component-namespace: map-get(map-get($bem, 'namespace'), 'component') !default;
View source

Description

Component selector namespace.

Type

String

bem-hack-namespace

$bem-hack-namespace: map-get(map-get($bem, 'namespace'), 'hack') !default;
View source

Description

Hack selector namespace.

Type

String

bem-object-namespace

$bem-object-namespace: map-get(map-get($bem, 'namespace'), 'object') !default;
View source

Description

Object selector namespace.

Type

String

bem-scope-namespace

$bem-scope-namespace: map-get(map-get($bem, 'namespace'), 'scope') !default;
View source

Description

Scope selector namespace.

Type

String

bem-test-namespace

$bem-test-namespace: map-get(map-get($bem, 'namespace'), 'test') !default;
View source

Description

Test selector namespace.

Type

String

bem-theme-namespace

$bem-theme-namespace: map-get(map-get($bem, 'namespace'), 'theme') !default;
View source

Description

Theme selector namespace.

Type

String

bem-utility-namespace

$bem-utility-namespace: map-get(map-get($bem, 'namespace'), 'utility') !default;
View source

Description

Utility selector namespace.

Type

String

bem-shortcodes

$bem-shortcodes: map-get($bem, 'shortcodes') !default;
View source

Description

Shortcodes list for parsing.

Type

List

Used by