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
NamestringThe group's name, unique among your custom groups.
PrefixesIReadOnlyList<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
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
Name
The group's name, unique among your custom groups.
public string Name { get; init; }
Property Value
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
Prefixes
The class prefixes that belong to the group.
public IReadOnlyList<string> Prefixes { get; init; }
Property Value
Methods
Deconstruct(out string, out IReadOnlyList<string>)
public void Deconstruct(out string Name, out IReadOnlyList<string> Prefixes)
Parameters
NamestringPrefixesIReadOnlyList<string>
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Equals(TwClassGroup?)
public bool Equals(TwClassGroup? other)
Parameters
otherTwClassGroup
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(TwClassGroup?, TwClassGroup?)
public static bool operator ==(TwClassGroup? left, TwClassGroup? right)
Parameters
leftTwClassGrouprightTwClassGroup
Returns
operator !=(TwClassGroup?, TwClassGroup?)
public static bool operator !=(TwClassGroup? left, TwClassGroup? right)
Parameters
leftTwClassGrouprightTwClassGroup