Comments (13)
i've considered adding options, hadn't implemented it yet though. curious though, which option are you looking to pass?
from myth.
I'm looking to pass target browsers, like in the example above. I believe these are the only options autoprefixer accepts.
from myth.
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.
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.
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.
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.
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.
+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.
@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.
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.
@ianstormtaylor Expanded browser names are now supported by Autoprefixer, not sure if that changes your opinion of the API.
from myth.
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.
added in 1.0.0
! thanks
from myth.
Related Issues (20)
- Prefixes not working HOT 1
- Watch @import files HOT 4
- debugger in tests HOT 1
- Support external source maps
- may be the prefix should be add to some css value too? HOT 2
- Add ignore-errors option HOT 1
- Myth Logo? HOT 1
- Passing options, such as paths, to importer HOT 3
- Test suite hangs, then fails HOT 1
- Update rework-import dependency
- What is to be the fate of this project? HOT 8
- Support inline css / Polymer style modules
- Problem with Node 6 HOT 2
- Calc Inaccurate? HOT 2
- Define variables in media queries?
- var not allowed in media (declaration)
- Only for node.js ? HOT 1
- obj.hasOwnProperty is not a function HOT 7
- Is this project still maintained? HOT 2
- myth.io error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from myth.