Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Common PostCSS API #6

Closed
ai opened this issue Feb 2, 2015 · 3 comments · Fixed by #9
Closed

Common PostCSS API #6

ai opened this issue Feb 2, 2015 · 3 comments · Fixed by #9

Comments

@ai
Copy link
Contributor

ai commented Feb 2, 2015

Most of PostCSS plugins works as plugin instead of plugin() if there is no options.

postcss([
    require('autoprefixer-core'),
    require('postcss-nested'),
    require('postcss-mixins'),
    require('postcss-assets')() // ugly
])

I make this behavior by:

module.exports = function (opts) {
    //  work with options
    return function (css) {
        // work with AST
    };
};

module.exports.postcss = function (css) {
    module.exports()(css);
};
@ai
Copy link
Contributor Author

ai commented Feb 2, 2015

/cc @borodean

@borodean
Copy link
Owner

borodean commented Feb 2, 2015

@ai if this would be implemented, and since it changes the API, how semver says the version should be updated?

@ai
Copy link
Contributor Author

ai commented Feb 2, 2015

I think here is x.x.X release, because it is expected behaviour and we fix it.

But also we you change x.X.x, because we add new API (but didn’t broke old APIs).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants