GithubHelp home page GithubHelp logo

Comments (13)

ianstormtaylor avatar ianstormtaylor commented on June 11, 2024

i've considered adding options, hadn't implemented it yet though. curious though, which option are you looking to pass?

from myth.

cvn avatar cvn commented on June 11, 2024

I'm looking to pass target browsers, like in the example above. I believe these are the only options autoprefixer accepts.

from myth.

ianstormtaylor avatar ianstormtaylor commented on June 11, 2024

oh yeah sorry, i just meant whats the browser support you are trying to achieve? and for what reason? :) just trying to understand the use case to see if there's a good way to handle it with an abstraction

from myth.

cvn avatar cvn commented on June 11, 2024

This is what I currently use: 'last 2 versions', 'ff 15', 'ios 3.2', 'android 2.3', 'ie 8'

Mostly this gives me more old -moz and -webkit properties, and enables support on older gear (older iOS and Android devices, old builds of firefox bundled with CentOS, etc). Since autoprefixer makes maintaining these additional prefixes more or less free, I figure why not.

from myth.

necolas avatar necolas commented on June 11, 2024

yeah, that's something we (twitter) wanted and provided for in rework-suit. pretty handy, especially if you need a more explicit support matrix that the autoprefixer defaults.

from myth.

ianstormtaylor avatar ianstormtaylor commented on June 11, 2024

yeah might not be able to get out of it then. it definitely makes sense. i just wish the abbreviations for browser names were expanded. i think thats the part that makes me think the api is ugly and makes me want to avoid it

from myth.

ianstormtaylor avatar ianstormtaylor commented on June 11, 2024

k im thinking the api would be:

myth(css, { 
  browsers: [] 
});

since that leaves us open for stuff like:

myth(css, { 
  browsers: [],
  compress: true
});

and the rework exposed function could even take the same ones too:

myth({ 
  browsers: [],
  compress: true
});

from myth.

basiclines avatar basiclines commented on June 11, 2024

+1 to this feature, if want to generate my css files only for modern browsers i might don't want calc() expression to be generated as a plain amount in px

from myth.

cvn avatar cvn commented on June 11, 2024

@basiclines this issue doesn't affect calc() translation. This is specifically for autoprefixer, which only controls vendor prefixes, e.g. -webkit-, -moz-, etc.

from myth.

jimkang avatar jimkang commented on June 11, 2024

Another +1. Here's my use case: When I use "display: flex", I do not want "display: -webkit-box" added. -webkit-box applies on iOS 6 Safari and older, however, in my case, it just makes things worse because it doesn't implement any form of flex-wrap. I'd rather just not have it at all.

from myth.

cvn avatar cvn commented on June 11, 2024

@ianstormtaylor Expanded browser names are now supported by Autoprefixer, not sure if that changes your opinion of the API.

from myth.

gasolin avatar gasolin commented on June 11, 2024

FYI, adobe resin (also based on rework) allows to pass browsers option while calling the function
https://github.com/topcoat/resin

output = resin({
    // Pass it a css file to process
    src: 'src/entry.css',
    // Tell it what browsers to prefix for
    browsers: ['last 1 version', 'ios', 'android 4'] 
});

write('path/to/output/dir/filename.css', output);

compare to myth

var css = fs.readFileSync('index.css', 'utf8');
var output = myth(css);

fs.writeFileSync('converted.css', output);

I'd prefer resin-like API instead of

myth(css, { 
  browsers: [],
  compress: true
});

from myth.

ianstormtaylor avatar ianstormtaylor commented on June 11, 2024

added in 1.0.0! thanks

from myth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.