Currently the CSS will be autoprefixed to support as far as IE8. We need to be able to customize the browser target to reduce any extra code we don't need.
Perhaps we should switch to PostCSS instead of stylis as the parser so we have finer control over the extraction.
With stylis it's not configurable?
@thymikee doesn't look like that - https://github.com/thysultan/stylis.js
How about switching to PostCSS? We're already using it to extract critical CSS.
What's more, we could make Linaria work by default with Stylis, and as soon as one wants finer control over outputted CSS, switch to PostCSS.
Closing this in favour of #142. There is nothing we can do about stylis. With custom preprocessor (eg PostCss) this will be achievable.
Stylis now has an option disable vendor prefixing with stylis.set({ prefix: false }). We should also expose the option prefix: false in our babel preset to disable vendor prefixing. For fine grained control over prefixing, consumers can use a tool like autoprefixer.
We should allow to write custom preprocessor for advanced use cases, exposing each stylis option in babel preset is not a good idea.
Not suggesting to expose each stylis option. Disabling auto-prefixing is a common enough case and needed to avoid shipping more code than necessary to the browsers.
Custom pre-processor is nice, but will require too much setup for just disabling prefixing.
Just adding the following to my webpack configuration file seems to have done the trick for me:
import stylis from 'stylis'
stylis.set({ prefix: false })
Not sure why this issue is closed, since it was not fixed and there is still no easy way to disable this annoying auto-prefixing provided by linaria by default. I shouldn't have to use change the pre-processor to achieve that, imo.
@buzinas you should be able to do this in your webpack config:
const stylis = require('stylis');
...
stylis.set({ prefix: false });
Yep, that's what I did… Thanks, @satya164!
Most helpful comment
Just adding the following to my webpack configuration file seems to have done the trick for me: