Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoprefix / prefixfree transform #64

Closed
Munter opened this issue May 6, 2013 · 7 comments
Closed

Autoprefix / prefixfree transform #64

Munter opened this issue May 6, 2013 · 7 comments

Comments

@Munter
Copy link
Member

Munter commented May 6, 2013

We should make a transform that uses autoprefixer to clean up and improve css during a production build. See more in this discussion: sindresorhus/sublime-autoprefixer#3

I suggest having a transform that can be hidden behind a single --prefix option.

I'm thinking of this behavior when --prefix is set.

  • Remove prefixfree.js script include if it is there. Since autoprefixer should ideally be a static build of what prefixfree would do runtime.
  • Run the resulting CSS through autoprefixer to add missing prefixes or remove outdates ones.

The only thing I haven't figured out is how to configure autoprefixer. Could possibly be a command line argument, but it seems it's to highly configurable for us to be able to map it directly. And a config file doesn't really fit the assetgraph paradigm that well at the moment.

Maybe reduce the config to some predefined options that can be chosen between? This would make configuration simpler, but take away power from the user.

@passy
Copy link

passy commented Jan 19, 2014

👍

I'd definitely like to see a way to apply autoprefixer directly within the assetgraph compilation step.

@Munter
Copy link
Member Author

Munter commented Jan 19, 2014

Should be pretty straight forward. The difficult thing about it is how to expose the configuration, which is far more complex than any of the really simple command line switches we have reduced configs down to before.

We could just add the transform and feed it the js object it expects, and then not expose that setting in the command line tool, but for example have grunt-reduce pass it on as a config, since this is native js to begin with

@Munter
Copy link
Member Author

Munter commented Jan 19, 2014

@Munter
Copy link
Member Author

Munter commented Jan 19, 2014

Note to the implementer: The CSS assets most likely need to be repopulated after the transform has run, as added or removed properties may contain relations to other assets.

@sindresorhus
Copy link

👍 Just have a sane default and most people won't need to change it ;)

@Munter
Copy link
Member Author

Munter commented Jan 19, 2014

Looking into it now

@Munter Munter closed this as completed in 375fc14 Jan 19, 2014
@Munter
Copy link
Member Author

Munter commented Jan 20, 2014

Released in assetgraph-builder v1.8.5 and grunt-reduce v0.1.13

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

No branches or pull requests

3 participants