# utils/dom/adoptglobalstylesheet

module

<a id="functions">

## Functions

<a id="function-adoptGlobalStyleSheet">

### `adoptGlobalStyleSheet( doc, css ) → void`

Ships 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 in `document.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.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/dom/adoptglobalstylesheet.ts#L30)

#### Parameters

* `doc: Document`

  The document to adopt the stylesheet into.

* `css: string`

  The stylesheet text. Pass a constant – repeated calls with the same text are a no-op.

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
