utils/dom/adoptglobalstylesheet
Functions
adoptGlobalStyleSheet( doc, css ) → voidmodule:utils/dom/adoptglobalstylesheet~adoptGlobalStyleSheetShips a stylesheet that has to reach the light DOM, whatever tree the editor itself lives in.
For the few rules that a shadow-scoped theme stylesheet cannot express, because they style nodes no shadow root can contain: the
<html>and<body>elements, or third-party UI mounted indocument.body. Anything that styles the editor UI belongs in a theme stylesheet instead, where an integrator can see and override it.Safe to call from any number of editors sharing a document, and at any time: the same stylesheet text is adopted once per document. The stylesheet then stays for the lifetime of the document, inert unless the classes it targets are present.
Parameters
doc: DocumentThe document to adopt the stylesheet into.
css: stringThe stylesheet text. Pass a constant – repeated calls with the same text are a no-op.
Returns
void