Table of Contents

Class TwClassGroup

Namespace
TwBlazor.Configuration
Assembly
TwBlazor.dll

A custom set of css classes that conflict with each other, so only the last one added survives a merge.

public sealed record TwClassGroup : IEquatable<TwClassGroup>
Inheritance
TwClassGroup
Implements
Inherited Members

Remarks

A class belongs to the group when it is one of Prefixes or starts with one of them followed by a dash, so the prefix btn matches btn, btn-sm and btn-lg, or when it is one of Classes exactly. Reusing the name of a built-in group (for example p or text-color) adds your classes to that group instead.

Constructors

TwClassGroup(string, IReadOnlyList<string>)

A custom set of css classes that conflict with each other, so only the last one added survives a merge.

public TwClassGroup(string Name, IReadOnlyList<string> Prefixes)

Parameters

Name string

The group's name, unique among your custom groups.

Prefixes IReadOnlyList<string>

The class prefixes that belong to the group.

Remarks

A class belongs to the group when it is one of Prefixes or starts with one of them followed by a dash, so the prefix btn matches btn, btn-sm and btn-lg, or when it is one of Classes exactly. Reusing the name of a built-in group (for example p or text-color) adds your classes to that group instead.

Properties

Classes

Gets the classes that belong to the group by their whole name. Unlike Prefixes, the class text-huge here does not also match text-huge-wide.

public IReadOnlyList<string> Classes { get; init; }

Property Value

IReadOnlyList<string>

ModifierOverrides

Gets the names of other groups that a later class from this group also removes, but only when the class has a / modifier. For example the built-in font size group removes a line height for text-lg/7 and not for text-lg.

public IReadOnlyList<string> ModifierOverrides { get; init; }

Property Value

IReadOnlyList<string>

Name

The group's name, unique among your custom groups.

public string Name { get; init; }

Property Value

string

Overrides

Gets the names of other groups, built-in or custom, that a later class from this group also removes. For example px overrides pr and pl.

public IReadOnlyList<string> Overrides { get; init; }

Property Value

IReadOnlyList<string>

Prefixes

The class prefixes that belong to the group.

public IReadOnlyList<string> Prefixes { get; init; }

Property Value

IReadOnlyList<string>

Methods

Deconstruct(out string, out IReadOnlyList<string>)

public void Deconstruct(out string Name, out IReadOnlyList<string> Prefixes)

Parameters

Name string
Prefixes IReadOnlyList<string>

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(TwClassGroup?)

public bool Equals(TwClassGroup? other)

Parameters

other TwClassGroup

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(TwClassGroup?, TwClassGroup?)

public static bool operator ==(TwClassGroup? left, TwClassGroup? right)

Parameters

left TwClassGroup
right TwClassGroup

Returns

bool

operator !=(TwClassGroup?, TwClassGroup?)

public static bool operator !=(TwClassGroup? left, TwClassGroup? right)

Parameters

left TwClassGroup
right TwClassGroup

Returns

bool