Skip to content

Add autoprefixer? like "Myth".. #1917

Closed

Description

@stevenvachon

https://github.com/ai/autoprefixer
It's what Myth uses.

Would be cool. Wouldn't need to use mixins for as many things.

Activity

  1. jonschlinkert commented on Mar 6, 2014

    @jonschlinkert
    Contributor

    This is something that has been discussed here numerous times, but I think the consensus has been (should be still) that this is not something that belongs in less.js (for all of the reasons described in the other issues - run a search and you'll find a few).

    However, I do think this is a great example of the kind of thing plugins ought to do, so I'll leave this open until others have a chance to weigh in on it.

  2. mdo commented on Mar 6, 2014

    @mdo

    Came here to look up and ask for the same thing. It'd be amazing to see the preprocessors like Less and Sass address this.

  3. stevenvachon commented on Mar 6, 2014

    @stevenvachon
    Author

    If it were written as a plugin, would it affect sourcemap accuracy?

  4. seven-phases-max commented on Mar 6, 2014

    @seven-phases-max
    Member

    Hmm, and why you need it to be integrated into Less? You can use it with Less w/o any special integration.
    And yes, Autoprefixer supports sourcemap input since v1.

  5. mdo commented on Mar 6, 2014

    @mdo

    From my perspective, it'd be awesome to see Less and Sass address this to help move projects and the web in general forward. Having to create extensive libraries of mixins just sucks. Folks want a mixin for everything, but I don't think that should be the case. Mixins make the most sense when creating code shortcuts (e.g., clearfix, image replacement, etc).

    Moreover, I'd argue the vision of a CSS preprocessor should be to eliminate itself. Improving the core CSS language should the ultimate goal, and having this as part of Less and Sass opens the door to so many more people for writing more bulletproof code, now and forever.

  6. seven-phases-max commented on Mar 7, 2014

    @seven-phases-max
    Member

    it'd be awesome to see Less and Sass address this.

    Hmm, I'm not sure I understand how (and why) preprocessors should "address this" specifically. We just do put the AP tool after the PP tool in the building chain, that's it.

  7. mdo commented on Mar 7, 2014

    @mdo

    Right, that fixes it for us, and those using Grunt. Not everyone uses Grunt or another build tool.

    When I say Less and Sass should address this, I mean that auto-prefixing CSS3 properties should happen automatically (and be configurable) within the core Less and Sass projects. An external tool shouldn't be necessary.

  8. stevenvachon commented on Mar 7, 2014

    @stevenvachon
    Author

    @seven-phases-max autoprefixer supports source maps with less' output css, not less' raw source input.

    There's also the argument for autoprefixer in "development mode", without the need for a task runner.

  9. jonschlinkert commented on Mar 7, 2014

    @jonschlinkert
    Contributor

    I'd argue the vision of a CSS preprocessor should be to eliminate itself.

    Amen. I could not have articulated my view any better than this line. Sums it up well.

    I mean that auto-prefixing CSS3 properties should happen automatically (and be configurable) within the core Less and Sass projects. An external tool shouldn't be necessary.

    This is the kind of feedback that I was looking for when I left the issue open. @mdo / @stevenvachon would it make a material difference if this functionality was supplied by a plugin that for all intents and purposes "felt" like it was native, and not like an external tool (meaning that it wouldn't rely on a third party build chain, Less.js would do all the work)?

  10. stevenvachon commented on Mar 7, 2014

    @stevenvachon
    Author

    @jonschlinkert sure, but would it work with Less.js' dev mode and would it produce accurate source maps relative to the Less code and not its CSS output?

  11. seven-phases-max commented on Mar 7, 2014

    @seven-phases-max
    Member

    @stevenvachon by "Less.js' dev mode" do you mean client side usage? See #1835.

  12. jonschlinkert commented on Mar 7, 2014

    @jonschlinkert
    Contributor

    @stevenvachon well, that brings up a good point - I guess (like most things) it will depend on expectations. So maybe the first thing to do is for us to outline these things and get consensus on what the autoprefixer would be expected to do.

    Then @lukeapage / @seven-phases-max can decide whether or not a plugin would work, or if it needs to be implemented natively.

  13. stevenvachon commented on Mar 7, 2014

    @stevenvachon
    Author

    @jonschlinkert my expectations would be pretty simple:

    Not sure if anyone has anything to add to that.

    As to whether it should be a plugin or a native feature, I'd push for native as it maintains Less.js' ease of use and brings everything closer to achieving @mdo's summary of what a pre-processor should be.

  14. stevenvachon commented on Mar 7, 2014

    @stevenvachon
    Author

    @jonschlinkert that link you posted, does it have a reference of properties/rules that get prefixed? And, does it—should it—have a source for updates (like autoprefixer does with caniuse.com)?

  15. 23 remaining items

  16. stevenvachon commented on Sep 11, 2014

    @stevenvachon
    Author

    Along with this, why not just include Myth as a possible post-processor option? Excessive?

  17. seven-phases-max commented on Sep 11, 2014

    @seven-phases-max
    Member

    @stevenvachon If I understand it correctly the agreement is to provide whatever post-preprocessing via plugins and not as a dedicated core-options. (I.e. to add autoprefixer or myth or anything you just write a plugin which registers itself as a postprocessor and applies desired transformations to the output CSS). In other words it looks like we're building mini-grunt here 🚲 :)

  18. stevenvachon commented on Sep 11, 2014

    @stevenvachon
    Author

    Ah, yeah, I prefer that approach. And, haha, I don't use task runners as much anymore; maybe others are doing the same?

  19. seven-phases-max commented on Sep 11, 2014

    @seven-phases-max
    Member

    I don't use task runners as much anymore; maybe others are doing the same?

    You will then. lessc/less.js becomes a task-runner as soon as you put all that stuff in. So it's just a matter of naming things by their true names w/o getting shy ;)

  20. stevenvachon commented on Sep 11, 2014

    @stevenvachon
    Author

    What I mean is that I don't use Grunt/Gulp much anymore. Lately, I've just been using npm-scripts and a build.js with each lib's programmatic API.

  21. seven-phases-max commented on Sep 11, 2014

    @seven-phases-max
    Member

    What I mean is that I don't use Grunt/Gulp much anymore.

    Yes, I've got it above. I mean it does not matter how the thing is named: gulp, grunt, build.js, build.bat, build.sh, lessc (with all stuff inside), in general it's all the same "build chain" essentially.

  22. stevenvachon commented on Sep 12, 2014

    @stevenvachon
    Author

    A plugin architecture may not even be necessary if we have a callback that supports a Promise. Can avoid becoming a mini task runner.

  23. seven-phases-max commented on Sep 12, 2014

    @seven-phases-max
    Member

    A callback also may be not necessary since less.render "returns" a CSS string one can do everything with he wants to.

    These ("external tool wrapper") plugins are still necessary only because they'll keep asking for a monolith tool no matter what.

  24. lukeapage commented on Sep 12, 2014

    @lukeapage
    Member

    (maybe you knew but) less.render returns a promise on v2 if no callback is
    specified.

  25. seven-phases-max commented on Sep 12, 2014

    @seven-phases-max
    Member

    less.render returns a promise on v2 if no callback is specified.

    Yes, my bad, I guess just overgeneralized things a bit to not confuse even more :) (In other words, the real purpose of the callback and/or promise there is that it can make async things more simple and/or make error handling more easy... If that would not be necessary it could just really return a string and never care of anything that happens after that (if it could be "just" Less compiler :).)

  26. lukeapage commented on Sep 12, 2014

    @lukeapage
    Member

    No problem, I was actually replying to Steve!

  27. stevenvachon commented on Sep 12, 2014

    @stevenvachon
    Author

    😄 I hadn't checked much of the source before saying that. Most everything seems to have been thought of, which is awesome.

  28. lukeapage commented on Oct 19, 2014

    @lukeapage
    Member

    less-plugin-autoprefix is now on npm and works with the (just release) beta v2 of lessc. I've started mentioning autoprefixer in the docs and I hope more people take advantage of how easy it is to use now, even without a build process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions