Emotion: How to use with autoprefixer and set browserlist?

Created on 6 Jan 2018  路  2Comments  路  Source: emotion-js/emotion

I just started using Emotion 9. As my app runs exclusively on the latest version of Chrome, I wanted to use autoprefixer and set the browserlist as such. I couldn't figure out how to do it from searching around in the docs/issues.

All 2 comments

Emotion uses stylis which does not support browserslist and also does not seem to have plans to do so (https://github.com/thysultan/stylis.js/issues/76#issuecomment-346882924). Most of the prefixes are hardcoded in source, as you can see here.

However, if you really wanted to you could probably create an emotion instance and provide a custom prefixer function to just prefix the rules you want to support, see this and this.

Thanks, I set prefix to false.

Was this page helpful?
0 / 5 - 0 ratings