theme ⇒ 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 addStyles

Kind: global plugin
Properties
NameTypeDescription
.createStyleSheet()function

createStyleSheet

.addStyles()function

addStyles

stylesstring

The current styles.

Example
<style id="weavyStyleOverrides" media="not all">
    // media="not all" keeps it from beeing applied on the page
    ...
</style>
<script>
    var weavy = new Weavy({
        plugins: {
            theme: {
                styles: ".weavy-dock{ background: red; }"
            }
        }
    });

    weavy.addStyles(".weavy-wide { background: none !important; }");
    weavy.addStyles(document.getElementById("weavyStyleOverrides").textContent);
</script>

Instance members

weavy.createStyleSheet([css])

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

Kind: instance method of theme
ParamTypeDescription
[css]string

Optional additional css that will be appended to the previously provided styles.


weavy.addStyles(css)

Add styles to the weavy stylesheet.

Kind: instance method of theme
ParamTypeDescription
cssstring

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


Static members

.defaults : Object

Default plugin options

Kind: static property of theme
Properties
NameTypeDescription
stylesstring

Styles applied when weavy is created

Example
Weavy.plugins.theme.defaults = {
    styles: ""
};