mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-10 21:55:19 +00:00
Say what the root element seam cannot do yet
RootElementContext's documentation promised that Element Call confines its decoration to the given element, but several selectors still name body directly and the initializer writes data-platform onto it. A non-body root is decorated correctly and styled incorrectly, with no error to show for it, so the documentation should say so until the stylesheets are scoped.
This commit is contained in:
@@ -12,9 +12,17 @@ import { createContext, use } from "react";
|
|||||||
*
|
*
|
||||||
* Element Call decorates this element with the theme, layout and background
|
* Element Call decorates this element with the theme, layout and background
|
||||||
* attributes its stylesheets key off, and portals its modals into it. When
|
* attributes its stylesheets key off, and portals its modals into it. When
|
||||||
* Element Call owns the page this is simply the document body; when it is
|
* Element Call owns the page this is simply the document body; the intent is
|
||||||
* embedded in a host application it is the container the host mounted it into,
|
* that when embedded in a host application it becomes the container the host
|
||||||
* so that Element Call does not reach outside its own subtree.
|
* mounted it into, so that Element Call does not reach outside its own subtree.
|
||||||
|
*
|
||||||
|
* That intent is not yet achievable: several selectors still name `body`
|
||||||
|
* directly — `body[data-background="gradient"]` and `body[data-platform=…]` in
|
||||||
|
* `index.css`, and `body[data-platform="ios"]` in `AppBar.module.css` and
|
||||||
|
* `Modal.module.css` — and `Initializer.initBeforeReact` writes
|
||||||
|
* `data-platform` straight onto the body. So anything other than the body will
|
||||||
|
* be decorated correctly and styled incorrectly, silently. Until those are
|
||||||
|
* scoped, treat this as preparation rather than a working seam.
|
||||||
*/
|
*/
|
||||||
const RootElementContext = createContext<HTMLElement | null>(null);
|
const RootElementContext = createContext<HTMLElement | null>(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user