Class RteCssRules
HTMLEditorKit's
StyleSheet.addRule) into rules that apply to RTE's rendered content.
Two transformations, both forced by where the content actually lives. RTE
renders the pane's HTML as real elements inside a .ql-editor div in the
component's shadow root, so every selector is confined under that class —
otherwise a rule like button { … } would also hit the editor toolbar.
And the document root selectors body / html have no counterpart
inside the editor, so they map onto the content element itself rather than
becoming a descendant selector that matches nothing — which matters because
body { font-family: … } is the single most common rule in the field.
Scoping to one pane needs no help from the selector: the stylesheet is
injected into that instance's own shadow root, which is already a style
boundary. (A :host([theme~="…"]) prefix would be required only for the
static themeFor delivery shape, where one stylesheet is shared.)
At-rules (@media, @import, @font-face) are skipped
whole, nested body included, and reported so the caller can WARN — emitting a
half-parsed @media block would inject broken CSS rather than none.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe element RTE renders pane content into, inside its shadow root. -
Method Summary
-
Field Details
-
CONTENT_ROOT
The element RTE renders pane content into, inside its shadow root.- See Also:
-
-
Method Details
-
translate
Translate a CSS fragment. Accepts anythingStyleSheet.addRuledoes — a single rule or a whole stylesheet's worth.
-