background gradients
variables
ig-easing-gradient-steps
$ig-easing-gradient-steps: 10 !default;
Description
Number of intermediate color stops generated to achieve easing. A higher value results in better quality, but also much more generated code.
Type
Number
Used by
- [function]
ig-easing-gradient-bezier-stops
- [function]
ig-easing-gradient-bezier-stops
- [function]
ig-easing-gradient-bezier-stops
- [function]
ig-easing-gradient-bezier-stops
functions
ig-easing-gradient
@function ig-easing-gradient($type, $dir, $stop, $stops...) { ... }
Description
Generate a new easing background gradient. This function is intended to be as similar as possible to the newly proposed syntax for linear-gradient and radial-gradient which includes easing hints.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$type | Either 'linear' or 'radial', which means the gradient will be either a linear-gradient or a radial-gradient. | String | — none |
$dir | The direction of the gradient. Depending on $type, this value must be a valid direction for linear-gradient or radial-gradient. | String | — none |
$stop | A color stop as used for linear-gradient or radial-gradient. | Color or List | — none |
$stops | More color stops as used for linear-gradient or radial-gradient. Between two color stops, you may also define an easing hint such as | Arglist | — none |
Returns
String
—A linear-gradient or radial-gradient with an alternative transitioning behavior.
Example
A smoother linear gradient
.background {
background-image: ig-easing-gradient(
linear,
to top,
#000,
in-out-sine,
transparent
);
}
// Generates:
.background {
background-image: linear-gradient(
to top,
black 0%,
rgba(0, 0, 0, 0.975528) 10%,
rgba(0, 0, 0, 0.904508) 20%,
rgba(0, 0, 0, 0.793893) 30%,
rgba(0, 0, 0, 0.654508) 40%,
rgba(0, 0, 0, 0.5) 50%,
rgba(0, 0, 0, 0.345492) 60%,
rgba(0, 0, 0, 0.206107) 70%,
rgba(0, 0, 0, 0.0954915) 80%,
rgba(0, 0, 0, 0.0244717) 90%,
rgba(0, 0, 0, 3.78257e-11) 100%
);
}
A smoother radial gradient
.background {
background-image: ig-easing-gradient(
radial,
50em 16em at 0 0,
#000,
in-out-sine,
transparent
);
}
// Generates:
.background {
background-image: radial-gradient(
50em 16em at 0 0,
black 0%,
rgba(0, 0, 0, 0.975528) 10%,
rgba(0, 0, 0, 0.904508) 20%,
rgba(0, 0, 0, 0.793893) 30%,
rgba(0, 0, 0, 0.654508) 40%,
rgba(0, 0, 0, 0.5) 50%,
rgba(0, 0, 0, 0.345492) 60%,
rgba(0, 0, 0, 0.206107) 70%,
rgba(0, 0, 0, 0.0954915) 80%,
rgba(0, 0, 0, 0.0244717) 90%,
rgba(0, 0, 0, 3.78257e-11) 100%
);
}
A smoother linear gradient with complex color positions
.background {
background-image: ig-easing-gradient(
linear,
to top,
#000 20%,
in-out-sine,
transparent calc(20% + 25em)
);
}
// Generates:
.background {
background-image: linear-gradient(
to top,
black 20%,
rgba(0, 0, 0, 0.975528) calc(20% + (20% + 25em - 20%) * 0.1),
rgba(0, 0, 0, 0.904508) calc(20% + (20% + 25em - 20%) * 0.2),
rgba(0, 0, 0, 0.793893) calc(20% + (20% + 25em - 20%) * 0.3),
rgba(0, 0, 0, 0.654508) calc(20% + (20% + 25em - 20%) * 0.4),
rgba(0, 0, 0, 0.5) calc(20% + (20% + 25em - 20%) * 0.5),
rgba(0, 0, 0, 0.345492) calc(20% + (20% + 25em - 20%) * 0.6),
rgba(0, 0, 0, 0.206107) calc(20% + (20% + 25em - 20%) * 0.7),
rgba(0, 0, 0, 0.0954915) calc(20% + (20% + 25em - 20%) * 0.8),
rgba(0, 0, 0, 0.0244717) calc(20% + (20% + 25em - 20%) * 0.9),
transparent calc(20% + 25em))
);
}
Throws
The first color stop argument must be a color stop.
The last color stop argument must be a color stop.
There can be at most one interpolation hint between to color stops.
Midpoint shifts are not supported.
Invalid gradient type: #{inspect($type)}.
Requires
- [function]
ig-list-prepend
- [function]
ig-easing-gradient-is-color-stop
- [function]
ig-str-implode
- [function]
ig-easing-gradient-is-positioned-color-stop
- [function]
ig-easing-gradient-is-color-stop
- [function]
ig-easing-gradient-interpolate-stop-positions
- [function]
ig-list-slice
- [function]
ig-list-slice
- [function]
ig-list-slice
- [function]
ig-easing-gradient-is-color-stop
- [function]
ig-easing-gradient-is-color-stop
- [function]
ig-list-slice
- [function]
ig-easing-gradient-ease-stops
- [function]
ig-str-implode
- [function]
ig-str-implode
- [function]
ig-str-implode
Used by
- [function]
ig-easing-linear-gradient
- [function]
ig-easing-radial-gradient
Links
ig-easing-linear-gradient
@function ig-easing-linear-gradient() { ... }
Description
Alias for ig-easing-gradient('linear',...)
Parameters
None.
Requires
- [function]
ig-easing-gradient
See
- [function]
ig-easing-gradient
ig-easing-radial-gradient
@function ig-easing-radial-gradient() { ... }
Description
Alias for ig-easing-gradient('radial',...)
Parameters
None.
Requires
- [function]
ig-easing-gradient
See
- [function]
ig-easing-gradient
[private] ig-easing-gradient-ease-stops
@function ig-easing-gradient-ease-stops() { ... }
Description
Generate a smooth transition from one color stop to another using the provided easing function.
Parameters
None.
Requires
- [function]
ig-easing-gradient-steps-stops
- [function]
ig-easing-gradient-bezier-stops
Used by
- [function]
ig-easing-gradient
[private] ig-easing-gradient-bezier-stops
@function ig-easing-gradient-bezier-stops() { ... }
Description
Generate a smooth transition from one color stop to another using the provided cubic-bezier function.
Parameters
None.
Throws
Invalid color stop position: #{inspect($prev-stop-pos)}
Invalid color stop position: #{inspect($next-stop-pos)}
Requires
- [variable]
ig-easing-gradient-steps
- [variable]
ig-easing-gradient-steps
- [variable]
ig-easing-gradient-steps
- [variable]
ig-easing-gradient-steps
Used by
- [function]
ig-easing-gradient-ease-stops
[private] ig-easing-gradient-steps-stops
@function ig-easing-gradient-steps-stops() { ... }
Description
Generate a step transition from one color stop to another.
Parameters
None.
Throws
Invalid $jump: #{inspect($jump)}
Invalid color stop position: #{inspect($prev-stop-pos)}
Invalid color stop position: #{inspect($next-stop-pos)}
Used by
- [function]
ig-easing-gradient-ease-stops
[private] ig-easing-gradient-interpolate-stop-positions
@function ig-easing-gradient-interpolate-stop-positions() { ... }
Description
Interpolate the positions of multiple color stops between two color stops whose positions are set.
Parameters
None.
Throws
Invalid color stop position: #{inspect($prev-stop-pos)}
Invalid color stop position: #{inspect($next-stop-pos)}
Requires
- [function]
ig-easing-gradient-is-color-stop
- [function]
ig-easing-gradient-is-color-stop
- [function]
ig-easing-gradient-is-color-stop
Used by
- [function]
ig-easing-gradient
[private] ig-easing-gradient-is-color-stop
@function ig-easing-gradient-is-color-stop() { ... }
Description
Check if the input is a valid color stop.
Parameters
None.
Requires
- [function]
ig-easing-gradient-is-positioned-color-stop
Used by
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient-interpolate-stop-positions
- [function]
ig-easing-gradient-interpolate-stop-positions
- [function]
ig-easing-gradient-interpolate-stop-positions
[private] ig-easing-gradient-is-positioned-color-stop
@function ig-easing-gradient-is-positioned-color-stop() { ... }
Description
Check if the input is a valid positioned color stop.
Parameters
None.
Used by
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient-is-color-stop
bem
mixins
ig-bem-block
@mixin ig-bem-block($name, $type: null) { ... }
Description
Generate a new block.
This mixin simply creates a new block with the name {namespace}_{name}, where {namespace} is the prefix assigned to $type and {name} is the block's name.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Block name | String | — none |
$type | BEMIT namespace of the block | String | null |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Creating a new block
@include ig-bem-block('something', 'component') {
/* some definitions */
}
// Generates:
.c-something {
/* some definitions */
}
Throws
If $type is invalid
If the block is preceded by another block, element, modifier or suffix
Requires
- [mixin]
ig-bem-validate
- [mixin]
ig-context-push
- [mixin]
ig-context-pop
- [function]
ig-bem-block
- [variable]
ig-bem-blocks
- [variable]
ig-bem-blocks
- [variable]
ig-bem-blocks
- [variable]
ig-bem-blocks
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
Used by
- [mixin]
ig-bem-object
- [mixin]
ig-bem-component
- [mixin]
ig-bem-layout
- [mixin]
ig-bem-utility
- [mixin]
ig-bem-scope
- [mixin]
ig-bem-theme
- [mixin]
ig-bem-js
- [mixin]
ig-bem-qa
- [mixin]
ig-bem-hack
ig-bem-object
@mixin ig-bem-object($name) { ... }
Description
Generate a new object block. It's a shorthand for ig-bem-block($name, 'object').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Object block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-component
@mixin ig-bem-component($name) { ... }
Description
Generate a new component block. It's a shorthand for ig-bem-block($name, 'component').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Component block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-layout
@mixin ig-bem-layout($name) { ... }
Description
Generate a new layout block. It's a shorthand for ig-bem-block($name, 'layout').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Layout block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-utility
@mixin ig-bem-utility($name) { ... }
Description
Generate a new utility block. It's a shorthand for ig-bem-block($name, 'utility').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Utility block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-scope
@mixin ig-bem-scope($name) { ... }
Description
Generate a new scope block. It's a shorthand for ig-bem-block($name, 'scope').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Scope block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-theme
@mixin ig-bem-theme($name) { ... }
Description
Generate a new theme block. It's a shorthand for ig-bem-block($name, 'theme').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Theme block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-js
@mixin ig-bem-js($name) { ... }
Description
Generate a new JS block. It's a shorthand for ig-bem-block($name, 'js').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | JS block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-qa
@mixin ig-bem-qa($name) { ... }
Description
Generate a new QA block. It's a shorthand for ig-bem-block($name, 'qa').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | QA block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-hack
@mixin ig-bem-hack($name) { ... }
Description
Generate a new hack block. It's a shorthand for ig-bem-block($name, 'hack').
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Hack block name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-block
ig-bem-composed-of
@mixin ig-bem-composed-of($block, $blocks) { ... }
Description
Assert that a block or element is composed of another block. In BEM, such a relationship is referred to as a "mix": https://en.bem.info/methodology/key-concepts/#mix
Compilation will fail if the foreign block doesn't exist. This way, you can ensure that blocks are defined in the right order so that composed blocks/elements will actually override the foreign declarations without having to artificially increase the specificity.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$block | Either first block name, or list with two items: 1. block name, 2. block type | String or List | — none |
$blocks | Either other block names, or list with two items: 1. block name, 2. block type | String or List | — none |
Example
Successful assertion
@include ig-bem-component('someBlock') {
/* some definitions */
}
@include ig-bem-component('anotherBlock') {
/* some definitions */
@include ig-bem-element('elem') {
@include ig-bem-composed-of('someBlock' 'component');
/* some definitions */
}
}
// Intended use: <div class="c-anotherBlock__elem c-someBlock">...</div>
Failing assertion
@include ig-bem-component('anotherBlock') {
/* some definitions */
@include ig-bem-element('elem') {
@include ig-bem-composed-of('someBlock' 'component');
/* some definitions */
}
}
@include ig-bem-component('someBlock') {
/* some definitions */
}
// Compilation will fail because c-someBlock is defined after c-anotherBlock__elem
Throws
Block
Requires
- [function]
ig-list-prepend
- [variable]
ig-bem-blocks
- [variable]
ig-bem-namespaces
- [variable]
ig-bem-blocks
ig-bem-element
@mixin ig-bem-element($name, $names) { ... }
Description
Generate a new BEM element.
The element will be generated according to the BEM naming convention. If the parent selector doesn't match the block selector, the element will be nested inside the parent selector. This means, you may nest elements inside other elements, modifiers or any kind of selector such as &:hover.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | First element name | String | — none |
$names | More element names | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Element for a block
@include ig-bem-component('block') {
/* some block definitions */
@include ig-bem-element('elem') {
/* some element definitions */
}
}
// Generates:
.c-block {
/* some block definitions */
}
.c-block__elem {
/* some element definitions */
}
Element that is affected by the user hovering the block
@include ig-bem-component('block') {
/* some block definitions */
@include ig-bem-element('elem') {
background-color: #eee;
}
&:hover {
@include ig-bem-element('elem') {
background-color: #000;
}
}
}
// Generates:
.c-block {
/* some block definitions */
}
.c-block__elem {
background-color: #eee;
}
.c-block:hover .c-block__elem {
background-color: #000;
}
Multiple elements
@include ig-bem-component('block') {
/* some block definitions */
@include ig-bem-element('elem1', 'elem2') {
/* some element definitions */
}
}
// Generates:
.c-block {
/* some block definitions */
}
.c-block__elem1, .c-block__elem2 {
/* some element definitions */
}
Throws
If the element is not preceded by a block, element, modifier or suffix.
Requires
- [mixin]
ig-bem-validate
- [mixin]
ig-context-push
- [mixin]
ig-context-pop
- [function]
ig-bem-element
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
ig-bem-sibling-element
@mixin ig-bem-sibling-element($name, $names) { ... }
Description
Generate a BEM element that is a sibling of the current element.
It's a shorthand for ig-bem-related-element('~', $name).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | First element name | String | — none |
$names | List of more element names | List | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-related-element
ig-bem-next-element
@mixin ig-bem-next-element($name, $names) { ... }
Description
Generate a BEM element that is the successor of the current element.
It's a shorthand for ig-bem-related-element('+', $name).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | First element name | String | — none |
$names | More element names | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-related-element
ig-bem-next-twin-element
@mixin ig-bem-next-twin-element() { ... }
Description
Generate the current BEM element as a successor of itself.
If this is applied to a single element, it behaves exactly the same as ig-bem-related-element('+', name); However, if it is applied to multiple elements, each twin element only will influence their other twin, which is not replicable with ig-bem-related-element.
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Two twin elements
@include ig-bem-component('block') {
@include ig-bem-element('elem') {
/* some element definitions */
@include ig-bem-next-twin-element {
/* some twin element definitions */
}
}
}
// Generates:
.c-block__elem {
/* some element definitions */
}
.c-block__elem + .c-block__elem {
/* some twin element definitions */
}
Multiple twin elements
@include ig-bem-component('block') {
@include ig-bem-element('elem1', 'elem2') {
/* some element definitions */
@include ig-bem-next-twin-element {
/* some twin element definitions */
}
}
}
// Generates:
.c-block__elem1, .c-block__elem2 {
/* some element definitions */
}
.c-block__elem1 + .c-block__elem1, .c-block__elem2 + .c-block__elem2 {
/* some twin element definitions */
}
Requires
- [mixin]
ig-bem-validate
- [mixin]
ig-context-push
- [mixin]
ig-context-pop
- [function]
ig-bem-next-twin-element
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
ig-bem-modifier
@mixin ig-bem-modifier($name, $names) { ... }
Description
Generate a new BEM modifier.
If the parent context is block or element, the modifier will modify said block or element according to the BEM naming convention.
If the parent context is a modifier or suffix, then the modifier will depend on said modifier or suffix. Depending on $extend, the meaning of this dependency (and the resulting selector) varies: If it's false (default), you signalize that the modifier also exists by itself, but it changes its behavior when the parent modifier or suffix is set. If it's true, you signalize that the modifier extends the parent modifier or suffix and can only be used in conjunction with it.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | First element name or list with two items: 1. first element name, 2. bool indicating if the modifier is extending | String or List | — none |
$names | More element names or lists with two items: 1. element name, 2. bool indicating if the modifier is extending | String or List | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Modifier that modifies a block or element
@include ig-bem-component('block') {
@include ig-bem-modifier('mod') {
background-color: #eee;
}
@include ig-bem-element('elem') {
@include ig-bem-modifier('mod') {
background-color: #222;
}
}
}
// Generates:
.c-block--mod {
background-color: #eee;
}
.c-block__elem--mod {
background-color: #222;
}
Modifier nested in another modifier, not extending
@include ig-bem-component('block') {
@include ig-bem-modifier('mod') {
background-color: #eee;
}
@include ig-bem-modifier('dark') {
/* some definitions */
@include ig-bem-modifier('mod') {
background-color: #222;
}
}
}
// Generates:
.c-block--mod {
background-color: #eee;
}
.c-block--dark {
/* some definitions */
}
.c-block--dark.c-block--mod {
background-color: #222;
}
Modifier nested in another modifier, extending
@include ig-bem-component('block') {
@include ig-bem-modifier('mod') {
background-color: #eee;
}
@include ig-bem-modifier('dark') {
/* some definitions */
@include ig-bem-modifier('mod' true) {
background-color: #222;
}
}
}
// Generates:
.c-block--mod {
background-color: #eee;
}
.c-block--dark {
/* some definitions */
}
.c-block--dark--mod {
background-color: #222;
}
Throws
If the element is not preceded by a block, element, modifier or suffix.
Requires
- [mixin]
ig-bem-validate
- [mixin]
ig-context-push
- [mixin]
ig-context-pop
- [function]
ig-bem-modifier
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
ig-bem-multi
@mixin ig-bem-multi($first, $others) { ... }
Description
Generate multiple entities (BEM or not) at once.
NOTE: This mixin does not generate perfectly optimized selectors in order to keep track of contexts.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$first | First selector. Either a string for a manual selector, or a list with the first items standing for a BEM selector function (optionally suffixed by a colon) and other items being passed as arguments to said function. | String or List | — none |
$others | Other selectors. Either a string for a manual selector, or a list with the first items standing for a BEM selector function (optionally suffixed by a colon) and other items being passed as arguments to said function. | String or List | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Creating multiple elements, a modifier and an anchor
@include ig-bem-object('buttonstrip') {
display: none;
@include ig-bem-multi('modifier' 'mod', 'element' 'button' 'separator', '> a') {
display: block;
}
}
// Generates:
.o-buttonstrip {
display: none;
}
.o-buttonstrip--mod {
display: block;
}
.o-buttonstrip__button, {
.o-buttonstrip__separator {
display: block;
}
.o-buttonstrip > a {
display: block;
}
Creating multiple elements, a modifier and an anchor - optional colons included
@include ig-bem-object('buttonstrip') {
display: none;
@include ig-bem-multi('modifier:' 'mod', 'element:' 'button' 'separator', '> a') {
display: block;
}
}
// Generates:
.o-buttonstrip {
display: none;
}
.o-buttonstrip--mod {
display: block;
}
.o-buttonstrip__button, {
.o-buttonstrip__separator {
display: block;
}
.o-buttonstrip > a {
display: block;
}
Throws
Function
Requires
- [mixin]
ig-context-assert-stack-count
- [mixin]
ig-context-push
- [mixin]
ig-context-pop
- [function]
ig-list-prepend
- [function]
ig-selector-nest-fix
- [function]
ig-list-slice
- [variable]
ig-bem-context-id
- [variable]
ig-bem-max-depth
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
ig-bem-state
@mixin ig-bem-state($state, $states) { ... }
Description
Create a new state rule.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$state | First state name | String | — none |
$states | List of more state names | List | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Using single is-state
@include ig-bem-object('menu') {
display: none;
@include ig-bem-state('is', open') {
display: block;
}
}
// Generates:
.o-menu {
display: none;
}
.o-menu.is-open {
display: block;
}
Using multiple is-states
@include ig-bem-object('menu') {
display: none;
@include ig-bem-state('is', open', 'visible') {
display: block;
}
}
// Generates:
.o-menu {
display: none;
}
.o-menu.is-open,
.o-menu.is-visible {
display: block;
}
Requires
- [mixin]
ig-bem-validate
- [mixin]
ig-context-push
- [mixin]
ig-context-pop
- [function]
ig-bem-state
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
Used by
- [mixin]
ig-bem-is
- [mixin]
ig-bem-has
ig-bem-is
@mixin ig-bem-is() { ... }
Description
Create a new has-state modifier.
It's a shorthand for ig-bem-state('is', $state, $states...).
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-state
ig-bem-has
@mixin ig-bem-has() { ... }
Description
Create a new has-state modifier.
It's a shorthand for ig-bem-state('has', $state, $states...).
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-state
ig-bem-suffix
@mixin ig-bem-suffix($name) { ... }
Description
Generate a new suffix.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | Suffix name | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Using a suffix
@include ig-bem-utility('hidden') {
display: none;
@media (max-width: 320px) {
@include ig-bem-suffix('phone') {
display: none;
}
}
@media (max-width: 768px) {
@include ig-bem-suffix('tablet') {
display: none;
}
}
}
// Generates:
.u-hidden {
display: none;
}
@media (max-width: 320px) {
.u-hidden@phone {
display: none;
}
}
@media (max-width: 768px) {
.u-hidden@tablet {
display: none;
}
}
Throws
If the element is not preceded by a block or modifier.
Requires
- [mixin]
ig-bem-validate
- [mixin]
ig-context-push
- [mixin]
ig-context-pop
- [function]
ig-bem-suffix
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
ig-bem-at-theme
@mixin ig-bem-at-theme($name, $names) { ... }
Description
Declare new rules for the current block for when this theme is active.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | First theme block name | String | — none |
$names | More theme block names | String | — none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
ig-bem-validate
- [mixin]
ig-context-push
- [mixin]
ig-context-pop
- [function]
ig-bem-at-theme
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
ig-bem-add-validator
@mixin ig-bem-add-validator($func-name, $func-names) { ... }
Description
Register one or multiple validator functions.
A validator function is a function that accepts 4 arguments:
- BEM entity type (string)
- Arguments passed to the mixin (map)
- The generated selector (selector)
- The generated context (list, may be null)
The function must return a list with two items:
true
if the mixin usage is valid, otherwisefalse
,- a string with a rejection reason (empty if the usage is valid).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$func-name | First function name. | String | — none |
$func-names | Other function names. | String | — none |
Requires
- [function]
ig-bem-add-validator
ig-bem-remove-validator
@mixin ig-bem-remove-validator($func-name, $func-names) { ... }
Description
Unregister one or multiple validator functions.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$func-name | First function name. | String | — none |
$func-names | Other function names. | String | — none |
Requires
- [function]
ig-bem-remove-validator
[private] ig-bem-validate
@mixin ig-bem-validate() { ... }
Parameters
None.
Throws
A BEM validator rejected this mixin usage due to the following reason: #{nth($result, 2)}
Requires
- [variable]
ig-bem-validators
Used by
- [mixin]
ig-bem-block
- [mixin]
ig-bem-element
- [mixin]
ig-bem-related-element
- [mixin]
ig-bem-next-twin-element
- [mixin]
ig-bem-modifier
- [mixin]
ig-bem-state
- [mixin]
ig-bem-suffix
- [mixin]
ig-bem-at-theme
functions
ig-bem-block
@function ig-bem-block() { ... }
Description
Generate a new block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-theme-selector
- [function]
ig-selector-nest-fix
- [variable]
ig-bem-context-id
- [variable]
ig-bem-max-depth
- [variable]
ig-bem-namespaces
Used by
- [mixin]
ig-bem-block
- [function]
ig-bem-object
- [function]
ig-bem-component
- [function]
ig-bem-layout
- [function]
ig-bem-utility
- [function]
ig-bem-scope
- [function]
ig-bem-theme
- [function]
ig-bem-js
- [function]
ig-bem-qa
- [function]
ig-bem-hack
See
- [mixin]
ig-bem-block
ig-bem-object
@function ig-bem-object() { ... }
Description
Generate a new object block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-object
ig-bem-component
@function ig-bem-component() { ... }
Description
Generate a new component block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-component
ig-bem-layout
@function ig-bem-layout() { ... }
Description
Generate a new layout block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-layout
ig-bem-utility
@function ig-bem-utility() { ... }
Description
Generate a new utility block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-utility
ig-bem-scope
@function ig-bem-scope() { ... }
Description
Generate a new scope block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-scope
ig-bem-theme
@function ig-bem-theme() { ... }
Description
Generate a new theme block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-theme
ig-bem-js
@function ig-bem-js() { ... }
Description
Generate a new JS block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-js
ig-bem-qa
@function ig-bem-qa() { ... }
Description
Generate a new QA block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-qa
ig-bem-hack
@function ig-bem-hack() { ... }
Description
Generate a new hack block. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-block
See
- [mixin]
ig-bem-hack
ig-bem-element
@function ig-bem-element() { ... }
Description
Generate a new BEM element. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Throws
Element nesting is forbidden.
A nested element must be an immediate children of the parent element.
Requires
- [function]
ig-context-get
- [function]
ig-selector-suffix-match
- [function]
ig-context-get
- [function]
ig-selector-suffix-match
- [function]
ig-context-get
- [function]
ig-selector-nest-fix
- [variable]
ig-bem-context-id
- [variable]
ig-bem-max-depth
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
- [variable]
ig-bem-element-nesting-policy
- [variable]
ig-bem-element-nesting-policy
- [variable]
ig-bem-element-separator
- [variable]
ig-bem-context-id
- [variable]
ig-bem-element-separator
- [variable]
ig-bem-context-id
- [variable]
ig-bem-element-separator
Used by
- [mixin]
ig-bem-element
See
- [mixin]
ig-bem-element
ig-bem-sibling-element
@function ig-bem-sibling-element() { ... }
Description
Generate a new BEM element that is a sibling of the current element. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-related-element
See
- [mixin]
ig-bem-sibling-element
ig-bem-next-element
@function ig-bem-next-element() { ... }
Description
Generate a new BEM element that is the successor of the current element. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-related-element
See
- [mixin]
ig-bem-next-element
ig-bem-next-twin-element
@function ig-bem-next-twin-element() { ... }
Description
Generate the current BEM element as a successor of itself. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Throws
Could not generate twin element selector.
Requires
- [function]
ig-context-get
- [function]
ig-context-get
- [function]
ig-selector-suffix-match
- [function]
ig-selector-nest-fix
- [function]
ig-selector-nest-fix
- [variable]
ig-bem-context-id
- [variable]
ig-bem-max-depth
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
- [variable]
ig-bem-element-separator
- [variable]
ig-bem-element-separator
- [variable]
ig-bem-modifier-separator
- [variable]
ig-bem-suffix-separator
- [variable]
ig-bem-element-separator
Used by
- [mixin]
ig-bem-next-twin-element
See
- [mixin]
ig-bem-next-twin-element
[private] ig-bem-theme-selector
@function ig-bem-theme-selector() { ... }
Parameters
None.
Requires
- [function]
ig-selector-nest-fix
- [variable]
ig-bem-namespaces
Used by
- [function]
ig-bem-block
- [function]
ig-bem-at-theme
ig-bem-modifier
@function ig-bem-modifier() { ... }
Description
Generate a new BEM modifier. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Throws
A modifier must be an immediate child of the parent context
Could not generate modifier selector.
Requires
- [function]
ig-context-get
- [function]
ig-selector-suffix-match
- [function]
ig-list-prepend
- [function]
ig-context-get
- [variable]
ig-bem-context-id
- [variable]
ig-bem-max-depth
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
- [variable]
ig-bem-modifier-separator
- [variable]
ig-bem-context-id
- [variable]
ig-bem-modifier-separator
- [variable]
ig-bem-suffix-separator
- [variable]
ig-bem-modifier-separator
- [variable]
ig-bem-modifier-separator
Used by
- [mixin]
ig-bem-modifier
See
- [mixin]
ig-bem-modifier
ig-bem-state
@function ig-bem-state() { ... }
Description
Generate a new state.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Used by
- [mixin]
ig-bem-state
- [function]
ig-bem-is
- [function]
ig-bem-has
See
- [mixin]
ig-bem-has
ig-bem-is
@function ig-bem-is() { ... }
Description
Generate a new is-state modifier. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-state
See
- [mixin]
ig-bem-is
ig-bem-has
@function ig-bem-has() { ... }
Description
Generate a new has-state modifier. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Requires
- [function]
ig-bem-state
See
- [mixin]
ig-bem-has
ig-bem-suffix
@function ig-bem-suffix() { ... }
Description
Generate a new suffix. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Throws
A suffix must be an immediate child of the parent context
Requires
- [function]
ig-context-get
- [function]
ig-selector-suffix-match
- [variable]
ig-bem-context-id
- [variable]
ig-bem-max-depth
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
- [variable]
ig-bem-suffix-separator
Used by
- [mixin]
ig-bem-suffix
See
- [mixin]
ig-bem-suffix
ig-bem-at-theme
@function ig-bem-at-theme() { ... }
Description
Declare new rules for the current block for when this theme is active. Check the respective mixin documentation for more information.
Parameters
None.
Returns
List
—A list with two items: 1. selector, 2. context or null
Throws
An at-theme rule must be an immediate child of a block
Requires
- [function]
ig-context-get
- [function]
ig-selector-suffix-match
- [function]
ig-bem-theme-selector
- [function]
ig-selector-nest-fix
- [variable]
ig-bem-context-id
- [variable]
ig-bem-context-id
Used by
- [mixin]
ig-bem-at-theme
See
- [mixin]
ig-bem-at-theme
ig-bem-add-validator
@function ig-bem-add-validator() { ... }
Description
Register one or multiple validator functions. Check the respective mixin documentation for more information.
Parameters
None.
Requires
- [variable]
ig-bem-validators
- [variable]
ig-bem-validators
Used by
- [mixin]
ig-bem-add-validator
See
- [mixin]
ig-bem-add-validator
ig-bem-remove-validator
@function ig-bem-remove-validator() { ... }
Description
Unregister one or multiple validator functions. Check the respective mixin documentation for more information.
Parameters
None.
Requires
- [variable]
ig-bem-validators
- [variable]
ig-bem-validators
Used by
- [mixin]
ig-bem-remove-validator
See
- [mixin]
ig-bem-remove-validator
ig-bem-validator--enforce-namespace-order
@function ig-bem-validator--enforce-namespace-order() { ... }
Description
A validator that makes sure blocks are declared in the right order, determined by the namespace used.
Parameters
None.
Requires
- [variable]
ig-bem-namespaces
ig-bem-validator--immutable-entities
@function ig-bem-validator--immutable-entities() { ... }
Description
A validator that makes all BEM entities immutable.
Parameters
None.
Requires
- [function]
ig-context-get
- [function]
ig-map-print
- [function]
ig-map-print
- [variable]
ig-bem-context-id
variables
[private] ig-bem-validators
$ig-bem-validators: ();
Description
A list of validator functions.
Type
List
Used by
- [function]
ig-bem-add-validator
- [function]
ig-bem-add-validator
- [function]
ig-bem-remove-validator
- [function]
ig-bem-remove-validator
- [mixin]
ig-bem-validate
ig-bem-element-separator
$ig-bem-element-separator: '__' !default;
Description
Separating character sequence for elements.
Type
String
Used by
- [function]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-related-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-next-twin-element
ig-bem-modifier-separator
$ig-bem-modifier-separator: '--' !default;
Description
Separating character sequence for modifiers.
Type
String
Used by
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-modifier
- [function]
ig-bem-modifier
- [function]
ig-bem-modifier
- [function]
ig-bem-modifier
ig-bem-suffix-separator
$ig-bem-suffix-separator: '\\@' !default;
Description
Separating character sequence for BEMIT suffixes.
Type
String
Used by
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-modifier
- [function]
ig-bem-suffix
ig-bem-namespaces
$ig-bem-namespaces: (
object: 'o',
component: 'c',
layout: 'l',
scope: 's',
theme: 't',
utility: 'u',
js: 'js',
qa: 'qa',
hack: '_'
) !default;
Description
Prefixes for all BEMIT namespaces.
Type
Map
Map structure
map key Name | map key Description | map key Type | map key Value |
---|---|---|---|
utility | Utility namespace | String | 'u' |
object | Object namespace | String | 'o' |
component | Component namespace | String | 'c' |
layout | Layout namespace | String | 'l' |
scope | Scope namespace | String | 's' |
theme | Theme namespace | String | 't' |
js | JS namespace | String | 'js' |
qa | QA namespace | String | 'qa' |
hack | Hack namespace | String | '_' |
Used by
- [function]
ig-bem-block
- [mixin]
ig-bem-composed-of
- [function]
ig-bem-theme-selector
- [function]
ig-bem-validator--enforce-namespace-order
[private] ig-bem-blocks
$ig-bem-blocks: ();
Description
A list of all generated blocks.
Type
List
Used by
- [mixin]
ig-bem-block
- [mixin]
ig-bem-block
- [mixin]
ig-bem-block
- [mixin]
ig-bem-block
- [mixin]
ig-bem-composed-of
- [mixin]
ig-bem-composed-of
ig-bem-max-depth
$ig-bem-max-depth: 99 !default;
Description
Maximum nesting depth of BEM mixins. The large default value means there is no effective limit.
Type
Number
Used by
- [function]
ig-bem-block
- [function]
ig-bem-element
- [function]
ig-bem-related-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-modifier
- [mixin]
ig-bem-multi
- [function]
ig-bem-suffix
ig-bem-element-nesting-policy
$ig-bem-element-nesting-policy: 'allow' !default;
Description
Indicates how nested elements should be handled.
'allow' means elements will be nested, i.e. the result will be {e} {b}element. 'disallow' means an error will be emitted. 'append' means the element name will be appended to the parent element, i.e. the result will be {e}element. Any other value is treated as 'allow'.
Type
String
Used by
- [function]
ig-bem-element
- [function]
ig-bem-element
ig-bem-context-id
$ig-bem-context-id: 'bem' !default;
Description
Context ID used for all BEM-related mixins.
Type
String
Used by
- [mixin]
ig-bem-block
- [mixin]
ig-bem-block
- [function]
ig-bem-block
- [mixin]
ig-bem-element
- [mixin]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-element
- [mixin]
ig-bem-related-element
- [mixin]
ig-bem-related-element
- [function]
ig-bem-related-element
- [function]
ig-bem-related-element
- [function]
ig-bem-related-element
- [mixin]
ig-bem-next-twin-element
- [mixin]
ig-bem-next-twin-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-next-twin-element
- [mixin]
ig-bem-modifier
- [mixin]
ig-bem-modifier
- [function]
ig-bem-modifier
- [function]
ig-bem-modifier
- [function]
ig-bem-modifier
- [function]
ig-bem-modifier
- [mixin]
ig-bem-multi
- [mixin]
ig-bem-multi
- [mixin]
ig-bem-multi
- [mixin]
ig-bem-state
- [mixin]
ig-bem-state
- [mixin]
ig-bem-suffix
- [mixin]
ig-bem-suffix
- [function]
ig-bem-suffix
- [function]
ig-bem-suffix
- [function]
ig-bem-suffix
- [function]
ig-bem-suffix
- [mixin]
ig-bem-at-theme
- [mixin]
ig-bem-at-theme
- [function]
ig-bem-at-theme
- [function]
ig-bem-at-theme
- [function]
ig-bem-validator--immutable-entities
ig-bem-debug
$ig-bem-debug: false !default;
Description
Debug mode.
Type
Bool
ig-bem-debug-colors
$ig-bem-debug-colors: (
object: #ffa500,
component: #00f,
layout: #ff0,
utility: #008000,
hack: #f00
) !default;
Description
Colors assigned to namespaces.
Type
Map
contexts
variables
[private] ig-context-stacks
$ig-context-stacks: ();
Description
Map of all context stacks.
Type
Map
Used by
- [function]
ig-context-stack-create
- [function]
ig-context-stack-create
- [function]
ig-context-stack-create
- [function]
ig-context-stack-clear
- [function]
ig-context-stack-clear
- [function]
ig-context-stack-clear
- [function]
ig-context-stack-delete
- [function]
ig-context-stack-delete
- [function]
ig-context-stack-delete
- [function]
ig-context-push
- [function]
ig-context-push
- [function]
ig-context-push
- [function]
ig-context-push
- [function]
ig-context-pop
- [function]
ig-context-pop
- [function]
ig-context-pop
- [function]
ig-context-pop
- [function]
ig-context-stack-contains
- [function]
ig-context-stack-contains
- [function]
ig-context-stack-count
- [function]
ig-context-stack-count
- [function]
ig-context-get
- [function]
ig-context-get
mixins
ig-context-stack-create
@mixin ig-context-stack-create($stack-id) { ... }
Description
Create a new context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack | String | — none |
Throws
If context stack already exists
Requires
- [function]
ig-context-stack-create
ig-context-stack-clear
@mixin ig-context-stack-clear($stack-id) { ... }
Description
Clear a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack | String | — none |
Requires
- [function]
ig-context-stack-clear
ig-context-stack-delete
@mixin ig-context-stack-delete($stack-id) { ... }
Description
Delete a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack | String | — none |
Requires
- [function]
ig-context-stack-delete
ig-context-push
@mixin ig-context-push($stack-id, $id, $data: ()) { ... }
Description
Push a new context to a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
$id | ID of new context | String | — none |
$data | Data that belongs to the context | Any | () |
Requires
- [function]
ig-context-push
Used by
- [mixin]
ig-bem-block
- [mixin]
ig-bem-element
- [mixin]
ig-bem-related-element
- [mixin]
ig-bem-next-twin-element
- [mixin]
ig-bem-modifier
- [mixin]
ig-bem-multi
- [mixin]
ig-bem-state
- [mixin]
ig-bem-suffix
- [mixin]
ig-bem-at-theme
ig-context-pop
@mixin ig-context-pop($stack-id) { ... }
Description
Pop the latest context from a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
Throws
If context stack doesn't exist
Requires
- [function]
ig-context-pop
Used by
- [mixin]
ig-bem-block
- [mixin]
ig-bem-element
- [mixin]
ig-bem-related-element
- [mixin]
ig-bem-next-twin-element
- [mixin]
ig-bem-modifier
- [mixin]
ig-bem-multi
- [mixin]
ig-bem-state
- [mixin]
ig-bem-suffix
- [mixin]
ig-bem-at-theme
ig-context-assert-stack-must-contain
@mixin ig-context-assert-stack-must-contain($stack-id, $context-ids, $check-head-only: false) { ... }
Description
Assert that a context stack must contain one of the given context IDs.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
$context-ids | Context IDs | List | — none |
$check-head-only | If false, all items will be checked. If true, only the head will be checked. | Bool | false |
Throws
Must be called inside of contexts
Requires
- [function]
ig-context-stack-contains
ig-context-assert-stack-must-not-contain
@mixin ig-context-assert-stack-must-not-contain($stack-id, $context-ids, $check-head-only: false) { ... }
Description
Assert that a context stack must not contain any of the given context IDs.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
$context-ids | Context IDs | List | — none |
$check-head-only | If false, all items will be checked. If true, only the head will be checked. | Bool | false |
Throws
Must not be called inside of contexts
Requires
- [function]
ig-context-stack-contains
ig-context-assert-stack-count
@mixin ig-context-assert-stack-count($stack-id, $max-count) { ... }
Description
Assert that a context stack must contain a number of contexts smaller than $max-count.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
$max-count | Maximum number ofg contexts in context stack | Number | — none |
Throws
Maximum context count
Requires
- [function]
ig-context-stack-count
Used by
- [mixin]
ig-bem-multi
functions
ig-context-stack-create
@function ig-context-stack-create($stack-id) { ... }
Description
Create a new context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack | String | — none |
Throws
Context stack
Requires
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
Used by
- [mixin]
ig-context-stack-create
ig-context-stack-clear
@function ig-context-stack-clear($stack-id) { ... }
Description
Clear a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack | String | — none |
Throws
Context stack
Requires
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
Used by
- [mixin]
ig-context-stack-clear
ig-context-stack-delete
@function ig-context-stack-delete($stack-id) { ... }
Description
Delete a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack | String | — none |
Throws
Context stack
Requires
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
Used by
- [mixin]
ig-context-stack-delete
ig-context-push
@function ig-context-push($stack-id, $id, $data: ()) { ... }
Description
Push a new context to a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
$id | ID of new context | String | — none |
$data | Data that belongs to the context | Any | () |
Returns
List
—A list with two items: 1 = context id, 2 = context data
Throws
Context stack
Requires
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
Used by
- [mixin]
ig-context-push
ig-context-pop
@function ig-context-pop($stack-id) { ... }
Description
Pop the latest context from a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
Returns
List
—A list with two items: 1 = context id, 2 = context data
Throws
Context stack
Requires
- [function]
ig-list-slice
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
Used by
- [mixin]
ig-context-pop
ig-context-stack-contains
@function ig-context-stack-contains($stack-id, $context-ids, $check-head-only: false) { ... }
Description
Check if a context stack contains one of the given context IDs.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
$context-ids | Context IDs | List | — none |
$check-head-only | If false, all items will be checked. If true, only the head will be checked. | Bool | false |
Returns
Bool
—true
if the context stack contains one of the context IDs, otherwise false
Throws
Context stack
Requires
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
Used by
ig-context-stack-count
@function ig-context-stack-count($stack-id) { ... }
Description
Get the number of contexts from a context stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
Returns
Number
—The number of contexts
Throws
Context stack
Requires
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
Used by
- [mixin]
ig-context-assert-stack-count
ig-context-get
@function ig-context-get($stack-id, $type-or-level) { ... }
Description
Get a specific context from the stack.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$stack-id | ID of context stack to use | String | — none |
$type-or-level | If this is a number (!= 0), the nth context from the head will be returned. If it is a string, the first context with a matching ID will be returned. If it is a list, the first context that matches one of the IDs in the list will be returned. | Number or String or List | — none |
Returns
List
—Null if no match was found, otherwise a list with two items: 1. context ID, 2. context data.
Throws
Context stack
Requires
- [variable]
ig-context-stacks
- [variable]
ig-context-stacks
Used by
- [function]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-related-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-modifier
- [function]
ig-bem-modifier
- [function]
ig-bem-suffix
- [function]
ig-bem-at-theme
- [function]
ig-bem-validator--immutable-entities
easing
variables
[private] ig-cubic-bezier-sample-pool
$ig-cubic-bezier-sample-pool: ();
Used by
- [function]
ig-cubic-bezier
- [function]
ig-cubic-bezier
- [function]
ig-cubic-bezier
- [function]
ig-cubic-bezier-t-for-x
ig-cubic-bezier-sample-pool-size
$ig-cubic-bezier-sample-pool-size: 10 !default;
Description
Sample pool size for cubic bezier calculations.
Used by
- [function]
ig-cubic-bezier
- [function]
ig-cubic-bezier
- [function]
ig-cubic-bezier-t-for-x
- [function]
ig-cubic-bezier-t-for-x
- [function]
ig-cubic-bezier-t-for-x
- [function]
ig-cubic-bezier-t-for-x
ig-cubic-bezier-newton-min-slope
$ig-cubic-bezier-newton-min-slope: 0.001 !default;
Description
Minimum slope required to use the Newton-Raphson method for cubic bezier calculations.
Used by
- [function]
ig-cubic-bezier-t-for-x
ig-cubic-bezier-newton-iters
$ig-cubic-bezier-newton-iters: 4 !default;
Description
Number of iterations of the Newton-Raphson method.
Used by
- [function]
ig-cubic-bezier-newton-raphson
ig-cubic-bezier-subdiv-precision
$ig-cubic-bezier-subdiv-precision: 0.0000001 !default;
Description
Precision of the subdivision method for cubic bezier calculations.
Used by
- [function]
ig-cubic-bezier-binary-subdivide
ig-cubic-bezier-subdiv-max-iters
$ig-cubic-bezier-subdiv-max-iters: 10 !default;
Description
Maximum iterations of the subdivision method for cubic bezier calculations.
Used by
- [function]
ig-cubic-bezier-binary-subdivide
functions
ig-cubic-bezier
@function ig-cubic-bezier($x1, $y1, $x2, $y2, $x) { ... }
Description
A cubic bezier function identical to the CSS cubic-bezier function.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x1 | X of first point | Number | — none |
$y1 | Y of first point | Number | — none |
$x2 | X of second point | Number | — none |
$y2 | Y of second point | Number | — none |
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier-func
- [function]
ig-cubic-bezier-func
- [function]
ig-cubic-bezier-t-for-x
- [variable]
ig-cubic-bezier-sample-pool
- [variable]
ig-cubic-bezier-sample-pool-size
- [variable]
ig-cubic-bezier-sample-pool-size
- [variable]
ig-cubic-bezier-sample-pool
- [variable]
ig-cubic-bezier-sample-pool
Used by
- [function]
ig-ease
- [function]
ig-ease-in
- [function]
ig-ease-out
- [function]
ig-ease-in-out
- [function]
ig-ease-in-sine
- [function]
ig-ease-out-sine
- [function]
ig-ease-in-out-sine
- [function]
ig-ease-in-quad
- [function]
ig-ease-out-quad
- [function]
ig-ease-in-out-quad
- [function]
ig-ease-in-cubic
- [function]
ig-ease-out-cubic
- [function]
ig-ease-in-out-cubic
- [function]
ig-ease-in-quart
- [function]
ig-ease-out-quart
- [function]
ig-ease-in-out-quart
- [function]
ig-ease-in-quint
- [function]
ig-ease-out-quint
- [function]
ig-ease-in-out-quint
- [function]
ig-ease-in-expo
- [function]
ig-ease-out-expo
- [function]
ig-ease-in-out-expo
- [function]
ig-ease-in-circ
- [function]
ig-ease-out-circ
- [function]
ig-ease-in-out-circ
[private] ig-cubic-bezier-func-a
@function ig-cubic-bezier-func-a() { ... }
Parameters
None.
Used by
- [function]
ig-cubic-bezier-func
- [function]
ig-cubic-bezier-func-slope
[private] ig-cubic-bezier-func-b
@function ig-cubic-bezier-func-b() { ... }
Parameters
None.
Used by
- [function]
ig-cubic-bezier-func
- [function]
ig-cubic-bezier-func-slope
[private] ig-cubic-bezier-func-c
@function ig-cubic-bezier-func-c() { ... }
Parameters
None.
Used by
- [function]
ig-cubic-bezier-func
- [function]
ig-cubic-bezier-func-slope
[private] ig-cubic-bezier-func
@function ig-cubic-bezier-func() { ... }
Description
One-dimensional cubic bezier function.
Parameters
None.
Requires
- [function]
ig-cubic-bezier-func-a
- [function]
ig-cubic-bezier-func-b
- [function]
ig-cubic-bezier-func-c
Used by
- [function]
ig-cubic-bezier
- [function]
ig-cubic-bezier
- [function]
ig-cubic-bezier-newton-raphson
- [function]
ig-cubic-bezier-binary-subdivide
[private] ig-cubic-bezier-func-slope
@function ig-cubic-bezier-func-slope() { ... }
Description
Derivative of the one-dimensional cubic bezier function.
Parameters
None.
Requires
- [function]
ig-cubic-bezier-func-a
- [function]
ig-cubic-bezier-func-b
- [function]
ig-cubic-bezier-func-c
Used by
- [function]
ig-cubic-bezier-newton-raphson
- [function]
ig-cubic-bezier-t-for-x
[private] ig-cubic-bezier-newton-raphson
@function ig-cubic-bezier-newton-raphson() { ... }
Description
Newton-Raphson method to calculate the t parameter for a given x parameter.
Parameters
None.
Requires
- [function]
ig-cubic-bezier-func-slope
- [function]
ig-cubic-bezier-func
- [variable]
ig-cubic-bezier-newton-iters
Used by
- [function]
ig-cubic-bezier-t-for-x
[private] ig-cubic-bezier-binary-subdivide
@function ig-cubic-bezier-binary-subdivide() { ... }
Description
Subdivision method to calculate the t parameter for a given x parameter.
Parameters
None.
Requires
- [function]
ig-cubic-bezier-func
- [variable]
ig-cubic-bezier-subdiv-max-iters
- [variable]
ig-cubic-bezier-subdiv-precision
Used by
- [function]
ig-cubic-bezier-t-for-x
[private] ig-cubic-bezier-t-for-x
@function ig-cubic-bezier-t-for-x() { ... }
Description
Calculate the t parameter for a given x parameter.
Parameters
None.
Requires
- [function]
ig-cubic-bezier-func-slope
- [function]
ig-cubic-bezier-newton-raphson
- [function]
ig-cubic-bezier-binary-subdivide
- [variable]
ig-cubic-bezier-sample-pool
- [variable]
ig-cubic-bezier-sample-pool-size
- [variable]
ig-cubic-bezier-sample-pool-size
- [variable]
ig-cubic-bezier-sample-pool-size
- [variable]
ig-cubic-bezier-newton-min-slope
- [variable]
ig-cubic-bezier-sample-pool-size
Used by
- [function]
ig-cubic-bezier
ig-ease
@function ig-ease($x) { ... }
Description
Sinusoidal easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in
@function ig-ease-in($x) { ... }
Description
Sinusoidal easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-out
@function ig-ease-out($x) { ... }
Description
Sinusoidal easing function (out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-out
@function ig-ease-in-out($x) { ... }
Description
Sinusoidal easing function (in-out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-sine
@function ig-ease-in-sine($x) { ... }
Description
Sinusoidal easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-out-sine
@function ig-ease-out-sine($x) { ... }
Description
Sinusoidal easing function (out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-out-sine
@function ig-ease-in-out-sine($x) { ... }
Description
Sinusoidal easing function (in-out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-quad
@function ig-ease-in-quad($x) { ... }
Description
Quadratic easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-out-quad
@function ig-ease-out-quad($x) { ... }
Description
Quadratic easing function (out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-out-quad
@function ig-ease-in-out-quad($x) { ... }
Description
Quadratic easing function (in-out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-cubic
@function ig-ease-in-cubic($x) { ... }
Description
Cubic easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-out-cubic
@function ig-ease-out-cubic($x) { ... }
Description
Cubic easing function (out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-out-cubic
@function ig-ease-in-out-cubic($x) { ... }
Description
Cubic easing function (in-out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-quart
@function ig-ease-in-quart($x) { ... }
Description
Quart easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-out-quart
@function ig-ease-out-quart($x) { ... }
Description
Quart easing function (out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-out-quart
@function ig-ease-in-out-quart($x) { ... }
Description
Quart easing function (in-out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-quint
@function ig-ease-in-quint($x) { ... }
Description
Quint easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-out-quint
@function ig-ease-out-quint($x) { ... }
Description
Quint easing function (out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-out-quint
@function ig-ease-in-out-quint($x) { ... }
Description
Quint easing function (in-out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-expo
@function ig-ease-in-expo($x) { ... }
Description
Exponential easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-out-expo
@function ig-ease-out-expo($x) { ... }
Description
Exponential easing function (out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-out-expo
@function ig-ease-in-out-expo($x) { ... }
Description
Exponential easing function (in-out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-circ
@function ig-ease-in-circ($x) { ... }
Description
Circular easing function (in direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-out-circ
@function ig-ease-out-circ($x) { ... }
Description
Circular easing function (out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
ig-ease-in-out-circ
@function ig-ease-in-out-circ($x) { ... }
Description
Circular easing function (in-out direction).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$x | Progress between 0 and 1 inclusive | Number | — none |
Returns
Number
Requires
- [function]
ig-cubic-bezier
functions
functions
ig-str-replace
@function ig-str-replace($string, $search, $replace) { ... }
Description
Replace a substring with a new string.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$string | String to search | String | — none |
$search | Substring that gets replaced | String | — none |
$replace | String that replaces $search | String | — none |
Returns
String
—A string with all instances of $search replaced with $replace
ig-str-implode
@function ig-str-implode($list, $glue) { ... }
Description
Concatenate all items from $list.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$list | — none | List | — none |
$glue | Delimiter | Number | — none |
Returns
String
Used by
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [function]
ig-map-print
ig-list-slice
@function ig-list-slice($list, $start: 1, $end: length($list)) { ... }
Description
Extract a subset from the given list.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$list | — none | List | — none |
$start | Indices before this value will be discarded | Number | 1 |
$end | Indices starting after this value will be discarded | Number | length($list) |
Returns
List
—A slice of the list
Used by
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [function]
ig-easing-gradient
- [mixin]
ig-bem-multi
- [function]
ig-context-pop
- [function]
ig-harmony-modular-scale
ig-list-prepend
@function ig-list-prepend($list, $value) { ... }
Description
Add a new item to the beginning of a list.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$list | — none | List | — none |
$value | — none | Number | — none |
Returns
List
—A list with $value at the beginning, followed by the other items
Used by
- [function]
ig-easing-gradient
- [mixin]
ig-bem-composed-of
- [function]
ig-bem-modifier
- [mixin]
ig-bem-multi
ig-quicksort
@function ig-quicksort($l) { ... }
Description
Sort numeric items in a list.
The implementation is based on the algorithm on the German Wikipedia article about quicksort: https://de.wikipedia.org/wiki/Quicksort#Pseudocode
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$l | — none | List | — none |
Returns
List
—Sorted list
Requires
- [function]
ig-quicksort-partition
Used by
- [function]
ig-harmony-modular-scale
- [mixin]
ig-fluid-property
[private] ig-quicksort-partition
@function ig-quicksort-partition() { ... }
Parameters
None.
Used by
- [function]
ig-quicksort
ig-map-get-default
@function ig-map-get-default($map, $key, $default) { ... }
Description
Try to get the value for the given key from the given map. If it doesn't contain that key, return the provided default value instead.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$map | — none | Map | — none |
$key | — none | String | — none |
$default | — none | Any | — none |
Returns
Any
—Either the value assigned to $key or $default
ig-map-get-deep
@function ig-map-get-deep($map, $key, $default: null) { ... }
Description
Get the value for a map within a map (or deeper).
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$map | — none | Map | — none |
$key | — none | String or List | — none |
$default | — none | Any | null |
Returns
Any
—Either the value assigned to $key or $default
Used by
- [function]
ig-props-get
ig-map-merge-recursive
@function ig-map-merge-recursive($map1, $map2) { ... }
Description
Merge two maps recursively.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$map1 | — none | Map | — none |
$map2 | — none | Map | — none |
Returns
Map
—The result of a recursive merge of $map1 and $map2
Throws
Two maps expected.
Used by
- [function]
ig-props-save
ig-map-print
@function ig-map-print($map) { ... }
Description
Get the contents of a map as a user-friendly string representation.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$map | — none | Map | — none |
Returns
String
Requires
- [function]
ig-str-implode
Used by
- [function]
ig-bem-validator--immutable-entities
- [function]
ig-bem-validator--immutable-entities
ig-selector-nest-fix
@function ig-selector-nest-fix($selector) { ... }
Description
A bugfix for the built-in selector-nest function.
For some reason, Sass will duplicate parts of the selector which will result in excessively long selectors and bad compilation performance. This fix removes all duplicate selectors and should be called right after selector-nest.
Issue was reported: https://github.com/sass/libsass/issues/2640
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$selector | Selector modified with selector-nest | Selector | — none |
Returns
Selector
—Selector without duplicates
Used by
- [function]
ig-bem-block
- [function]
ig-bem-element
- [function]
ig-bem-related-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-theme-selector
- [mixin]
ig-bem-multi
- [function]
ig-bem-at-theme
ig-selector-suffix-match
@function ig-selector-suffix-match($selector, $suffixes) { ... }
Description
Check if the given selector ends with one of the provided suffixes.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$selector | — none | Selector | — none |
$suffixes | — none | Selector | — none |
Returns
Bool
—true
if the selector matches at least one suffix, otherwise false
.
Used by
- [function]
ig-bem-element
- [function]
ig-bem-element
- [function]
ig-bem-next-twin-element
- [function]
ig-bem-modifier
- [function]
ig-bem-suffix
- [function]
ig-bem-at-theme
ig-strip-unit
@function ig-strip-unit($n) { ... }
Description
Remove the unit from any variable.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$n | — none | Any | — none |
Returns
Number
—Unit-less variable
Used by
- [function]
ig-fluid-property-calc
- [function]
ig-fluid-property-calc
ig-px-to-rem
@function ig-px-to-rem($size, $base: $ig-root-size) { ... }
Description
Convert a pixel value to a rem value.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$size | Pixel value to convert | Number | — none |
$base | Reference base font size used for conversion | Number | $ig-root-size |
Returns
Number
—Pixel value converted to rem
Used by
- [function]
ig-fluid-property-calc
- [function]
ig-fluid-property-calc
- [function]
ig-fluid-property-calc
- [function]
ig-fluid-property-calc
mixins
ig-execute
@mixin ig-execute() { ... }
Description
A mixin with the sole purpose of letting you use temporary variables without polluting the global namespace.
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
global variables
variables
ig-root-size
$ig-root-size: 16px !default;
Description
Reference root font size in px that is used for px -> rem conversions.
Type
Number
harmony
functions
ig-harmony-modular-scale
@function ig-harmony-modular-scale($times, $base, $ratio) { ... }
Description
Adjust a value to a modular scale.
For a more sophisticated solution, check out modularscale-sass.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$times | Number of iterations. If positive, $base will be multiplied with $ratio. If negative, $base will be divided by $ratio. | Number | — none |
$base | Single base value or, for a multi-stranded modular scale, a list of base values | Number or List | — none |
$ratio | Ratio | Number | — none |
Returns
Number
Requires
- [function]
ig-math-pow
- [function]
ig-list-slice
- [function]
ig-quicksort
- [function]
ig-math-pow
Used by
- [mixin]
ig-fluid-modular-scale
Links
mixins
ig-fluid-modular-scale
@mixin ig-fluid-modular-scale($props, $times, $fluid-map) { ... }
Description
Combine fluid properties with modular scales to achieve fluid modular scales.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$props | Property or list of properties to set | String or List | — none |
$times | Number of iterations. See ig-harmony-modular-scale for more information. | Number | — none |
$fluid-map | A map with keys = viewports and values = modular scales | Number | — none |
Example
Responsive font sizes between 2 viewports based on modular scales
$ms: (
320px: (1rem 2rem, 1.1),
640px: (1rem 2rem, 1.2)
);
h1 {
@include ig-fluid-modular-scale(font-size, 3, $ms);
}
h2 {
@include ig-fluid-modular-scale(font-size, 2, $ms);
}
h3 {
@include ig-fluid-modular-scale(font-size, 1, $ms);
}
Requires
- [mixin]
ig-fluid-property
- [function]
ig-harmony-modular-scale
See
- [function]
ig-harmony-modular-scale
math functions
functions
ig-math-pow
@function ig-math-pow($base, $exp) { ... }
Description
Perform exponentiation. Only integer exponents are supported.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$base | — none | Number | — none |
$exp | — none | Number | — none |
Returns
Number
Example
Exponentiation with a positive exponent
$result: ig-math-pow(3, 2); // The value of $result is 3^2 = 9
Exponentiation with a negative exponent
$result: ig-math-pow(2, -3); // The value of $result is 1/(2^3) = 1/8
Used by
- [function]
ig-harmony-modular-scale
- [function]
ig-harmony-modular-scale
ig-math-clamp
@function ig-math-clamp($value, $min, $max) { ... }
Description
Clamp a number between a minimum and maximum value.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$value | Value to clamp | Number | — none |
$min | Minimum value | Number | — none |
$max | Maximum value | Number | — none |
Returns
Number
Example
$result: ig-math-clamp(20, 0, 10); // The value of $result is 10
$result: ig-math-clamp(50, 20, 100); // The value of $result is 50
property trees
variables
ig-props-enforce-double-dashes
$ig-props-enforce-double-dashes: true !default;
Description
Indicate if property names must start with two dashes (--). This is required if property trees are also used for native CSS custom properties.
Type
Bool
Used by
- [function]
ig-props-save
- [function]
ig-props-save
ig-props-default-tree
$ig-props-default-tree: 'default' !default;
Description
Default tree name to use if no name is specified.
Type
String
[private] ig-props-trees
$ig-props-trees: ();
Description
List of all created property trees.
Type
List
Used by
- [function]
ig-props-save
- [function]
ig-props-save
- [function]
ig-props-save
- [function]
ig-props-save
- [function]
ig-props-delete
- [function]
ig-props-delete
- [function]
ig-props-delete
- [function]
ig-props-get-all
- [function]
ig-props-get-all
mixins
ig-props-save
@mixin ig-props-save($map, $tree: $ig-props-default-tree, $merge: false) { ... }
Description
Save a property tree. If a tree with the sane name already exists, the trees will be merged.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$map | Map containing properties | Map | — none |
$tree | ID the map is saved as | String | $ig-props-default-tree |
$merge | If a tree named $tree already exists and this value is set to true, they will be merged. Otherwise an error will be emitted. | Bool | false |
Requires
- [function]
ig-props-save
ig-props-delete
@mixin ig-props-delete($tree: $ig-props-default-tree) { ... }
Description
Delete a property tree.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$tree | ID of the tree to be deleted | String | $ig-props-default-tree |
Requires
- [function]
ig-props-delete
ig-props-assign-native
@mixin ig-props-assign-native($root: null, $tree: $ig-props-default-tree) { ... }
Description
Generate assignments for native CSS custom properties with the values from the specified tree.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$root | Sub-tree to use for assignment | String | null |
$tree | ID of the property tree to use | String | $ig-props-default-tree |
Requires
- [mixin]
ig-props-assign-native-internal
- [function]
ig-props-get-all
- [function]
ig-props-get
[private] ig-props-assign-native-internal
@mixin ig-props-assign-native-internal() { ... }
Parameters
None.
Used by
- [mixin]
ig-props-assign-native
functions
ig-props-save
@function ig-props-save($map, $tree: $ig-props-default-tree, $merge: false) { ... }
Description
Save a property tree. If a tree with the sane name already exists, the trees will be merged.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$map | Map containing properties | Map | — none |
$tree | ID the map is saved as | String | $ig-props-default-tree |
$merge | If a tree named $tree already exists and this value is set to true, they will be merged. Otherwise an error will be emitted. | Bool | false |
Throws
Property tree keys must start with two dashes (--). If you don\
Property tree #{inspect($tree)} does already exist.
Requires
- [function]
ig-props-validate
- [function]
ig-map-merge-recursive
- [variable]
ig-props-enforce-double-dashes
- [variable]
ig-props-enforce-double-dashes
- [variable]
ig-props-trees
- [variable]
ig-props-trees
- [variable]
ig-props-trees
- [variable]
ig-props-trees
Used by
- [mixin]
ig-props-save
ig-props-delete
@function ig-props-delete($tree: $ig-props-default-tree) { ... }
Description
Unset a property tree.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$tree | ID of the tree to be deleted | String | $ig-props-default-tree |
Throws
Property tree
Requires
- [variable]
ig-props-trees
- [variable]
ig-props-trees
- [variable]
ig-props-trees
Used by
- [mixin]
ig-props-delete
ig-props-get-all
@function ig-props-get-all($tree: $ig-props-default-tree) { ... }
Description
Get an entire property tree.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$tree | ID of the property tree | String | $ig-props-default-tree |
Returns
Map
Throws
Unknown tree
Requires
- [variable]
ig-props-trees
- [variable]
ig-props-trees
Used by
- [function]
ig-props-get
- [mixin]
ig-props-assign-native
ig-props-get
@function ig-props-get($key, $tree: $ig-props-default-tree, $default: null) { ... }
Description
Read a value from a property tree.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$key | Key of the property to read. If this is a list of keys, the map will be traversed in that order. | String or List | — none |
$tree | ID of the property tree to use | String | $ig-props-default-tree |
$default | Default value to return of no match was found. If null, this function will throw an error instead. | Any | null |
Returns
Any
—Value assigned to property or $default
Throws
If there was no match for $key and $default is null
Requires
- [function]
ig-props-get-all
- [function]
ig-map-get-deep
Used by
- [mixin]
ig-props-assign-native
ig-props-get-native
@function ig-props-get-native($key, $default: null) { ... }
Description
Generate a var() function call to get native CSS custom property.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$key | Key of the property to read. If this is a list of keys, the map will be traversed in that order. | String or List | — none |
$default | Default value to return of no match was found. | Any | null |
Returns
String
—var()
[private] ig-props-validate
@function ig-props-validate() { ... }
Description
Validate property names.
Parameters
None.
Used by
- [function]
ig-props-save
responsive
variables
ig-fluid-support-named-viewports
$ig-fluid-support-named-viewports: true !default;
Description
If true, named viewports will be supported if a compatible $breakpoints map exists. This is the case for include-media, for example.
Type
Bool
Used by
- [mixin]
ig-fluid-property
mixins
ig-fluid-property
@mixin ig-fluid-property($props, $fluid-map) { ... }
Description
Scale a property uniformly between a specific set of target viewports / values.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$props | Property or list of properties to set | String or List | — none |
$fluid-map | A map with keys = viewports and values = target value | Number | — none |
Example
Responsive font-size between 2 viewports
.something {
@include ig-fluid-property(font-size, ( 320px: 20px, 720px: 30px ));
}
// Generates:
@media (min-width: 320px) and (max-width: 720px) {
.something {
font-size: calc(20px + 10 * ((100vw - 20px) / 400));
}
}
@media (max-width: 320px) {
.something {
font-size: 20px;
}
}
@media (min-width: 720px) {
.something {
font-size: 30px;
}
}
Responsive font-size between 3 viewports
.something {
@include ig-fluid-property(font-size, ( 320px: 20px, 720px: 30px, 1280px: 40px ));
}
// Generates:
@media (min-width: 320px) and (max-width: 720px) {
.something {
font-size: calc(20px + 10 * ((100vw - 20px) / 400));
}
}
@media (min-width: 720px) and (max-width: 1280px) {
.something {
font-size: calc(30px + 10 * ((100vw - 30px) / 400));
}
}
@media (max-width: 320px) {
.something {
font-size: 20px;
}
}
@media (min-width: 720px) {
.something {
font-size: 30px;
}
}
Throws
$fluid-map must contain at least two viewports.
$fluid-map contains invalid viewports.
Requires
- [function]
ig-quicksort
- [function]
ig-fluid-property-calc
- [variable]
ig-fluid-support-named-viewports
Used by
- [mixin]
ig-fluid-modular-scale
functions
[private] ig-fluid-property-calc
@function ig-fluid-property-calc($min-value, $max-value, $min-width, $max-width) { ... }
Description
Generate the calc() function that uniformly scales a value from $min-value to $max-value depending on the viewport width.
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$min-value | Minimum value | Number | — none |
$max-value | Maximum value | Number | — none |
$min-width | Minimum viewport width | Number | — none |
$max-width | Maximum viewport width | Number | — none |
Throws
Units of $min-value and $max-value, $min-width and $max-width must match.
This combination of units is not supported.
Requires
- [function]
ig-px-to-rem
- [function]
ig-px-to-rem
- [function]
ig-px-to-rem
- [function]
ig-px-to-rem
- [function]
ig-strip-unit
- [function]
ig-strip-unit
Used by
- [mixin]
ig-fluid-property