ThemePlugin ⇒ Weavy.plugins.theme

Inject additional styles into the sealed weavy shadow dom. You may define styles by either setting weavy plugin options or by injecting them via addCss

Kind: global plugin
Example
<style id="weavyStyleOverrides" media="not all">
    // media="not all" keeps it from beeing applied on the page
    ...
</style>
<script>
    if (weavy.plugins.theme) {
        weavy.plugins.theme.createStyleSheet(weavy.nodes.container, ".weavy-panel{ background: red; }");
        weavy.plugins.theme.addCss(weavy.nodes.container, document.getElementById("weavyStyleOverrides").textContent);
    }

</script>

weavy.plugins.theme.createStyleSheet(root, css)

Creates a style sheet for weavy and adds any styles together with styles provided in options or by using addCss. This function is automatically called on before:build

Kind: instance method of ThemePlugin
ParamDescription
root : HTMLElement

The dom node where the stylesheet should be attached.

css : string

CSS for the stylesheet.


weavy.plugins.theme.addCss(root, css)

Add styles to an existing weavy stylesheet.

Kind: instance method of ThemePlugin
ParamDescription
root : HTMLElement

The root containing the stylesheet

css : string

The styles to apply. Full css including selectors etc may be used.