Class TwResponsiveClass
- Namespace
- TwBlazor.Configuration
- Assembly
- TwBlazor.dll
One Tailwind utility written out at every breakpoint, e.g. grid-cols-2, sm:grid-cols-2 and so on.
public class TwResponsiveClass
- Inheritance
-
TwResponsiveClass
- Inherited Members
Remarks
Tailwind only compiles class names it can find written in full, so a breakpoint prefix can never be added at runtime. Each breakpoint's class is spelled out here instead, once, in the theme file.
Constructors
TwResponsiveClass()
Initializes an empty set of classes.
public TwResponsiveClass()
TwResponsiveClass(string, string, string, string, string, string)
Initializes the classes for every breakpoint at once.
public TwResponsiveClass(string baseClass, string sm, string md, string lg, string xl, string xl2)
Parameters
baseClassstringThe class for every screen width, with no prefix.
smstringThe class with the
sm:prefix.mdstringThe class with the
md:prefix.lgstringThe class with the
lg:prefix.xlstringThe class with the
xl:prefix.xl2stringThe class with the
2xl:prefix.
Properties
Base
Gets or sets the class for every screen width, with no prefix.
public string Base { get; set; }
Property Value
Lg
Gets or sets the class with the lg: prefix.
public string Lg { get; set; }
Property Value
Md
Gets or sets the class with the md: prefix.
public string Md { get; set; }
Property Value
Sm
Gets or sets the class with the sm: prefix.
public string Sm { get; set; }
Property Value
Xl
Gets or sets the class with the xl: prefix.
public string Xl { get; set; }
Property Value
Xl2
Gets or sets the class with the 2xl: prefix.
public string Xl2 { get; set; }
Property Value
Methods
Get(Breakpoint)
Gets the class for a breakpoint.
public string Get(Breakpoint breakpoint)
Parameters
breakpointBreakpointThe breakpoint.
Returns
- string
The class, or an empty string when none is set.