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

Support autoprefixer in pipeline #45

Closed
lunelson opened this issue May 8, 2014 · 11 comments
Closed

Support autoprefixer in pipeline #45

lunelson opened this issue May 8, 2014 · 11 comments

Comments

@lunelson
Copy link
Contributor

lunelson commented May 8, 2014

autoprefixer is becoming a standard part of CSS preprocessing workflow. Would it be possible to integrate it in to the Harp.js pipeline?

Also: currently the grunt-based node-sass and autoprefixer plugins preserve source maps; but the gulp-based ones do not. It seems it's an architectural issue. I wonder what the implications for this are in Harp?

@ghost
Copy link

ghost commented May 9, 2014

+1

@lunelson
Copy link
Contributor Author

Alternatively, pleeease is also worth looking at

@kennethormandy
Copy link
Collaborator

Thanks. Personally, I would on board with having Autoprefixer, and I think it fits well with Harp’s philosophy as long as it’s not configurable. We would need a post-processing step for all CSS, though, which doesn’t exist right now, but would also be nice to place to fix #30

Any chance you’d be interested in submitting a pull request for it if @sintaxi is also interested?

@sintaxi
Copy link
Owner

sintaxi commented May 28, 2014

I think you guys have the right idea. The question I have is should this be the responsibility of Harp or of a Sass/Less/Stylus library? If so, is there going to be situations people do not want the auto-prefix behaviour?

@lunelson
Copy link
Contributor Author

I regret to say I don't have the expertise to plug this in and submit a PR myself. I can say that autoprefixer runs on a framework called PostCSS, which is by the same author. Also it's independent of Stylus/LESS/Sass, since it is a discrete second step, usually needing a CSS output file to work from, though it's also apparently been made to work with a streaming style workflow as a gulp plugin.

It does also have configuration questions: namely, which browsers (how far back) to support with the added prefixes, and also whether to process source-maps or not. So I don't know if that's perhaps contrary to the philosophy of Harp. Incidentally: do source-maps get handled with Harp? I know that LESS and libsass both can output them; not sure about Stylus. Anyway the reason I asked about integrating it in the pipeline, is that I've found that the main application which is post-processing and live-reloading needs to be aware of the autoprefixer step, or the workflow (mainly the live-reloading) is thrown off. In the case of Harp even more so I guess, due to the css source being entirely hidden—otherwise I'd say let's just have a way to hook it up with Grunt or something.

@DTrejo
Copy link
Contributor

DTrejo commented Jul 18, 2014

+1

Great work with harp, very much enjoying it so far :)

@geelen
Copy link
Contributor

geelen commented Aug 10, 2014

Popped a PR in for autoprefixer here: #57

@subhaze
Copy link

subhaze commented Sep 8, 2014

@sintaxi

... is there going to be situations people do not want the auto-prefix behaviour?

My guess is yes, but, I would definitely love to see this behavior in harp.

So, maybe it could be triggered in the pipeline just like the mime types? If you don't want it, nothing to be done and keeping using harp as you have been, but, if you do just add the extension prefix and it's there.

myfile.jade         ->  myfile.html
myfile.xml.jade     ->  myfile.xml

---

myfile.less             ->  myfile.css
myfile.css.less         ->  myfile.css
myfile.prefix-css.less  ->  myfile.css // auto-prefixed css

@geelen
Copy link
Contributor

geelen commented Sep 8, 2014

I really don't think there's a good reason not to use autoprefixer. Given
harp's focus on 'zero configuration, smart behaviour', I would argue that
autoprefixing-all-the-things makes the most sense.

On 8 September 2014 05:41, Michael Russell notifications@github.com wrote:

@sintaxi https://github.com/sintaxi

... is there going to be situations people do not want the auto-prefix
behaviour?

My guess is yes, but, I would definitely love to see this behavior in harp.

So, maybe it could be triggered in the pipeline just like the mime types?
If you don't want it, nothing to be done and keeping using harp as you have
been, but, if you do just add the extension prefix and it's there.

myfile.jade -> myfile.html
myfile.xml.jade -> myfile.xml


myfile.less -> myfile.css
myfile.css.less -> myfile.css
myfile.prefix.less -> myfile.css // auto-prefixed css


Reply to this email directly or view it on GitHub
#45 (comment).

@kennethormandy
Copy link
Collaborator

v0.9.0 of Terraform is actually already tagged and comes with @geelen’s integration of Autoprefixer, the next version of Harp will include it.

We decided the situations where people wanted to opt-out of automatic vendor prefixing would be so rare that it fit under the convention over configuration philosophy Harp uses. In the next version of Harp, if you write LESS, Sass, or Stylus, you CSS will be vendor prefixed, and if you write CSS, it won’t be.

Edit I had this tab open all evening, so I didin’t see @geelen’s comment until after I posted. But basically, that!

@subhaze
Copy link

subhaze commented Sep 8, 2014

Awesome and agreed, didn't realize it had already been merged... Viewing the linked issue I see that now :) Was just giving some additional thoughts if it were still being debated, but, thankfully it's not!

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

6 participants