-
Notifications
You must be signed in to change notification settings - Fork 25
CssBuilder Struct
Ed Charbeneau edited this page Jan 15, 2020
·
1 revision
Creates a CssBuilder used to define conditional CSS classes used in a component. Call Build() to return the completed CSS Classes as a string. CssBuilder has a traditional constructor and two functional (static) convenience methods.
public struct CssBuilder
Creates a CssBuilder used to define conditional CSS classes used in a component. Call Build() to return the completed CSS Classes as a string.
Initializes a new instance of the CssBuilder struct.
public CssBuilder(string value)
string CssClass =>
new CssBuilder("my-base")
.AddClass("condition-1", when: true)
.Build();
// CssClass: "my-base condition-1"
Initializes a new instance of the CssBuilder struct with a default initial value.
public static CssBuilder Default(string value)
string CssClass =>
CssBuilder.Default("my-base")
.AddClass("condition-1", when: true)
.Build();
// CssClass: "my-base condition-1"
Initializes a new instance of the CssBuilder struct with a string.Empty
value.
public static CssBuilder Empty()
string CssClass =>
CssBuilder.Empty()
.AddClass("condition-1", when: true)
.Build();
// CssClass: "condition-1"