You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d19b5c3
Browse filesBrowse the repository at this point in the historyBrowse files
Components read CSS custom properties (`--text-color`, `--primary-color`, `--bg-soft-color`, …). Wrap a subtree in `<ep-theme name="…">` to apply a token set. Built-in themes: **`colibris`** (default, matches Etherpad's skin), **`colibris-dark`**, **`high-contrast`**, and **`warm`**. Register your own at runtime:
73
+
Components only read CSS custom properties, so every colour, radius and shadow can be changed without touching the components. Built-in themes: **`colibris`** (default, Etherpad's light-green skin), **`colibris-dark`**, **`high-contrast`** and **`warm`**.
`<ep-theme>` sets `data-scheme="light|dark"` on itself, fires `ep-theme-change` and updates live when a theme is redefined. Single tokens can be overridden per element with the `tokens` property. Without the element:
104
+
105
+
-`applyTheme(document.documentElement, 'acme')` sets the tokens on any element (and removes tokens of the previous call that the new set lacks),
106
+
-`themeToCss('acme', ':root')` returns the tokens as a CSS rule, e.g. for rendering them server-side.
107
+
108
+
`@samtv12345/etherpad-webcomponents/themes.js` contains only these functions and the token sets, without any custom element.
109
+
79
110
### The editor (`<ep-editor>`)
80
111
81
112
`<ep-editor>` embeds Etherpad's Ace editor engine (under `src/editor/`: `Changeset`, `AttributePool`, `changesettracker`, content collector, op assemblers, etc.) as a self-contained element. It supports bold/italic/underline/strikethrough, ordered & unordered lists, indentation, undo/redo, and changeset-based collaboration.
@@ -99,7 +130,7 @@ const pending = ed.prepareUserChangeset(); // { changeset, apool } to send to
99
130
The lower-level engine pieces are also exported for advanced use:
0 commit comments