Table of Contents

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

string

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

string

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

string

Disabled

Gets or sets the classes added to Root while the editor is disabled.

public required string Disabled { get; set; }

Property Value

string

HelperText

Gets or sets the classes for the helper text shown under the editor (HelperText).

public required string HelperText { get; set; }

Property Value

string

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

string

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

string

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

string

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

string

Source

Gets or sets the classes for the area that holds the HTML source view.

public required string Source { get; set; }

Property Value

string

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

string

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

string

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

string

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

string

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

string

Remarks

Links and other text need the 4.5:1 contrast ratio against the editor's background.