axept / prejss

Get the power of PostCSS with plugins in your JSS styles. 🎨 Just put CSS into JS and get it as JSS object.
MIT License
248 stars 13 forks source link

Classname notation/conversion #18

Open GertSallaerts opened 7 years ago

GertSallaerts commented 7 years ago

Quick question. As you state this project is meant to allow us to write plain CSS and end up with JSS, wouldn't it make more sense to strip the dots from classnames and global-ize any global selectors?

Take this input:

.button { background-color: salmon; }
p { color: green; }

With output

exports.default = {
    ".button": {
        "backgroundColor": "salmon"
    }
    "p": {
        "color": "green"
    }
};

While I expected the output to be something more like this:

exports.default = {
    "button": {
        "backgroundColor": "salmon"
    }
    "@global": {
        "p" {
            "color": "green"
        }
    }
};