Class TwTextEditorTheme
- Namespace
- TwBlazor.Configuration.Components
- Assembly
- TwBlazor.dll
Theme configuration for the rich text editor (TwTextEditor). Override any property to customize text editor styles globally.
[ExcludeFromCodeCoverage]
public class TwTextEditorTheme
- Inheritance
-
TwTextEditorTheme
- Inherited Members
Remarks
The editor's border, background, focus ring and rounding come from TwInputTheme, the same as TwTextfield<T>. The toolbar is made of other components with their own themes: TwToggleTheme for the toggles, toggle groups and toolbar buttons, TwInputTheme for the text style list, the link field and the HTML source view, and TwSeparatorTheme for the lines between groups. This theme only holds the layout of the editor and the look of the text inside it.
Constructors
TwTextEditorTheme()
public TwTextEditorTheme()
Properties
BlockSelect
Gets or sets the classes for the text style list (paragraph and headings) in the toolbar, added to the root of its TwSelect<T>, such as its width.
public string BlockSelect { get; set; }
Property Value
Content
Gets or sets the classes for the editable text area: its padding, scrolling and the placeholder shown while it
is empty (the area has a data-empty attribute then, and the placeholder text in
data-placeholder).
public required string Content { get; set; }
Property Value
ContentDefaultVariant
Gets or sets the classes added to Content for the Default variant, which has no side border, so the text lines up with the label.
public string ContentDefaultVariant { get; set; }
Property Value
Disabled
Gets or sets the classes added to Root while the editor is disabled.
public required string Disabled { get; set; }
Property Value
HelperText
Gets or sets the classes for the helper text shown under the editor (HelperText).
public required string HelperText { get; set; }
Property Value
Remarks
The text is read out with the editor, and needs the 4.5:1 text contrast ratio against the page.
LinkInput
Gets or sets the classes added to the root of the link address field, such as how much of the bar it fills.
public string LinkInput { get; set; }
Property Value
LinkInputField
Gets or sets the classes added to the link address field's input, such as start padding that leaves room for the link icon drawn over its start, so the text does not run underneath it.
public string LinkInputField { get; set; }
Property Value
LinkPanel
Gets or sets the classes for the bar that opens under the toolbar to add or change a link.
public required string LinkPanel { get; set; }
Property Value
Root
Gets or sets the layout classes for the box around the toolbar and the text, on top of the input variant's border and background.
public required string Root { get; set; }
Property Value
Source
Gets or sets the classes for the area that holds the HTML source view.
public required string Source { get; set; }
Property Value
SourceInput
Gets or sets the classes added to the HTML source view's text area, such as a monospaced font.
public string SourceInput { get; set; }
Property Value
Toolbar
Gets or sets the classes for the toolbar: a row of controls above the text. By default it stays on one line and scrolls sideways when the controls do not fit.
public required string Toolbar { get; set; }
Property Value
ToolbarGroup
Gets or sets the classes added to each TwToggleGroup<T> in the toolbar. The
groups are outlined toggle groups, so a pressed button gets a flat tint; these classes take away the group's own
border and padding, so the buttons sit directly on the toolbar. They need the important modifier (!),
since they replace classes the toggle group sets itself.
public string ToolbarGroup { get; set; }
Property Value
ToolbarSeparator
Gets or sets the classes for the line drawn between groups of toolbar controls, added to the TwSeparator.
public string ToolbarSeparator { get; set; }
Property Value
Typography
Gets or sets the classes that style the formatted text inside the editor: headings, lists, quotes, code blocks
and links. They target the elements inside the area, such as [&_h1]:text-2xl, since the browser's
own styles for them are reset by Tailwind.
public required string Typography { get; set; }
Property Value
Remarks
Links and other text need the 4.5:1 contrast ratio against the editor's background.