Table of Contents

Class BEM

Namespace
The.Web
Assembly
Instagile.Web.Client.dll

Utility functions to generate splattable style attributes.

public static class BEM
Inheritance
BEM
Inherited Members

Remarks

Block Element Modifier

Methods

Class(Dictionary<string, object>?, string, string, params (bool test, string name)[])

Builds a splattable class attribute for a BEM block element, appending block__element--modifier for each modifier whose test is true, and merging into splat.

public static Dictionary<string, object> Class(Dictionary<string, object>? splat, string block, string element, params (bool test, string name)[] modifiers)

Parameters

splat Dictionary<string, object>
block string
element string
modifiers (bool test, string name)[]

Returns

Dictionary<string, object>

Remarks

Passing element separately is equivalent to baking it into the block string: Class(splat, "the-x", "y", …) and Class(splat, "the-x__y", …) produce the same classes.

Class(Dictionary<string, object>?, string, params (bool test, string name)[])

Builds a splattable class attribute for a BEM block, appending block--modifier for each modifier whose test is true, and merging into splat.

public static Dictionary<string, object> Class(Dictionary<string, object>? splat, string block, params (bool test, string name)[] modifiers)

Parameters

splat Dictionary<string, object>
block string
modifiers (bool test, string name)[]

Returns

Dictionary<string, object>

Class(string, string, params (bool test, string name)[])

Builds a class attribute for a BEM block element, appending block__element--modifier for each modifier whose test is true.

public static Dictionary<string, object> Class(string block, string element, params (bool test, string name)[] modifiers)

Parameters

block string
element string
modifiers (bool test, string name)[]

Returns

Dictionary<string, object>

Remarks

Passing element separately is equivalent to baking it into the block string: Class("the-x", "y", …) and Class("the-x__y", …) produce the same classes.

Class(string, params (bool test, string name)[])

Builds a class attribute for a BEM block, appending block--modifier for each modifier whose test is true.

public static Dictionary<string, object> Class(string block, params (bool test, string name)[] modifiers)

Parameters

block string
modifiers (bool test, string name)[]

Returns

Dictionary<string, object>

Id(string, Dictionary<string, object>?, params (bool test, string name)[])

public static Dictionary<string, object> Id(string block, Dictionary<string, object>? splat, params (bool test, string name)[] modifiers)

Parameters

block string
splat Dictionary<string, object>
modifiers (bool test, string name)[]

Returns

Dictionary<string, object>

Id(string, params (bool test, string name)[])

public static Dictionary<string, object> Id(string block, params (bool test, string name)[] modifiers)

Parameters

block string
modifiers (bool test, string name)[]

Returns

Dictionary<string, object>

Inline(bool, string, string)

public static Dictionary<string, object> Inline(bool test, string key, string value)

Parameters

test bool
key string
value string

Returns

Dictionary<string, object>

Inline(params (bool test, string key, string value)[])

public static Dictionary<string, object> Inline(params (bool test, string key, string value)[] styles)

Parameters

styles (bool test, string key, string value)[]

Returns

Dictionary<string, object>