sass-bem
functions
[private] bem-index
@function bem-index($string) { ... }
View sourceDescription
Get index of separator.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$string | Name of selector, where we should find separator | String | —none |
Returns
Number
—Index of separators
Requires
- [function]
math-min
- [variable]
bem-element-separator
- [variable]
bem-modifier-separator
Used by
- [function]
get-block
[private] block-selector (aliased as b-selector
)
@function block-selector($block) { ... }
View sourceDescription
Selector of block.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$block | Name of block that will come after "." | String | —none |
Returns
String
—.[block]
Used by
- [function]
b-selector
- [mixin]
block
See
- [mixin]
block
b-selector (alias for block-selector
)
@function b-selector() { ... }
View sourceRefer to block-selector.
[private] component-selector (aliased as c-selector
)
@function component-selector($component, $namespace) { ... }
View sourceDescription
Selector of component.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$component | Name of component that will come after ".c-" | String | —none |
$namespace | Namespace of component. | String | —none |
Returns
String
—.c-[component]
Used by
- [function]
c-selector
- [mixin]
component
See
- [mixin]
component
c-selector (alias for component-selector
)
@function c-selector() { ... }
View sourceRefer to component-selector.
[private] element-selector (aliased as e-selector
ee-selector
)
@function element-selector($element, $nested: false) { ... }
View sourceDescription
Selector of element.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$element | Name of element that will come after ".[block]__" | String | —none |
$nested | If element is nested with another element | Boolean | false |
Returns
String
—.[block]__[element]
Requires
- [function]
is-block
- [function]
get-block
- [variable]
bem-element-separator
Used by
- [function]
e-selector
- [function]
ee-selector
- [mixin]
element
See
- [mixin]
element
e-selector (alias for element-selector
)
@function e-selector() { ... }
View sourceRefer to element-selector.
ee-selector (alias for element-selector
)
@function ee-selector() { ... }
View sourceRefer to element-selector.
[private] explode
@function explode($string, $separator) { ... }
View sourceDescription
Explode string to get list of strings.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$string | String which should be exploded | String | —none |
$separator | Separator which will explode string to pieces | String | —none |
Returns
List
—List of exploded string
Used by
- [mixin]
parse
- [function]
duo-selector
[private] get-block
@function get-block($selector) { ... }
View sourceDescription
Get block element from selector.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | Selector, from where we will take block | String | —none |
Returns
String
—Block element
Requires
Used by
- [function]
element-selector
- [function]
at-selector
- [function]
next-selector
- [function]
with-selector
- [function]
while-selector
[private] hack-selector (aliased as _-selector
)
@function hack-selector($hack, $namespace) { ... }
View sourceDescription
Selector of hack.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$hack | Name of hack that will come after "._" | String | —none |
$namespace | Namespace of hack. | String | —none |
Returns
String
—._[hack]
Used by
- [function]
_-selector
- [mixin]
hack
See
- [mixin]
hack
[private] _-selector (alias for hack-selector
)
@function _-selector() { ... }
View sourceRefer to hack-selector.
[private] has-pseudo
@function has-pseudo($selector) { ... }
View sourceDescription
Check if selector contains pseudo element.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | Selector, which we will check for pseudo | String | —none |
Returns
Boolean
Used by
- [function]
is-block
[private] has-state
@function has-state($selector) { ... }
View sourceDescription
Check if selector contains state.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | Selector, which we will check for state | String | —none |
Returns
Boolean
Requires
- [variable]
bem-state-separator
Used by
- [function]
is-block
[private] implode
@function implode($list, $glue: '', $is-nested) { ... }
View sourceDescription
Implode list to get string.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$list | List which will be imploded | List | —none |
$glue | Separator which will glue list | String | '' |
$is-nested | List is nested or not | Boolean | —none |
Returns
String
—Imploded list
Used by
- [mixin]
parse
- [function]
at-selector
[private] is-block
@function is-block($selector) { ... }
View sourceDescription
Check if selector is block.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | Selector, which we will check for block | String | —none |
Returns
Boolean
Requires
- [function]
is-element
- [function]
is-modifier
- [function]
has-state
- [function]
has-pseudo
Used by
- [function]
element-selector
- [function]
get-block
[private] is-element
@function is-element($selector) { ... }
View sourceDescription
Check if selector is element.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | Selector, which we will check for element | String | —none |
Returns
Boolean
Requires
- [variable]
bem-element-separator
Used by
- [function]
is-block
[private] is-modifier
@function is-modifier($selector) { ... }
View sourceDescription
Check if selector is modifier.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | Selector, which we will check for modifier | String | —none |
Returns
Boolean
Requires
- [variable]
bem-modifier-separator
Used by
- [function]
is-block
[private] math-min
@function math-min($a, $n, $default: 0) { ... }
View sourceDescription
Get minimum number from two of them, or get default.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$a | First number to be checked | String | —none |
$n | Second number to be checked | String | —none |
$default | Default number to be returned if min wasn't found | String | 0 |
Returns
Number
—Minimum number from two of them
Used by
- [function]
bem-index
[private] modifier-selector (aliased as m-selector
)
@function modifier-selector($modifier) { ... }
View sourceDescription
Selector of modifier.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$modifier | Name of modifier that will come after ".[block]--" | String | —none |
Returns
String
—.[block]--[modifier]
Requires
- [variable]
bem-modifier-separator
Used by
- [function]
m-selector
- [mixin]
modifier
See
- [mixin]
modifier
m-selector (alias for modifier-selector
)
@function m-selector() { ... }
View sourceRefer to modifier-selector.
[private] object-selector (aliased as o-selector
)
@function object-selector($object, $namespace) { ... }
View sourceDescription
Selector of object.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$object | Name of object that will come after ".o-" | String | —none |
$namespace | Namespace of object. | String | —none |
Returns
String
—.o-[object]
Used by
- [function]
o-selector
- [mixin]
object
See
- [mixin]
object
o-selector (alias for object-selector
)
@function o-selector() { ... }
View sourceRefer to object-selector.
[private] first-selector
@function first-selector() { ... }
View sourceDescription
Pseudo selector with end of first-of-type.
Parameters
None.
Returns
String
—&:first-of-type
See
- [mixin]
first
[private] last-selector
@function last-selector() { ... }
View sourceDescription
Pseudo selector with end of last-of-type.
Parameters
None.
Returns
String
—&:last-of-type
See
- [mixin]
last
[private] even-selector
@function even-selector() { ... }
View sourceDescription
Pseudo selector with end of nth-child(even).
Parameters
None.
Returns
String
—&:nth-child(even)
See
- [mixin]
even
[private] odd-selector
@function odd-selector() { ... }
View sourceDescription
Pseudo selector with end of nth-child(odd).
Parameters
None.
Returns
String
—&:nth-child(odd)
See
- [mixin]
odd
[private] before-selector
@function before-selector() { ... }
View sourceDescription
Pseudo selector with end of before.
Parameters
None.
Returns
String
—&::before
See
- [mixin]
before
[private] after-selector
@function after-selector() { ... }
View sourceDescription
Pseudo selector with end of after.
Parameters
None.
Returns
String
—&::after
See
- [mixin]
after
at-selector
@function at-selector($modifier) { ... }
View sourceDescription
Selector(s) of at relationship.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$modifier | List of modifier that will come after ".[block]--" | String | —none |
Returns
String
—.[block]--[modifier]
Requires
- [function]
get-block
- [function]
implode
- [variable]
bem-modifier-separator
Used by
- [mixin]
at
See
- [mixin]
at
next-selector
@function next-selector($element) { ... }
View sourceDescription
Selector of adjacent relationship.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$element | Name of element that will come after ".[block]__" | String | —none |
Returns
String
—& + .[block]__[element]
Requires
- [function]
get-block
- [variable]
bem-element-separator
Used by
- [mixin]
next
See
- [mixin]
next
duo-selector
@function duo-selector() { ... }
View sourceDescription
Selector of duo relationship.
Parameters
None.
Returns
String
—& + &
Requires
- [function]
explode
Used by
- [mixin]
duo
See
- [mixin]
duo
with-selector
@function with-selector($element) { ... }
View sourceDescription
Selector of sibling relationship.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$element | Name of element that will come after ".[block]__" | String | —none |
Returns
String
—& ~ .[block]__[element]
Requires
- [function]
get-block
- [variable]
bem-element-separator
Used by
- [mixin]
with
See
- [mixin]
with
while-selector
@function while-selector($modifier) { ... }
View sourceDescription
Selector(s) of while relationship.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$modifier | List of modifiers that will come after ".[block]--" | String | —none |
Returns
String
—.[block]--[modifier]
Requires
- [function]
get-block
- [variable]
bem-modifier-separator
Used by
- [mixin]
while
See
- [mixin]
while
[private] scope-selector (aliased as s-selector
)
@function scope-selector($scope, $namespace) { ... }
View sourceDescription
Selector of scope.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$scope | Name of scope that will come after ".s-" | String | —none |
$namespace | Namespace of scope. | String | —none |
Returns
String
—.s-[scope]
Used by
- [function]
s-selector
- [mixin]
scope
See
- [mixin]
scope
s-selector (alias for scope-selector
)
@function s-selector() { ... }
View sourceRefer to scope-selector.
[private] splice
@function splice($list, $value, $recursive: false) { ... }
View sourceDescription
Unset item from list.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$list | List from where will be removed | List | —none |
$value | What to be removed | String | —none |
$recursive | List is nested or not | Boolean | false |
Returns
List
Used by
- [mixin]
parse
[private] state-selector (aliased as is-selector
has-selector
js-selector
)
@function state-selector($state, $namespace: null) { ... }
View sourceDescription
Selector of state.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$state | Name of state that will come after ".[is|has|js]-" | String | —none |
$namespace | Namespace of state. [is|has|js] | String | null |
Returns
String
—.[is|has|js]-[state]
Used by
- [function]
is-selector
- [function]
has-selector
- [function]
js-selector
- [mixin]
state
See
- [mixin]
state
is-selector (alias for state-selector
)
@function is-selector() { ... }
View sourceRefer to state-selector.
has-selector (alias for state-selector
)
@function has-selector() { ... }
View sourceRefer to state-selector.
js-selector (alias for state-selector
)
@function js-selector() { ... }
View sourceRefer to state-selector.
[private] hover-selector
@function hover-selector() { ... }
View sourceDescription
Pseudo selector with end of hover.
Parameters
None.
Returns
String
—&:hover
See
- [mixin]
hover
[private] focus-selector
@function focus-selector() { ... }
View sourceDescription
Pseudo selector with end of focus.
Parameters
None.
Returns
String
—&:focus
See
- [mixin]
focus
[private] active-selector
@function active-selector() { ... }
View sourceDescription
Pseudo selector with end of active.
Parameters
None.
Returns
String
—&:active
See
- [mixin]
active
[private] link-selector
@function link-selector() { ... }
View sourceDescription
Pseudo selector with end of link.
Parameters
None.
Returns
String
—&:link
See
- [mixin]
link
[private] visited-selector
@function visited-selector() { ... }
View sourceDescription
Pseudo selector with end of visited.
Parameters
None.
Returns
String
—&:visited
See
- [mixin]
visited
[private] checked-selector
@function checked-selector() { ... }
View sourceDescription
Pseudo selector with end of checked.
Parameters
None.
Returns
String
—&:checked
See
- [mixin]
checked
[private] disabled-selector
@function disabled-selector() { ... }
View sourceDescription
Selector with state of disabled.
Parameters
None.
Returns
String
—&[disabled]
See
- [mixin]
disabled
[private] readonly-selector
@function readonly-selector() { ... }
View sourceDescription
Selector with state of readonly.
Parameters
None.
Returns
String
—&[readonly]
See
- [mixin]
readonly
[private] contenteditable-selector (aliased as editable-selector
)
@function contenteditable-selector() { ... }
View sourceDescription
Selector with state of contenteditable.
Parameters
None.
Returns
String
—&[contenteditable='true']
Used by
- [function]
editable-selector
See
- [mixin]
contenteditable
editable-selector (alias for contenteditable-selector
)
@function editable-selector() { ... }
View sourceRefer to contenteditable-selector.
[private] str-replace
@function str-replace($string, $search, $replace: '') { ... }
View sourceDescription
Replace string with another string.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$string | String from which will be replaced | String | —none |
$search | String which will be removed | String | —none |
$replace | String which will be placed | String | '' |
Returns
String
Used by
- [mixin]
parse
[private] test-selector (aliased as qa-selector
)
@function test-selector($test, $namespace) { ... }
View sourceDescription
Selector of test.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$test | Name of test that will come after ".qa-" | String | —none |
$namespace | Namespace of test. | String | —none |
Returns
String
—.qa-[test]
Used by
- [function]
qa-selector
- [mixin]
test
See
- [mixin]
test
qa-selector (alias for test-selector
)
@function qa-selector() { ... }
View sourceRefer to test-selector.
[private] theme-selector (aliased as t-selector
)
@function theme-selector($theme, $namespace) { ... }
View sourceDescription
Selector of theme.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$theme | Name of theme that will come after ".t-" | String | —none |
$namespace | Namespace of theme. | String | —none |
Returns
String
—.t-[theme]
Used by
- [function]
t-selector
- [mixin]
theme
See
- [mixin]
theme
t-selector (alias for theme-selector
)
@function t-selector() { ... }
View sourceRefer to theme-selector.
[private] utility-selector (aliased as u-selector
)
@function utility-selector($utility, $namespace) { ... }
View sourceDescription
Selector of utility.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$utility | Name of utility that will come after ".u-" | String | —none |
$namespace | Namespace of utility. | String | —none |
Returns
String
—.u-[utility]
Used by
- [function]
u-selector
- [mixin]
utility
See
- [mixin]
utility
u-selector (alias for utility-selector
)
@function u-selector() { ... }
View sourceRefer to utility-selector.
mixins
block (aliased as b
)
@mixin block($block) { ... }
View sourceDescription
Block selector that will be parent of some elements, modifiers, states...
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$block | Name of block that will come after "." | String | —none |
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
- [function]
block-selector
- [variable]
bem-debug
Used by
- [mixin]
b
b (alias for block
)
@mixin b() { ... }
View sourceRefer to block.
component (aliased as c
)
@mixin component($component, $namespace: null) { ... }
View sourceDescription
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
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$component | Name of component that will come after ".c-" | String | —none |
$namespace | Component element namespace. | String | null |
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
- [function]
component-selector
- [variable]
bem-debug
Used by
- [mixin]
c
c (alias for component
)
@mixin c() { ... }
View sourceRefer to component.
element (aliased as e
ee
)
@mixin element($element, $nested: false) { ... }
View sourceDescription
Element selector, that is generated from parent block
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$element | Name of element that will come after ".[block]__" | String | —none |
$nested | If element is nested with other element | Boolean | false |
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
- [function]
element-selector
- [variable]
bem-debug
Used by
e (alias for element
)
@mixin e() { ... }
View sourceRefer to element.
ee (alias for element
)
@mixin ee() { ... }
View sourceRefer to element.
hack (aliased as _
)
@mixin hack($hack, $namespace: null) { ... }
View sourceDescription
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
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$hack | Name of hack that will come after "._" | String | —none |
$namespace | Hack element namespace. | String | null |
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
- [function]
hack-selector
- [variable]
bem-debug
Used by
- [mixin]
_
[private] _ (alias for hack
)
@mixin _() { ... }
View sourceRefer to hack.
modifier (aliased as m
)
@mixin modifier($modifier) { ... }
View sourceDescription
Modifier selector, that is generated from parent block.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$modifier | Name of modifier that will come after ".[block]--" | String | —none |
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
- [function]
modifier-selector
- [variable]
bem-debug
Used by
- [mixin]
m
m (alias for modifier
)
@mixin m() { ... }
View sourceRefer to modifier.
object (aliased as o
)
@mixin object($object, $namespace: null) { ... }
View sourceDescription
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
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$object | Name of object that will come after ".o-" | String | —none |
$namespace | Object element namespace. | String | null |
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
- [function]
object-selector
- [variable]
bem-debug
Used by
- [mixin]
o
o (alias for object
)
@mixin o() { ... }
View sourceRefer to object.
parse (aliased as p
)
@mixin parse($selectors) { ... }
View sourceDescription
Parse multiple mixins, pseudo elements and other states.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selectors | List or String of arguments, to generate selector. | String or List | —none |
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
- [function]
splice
- [function]
explode
- [function]
str-replace
- [function]
implode
- [variable]
bem-shortcodes
Used by
- [mixin]
p
p (alias for parse
)
@mixin p() { ... }
View sourceRefer to parse.
first
@mixin first() { ... }
View sourceDescription
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 sourceDescription
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 sourceDescription
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 sourceDescription
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 sourceDescription
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 sourceDescription
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 sourceDescription
Relationship of parent element with current modifiers.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$modifiers | List of modifiers that will make parent element child. | String | —none |
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
- [function]
at-selector
next
@mixin next($element) { ... }
View sourceDescription
Element with next element separated by plus sign.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$element | Name of element that will be styled with parent element. | String | —none |
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
- [function]
next-selector
duo
@mixin duo() { ... }
View sourceDescription
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
- [function]
duo-selector
with
@mixin with($element) { ... }
View sourceDescription
Element with sibling elements separated by equivalency sign.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$element | Name of element that will be styled with parent element. | String | —none |
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
- [function]
with-selector
while
@mixin while($modifier) { ... }
View sourceDescription
While two selectors are on same modifier.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$modifier | Name modifier that will follow parent modifier. | String | —none |
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
- [function]
while-selector
scope (aliased as s
)
@mixin scope($scope, $namespace: null) { ... }
View sourceDescription
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
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$scope | Name of scope that will come after ".s-" | String | —none |
$namespace | Scope element namespace. | String | null |
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
- [function]
scope-selector
- [variable]
bem-debug
Used by
- [mixin]
s
s (alias for scope
)
@mixin s() { ... }
View sourceRefer to scope.
state (aliased as is
has
js
)
@mixin state($state, $namespace: null) { ... }
View sourceDescription
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
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$state | Name of state that will come after ".[is|has|js]-" | String | —none |
$namespace | State element namespace. | String | null |
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
- [function]
state-selector
- [variable]
bem-debug
Used by
is (alias for state
)
@mixin is() { ... }
View sourceRefer to state.
has (alias for state
)
@mixin has() { ... }
View sourceRefer to state.
js (alias for state
)
@mixin js() { ... }
View sourceRefer to state.
hover
@mixin hover() { ... }
View sourceDescription
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 sourceDescription
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 sourceDescription
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;
}
link
@mixin link() { ... }
View sourceDescription
Pseudo selector with end of link.
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Usage
@include b('list') {
@include link {
color: black;
}
}
Output
.list:link {
color: black;
}
visited
@mixin visited() { ... }
View sourceDescription
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 sourceDescription
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 sourceDescription
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 sourceDescription
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 sourceDescription
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 sourceRefer to contenteditable.
test (aliased as qa
)
@mixin test($test, $namespace: null) { ... }
View sourceDescription
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
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$test | Name of state that will come after ".[is|has|js]-" | String | —none |
$namespace | State element namespace. | String | null |
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
- [function]
test-selector
- [variable]
bem-debug
Used by
- [mixin]
qa
qa (alias for test
)
@mixin qa() { ... }
View sourceRefer to test.
theme (aliased as t
)
@mixin theme($theme, $namespace: null) { ... }
View sourceDescription
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
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$theme | Name of theme that will come after ".t-" | String | —none |
$namespace | Theme element namespace. | String | null |
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
- [function]
theme-selector
- [variable]
bem-debug
Used by
- [mixin]
t
t (alias for theme
)
@mixin t() { ... }
View sourceRefer to theme.
utility (aliased as u
)
@mixin utility($utility, $namespace: null) { ... }
View sourceDescription
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
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$utility | Name of utility that will come after ".u-" | String | —none |
$namespace | Utility element namespace. | String | null |
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
- [function]
utility-selector
- [variable]
bem-debug
Used by
- [mixin]
u
u (alias for utility
)
@mixin u() { ... }
View sourceRefer 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 sourceDescription
Default sass-bem configuration settings.
Type
Map
Map structure
map keyName | map keyDescription | map keyType | map keyValue |
---|---|---|---|
debug | Turn debug mode on/off. To get outlines on selectors. | Boolean | false |
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. | String | c |
namespace.hack | Hack selector namespace. | String | _ |
namespace.object | Object selector namespace. | String | o |
namespace.scope | Scope selector namespace. | String | s |
namespace.test | Test selector namespace. | String | qa |
namespace.theme | Theme selector namespace. | String | t |
namespace.utility | Utility selector namespace. | String | u |
shortcodes | Shortcodes list for parsing. | List | —none |
bem-debug
$bem-debug: map-get($bem, 'debug') !default;
View sourceDescription
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 sourceDescription
Element separator from parent block.
Type
String
Used by
- [function]
bem-index
- [function]
element-selector
- [function]
is-element
- [function]
next-selector
- [function]
with-selector
bem-modifier-separator
$bem-modifier-separator: map-get(map-get($bem, 'separator'), 'modifier') !default;
View sourceDescription
Modifier separator from parent block.
Type
String
Used by
- [function]
bem-index
- [function]
is-modifier
- [function]
modifier-selector
- [function]
at-selector
- [function]
while-selector
bem-state-separator
$bem-state-separator: map-get(map-get($bem, 'separator'), 'state') !default;
View sourceDescription
States separator from parent block.
Type
String
Used by
- [function]
has-state
bem-component-namespace
$bem-component-namespace: map-get(map-get($bem, 'namespace'), 'component') !default;
View sourceDescription
Component selector namespace.
Type
String
bem-hack-namespace
$bem-hack-namespace: map-get(map-get($bem, 'namespace'), 'hack') !default;
View sourceDescription
Hack selector namespace.
Type
String
bem-object-namespace
$bem-object-namespace: map-get(map-get($bem, 'namespace'), 'object') !default;
View sourceDescription
Object selector namespace.
Type
String
bem-scope-namespace
$bem-scope-namespace: map-get(map-get($bem, 'namespace'), 'scope') !default;
View sourceDescription
Scope selector namespace.
Type
String
bem-test-namespace
$bem-test-namespace: map-get(map-get($bem, 'namespace'), 'test') !default;
View sourceDescription
Test selector namespace.
Type
String
bem-theme-namespace
$bem-theme-namespace: map-get(map-get($bem, 'namespace'), 'theme') !default;
View sourceDescription
Theme selector namespace.
Type
String
bem-utility-namespace
$bem-utility-namespace: map-get(map-get($bem, 'namespace'), 'utility') !default;
View sourceDescription
Utility selector namespace.
Type
String
bem-shortcodes
$bem-shortcodes: map-get($bem, 'shortcodes') !default;
View sourceDescription
Shortcodes list for parsing.
Type
List
Used by
- [mixin]
parse