segmentio / myth

A CSS preprocessor that acts like a polyfill for future versions of the spec.
4.33k stars 131 forks source link

Support inline css / Polymer style modules #141

Open w-p opened 8 years ago

w-p commented 8 years ago

Feature Request.

Currently, processing the example below produces an error styles.html:17:1: missing '{'. Stripping the tags, of course, solves the immediate problem. Additionally, the :root block is removed entirely without error or notice.

Polymer style modules are declared within tags. Myth doesn't like tags. Polymer handles var, calc and other such declarations but does not handle prefixes. Support for Polymer style modules in myth would be awesome.

<dom-module id='my-styles'>
    <template>
    <style>
    :root {
        --green:    seagreen;
        --red:      darkred;
    }
    div, span {
        display: flex;
        width: calc(100% / 2);
        background-color: var(--green);
    }
    </style>
    </template>
</dom-module>