/** * Give a component's shadow root the Web Awesome theme. Called from componentWillLoad by every * component that applies waScope() below - see there for why that is more than just . * * Adopted rather than linked, and adopted rather than loaded into the document: a needs a URL, * a URL means a file shipped beside this module, and an app that bundles us never copies that file - * which is how bundled consumers ended up with an unstyled viewer. Loading it at the top of the page * instead would style the host app around us, which is not ours to do. So the text is compiled in * (see scripts/inline-assets.mjs) and handed straight to the one place it belongs. * * Worth having beyond the bundling it fixes: the sheet is parsed once however many components adopt * it, and there is no request to wait on, so a component's first frame is already themed rather than * flashing unstyled until a stylesheet arrives. * * Where this lands among the shadow root's other sheets doesn't matter. Stencil puts a component's * own styles in front of anything already adopted, but everything Web Awesome declares here sits * inside an `@layer` - bar a handful of `--wa-color-*-on*` tokens nothing of ours sets - and an * unlayered rule beats a layered one whatever the order. */ export declare const adoptWebAwesomeTheme: (host: Element) => void; /** * The classes that turn a shadow root into a Web Awesome scope, paired with the theme that * adoptWebAwesomeTheme() adopts into it. Every component that can be used on its own does both, * rather than counting on an above it: custom properties inherit through shadow * boundaries, so the outermost one in use is the one that has to establish them, and which component * that is depends on the embed. * * They belong on an element *inside* the shadow root - a container the component already wraps its * content in - and not on the alone. Web Awesome declares its palette with plain class * selectors, and a plain class selector in a shadow root's own stylesheet never matches the host of * that root, so a scope class sitting there alone establishes nothing for the tree below it: every * color reads as the empty string. Worth applying to the Host as well, though, because that class is * matched by the *parent's* stylesheet one shadow root out - which is what gives a nested * component's own :host rules their colors. * * Applying them more than once down a single tree is harmless - the values are identical, and every * root adopts the same one stylesheet - which is why nobody tries to detect whether an ancestor got * there first. At first paint there is no reliable answer to that question anyway. */ export declare const waScope: (theme?: "light" | "dark") => string; export declare const themePreference: () => "light" | "dark"; /** * What to open a component's `theme` prop with, before anyone has had a chance to set it: the * attribute already on the tag, or themePreference() when there isn't one. * * The element is optional because of *when* a @Prop default is evaluated: it compiles to a class * field initializer, and those run ahead of the constructor's own body. That is early enough to * matter in the lazy build, where @Element() becomes a getter over the host ref and the ref is only * registered by the constructor's first statement - so a field reading it gets undefined, and * anything it calls has to survive that. (Under dist-custom-elements the instance *is* the element, * which is why the same field reads fine there, and why nothing but the lazy build ever noticed.) * * Falling back to the preference there costs no accuracy: the lazy runtime has already recorded the * `theme` attribute against the prop by the time it builds the instance - it does that as the element * upgrades - and it keeps that value over one a field initializer writes during construction. So a * tag that named a theme still renders in it, first frame included, which is the whole point of * resolving a theme this early. */ export declare const initialTheme: (el?: Element) => "light" | "dark";