Autoprefixing / How to handle vendor prefixes #165
Replies: 3 comments 3 replies
-
We originally designed around webpack which lets you apply your own loaders to the generated CSS files, but we'll need to think about how this will be achieved with other bundlers. |
Beta Was this translation helpful? Give feedback.
-
The idea with vanilla-extract is for it to fit seamlessly into any bundler ecosystem and handle CSS the way you would with any other CSS file. Looking into Vite specifically, it seems they support PostCSS out of the box. So to add autoprefixer you just need to add it to your projects PostCSS config. |
Beta Was this translation helpful? Give feedback.
-
Looking specifically at esbuild, it seems only one plugin gets a shot at providing the content for any file - and that content can't be chained on as input to any other plugin. Since the vanilla-extract esbuild plugin provides the content for the virtual css files that seems to be game over for processing the css any further. I think the only option is to copy the vanilla-extract plugin and insert a bit to do the post-css/autoprefixer thing just before returning the css content to esbuild. I'm going to give that a go tomorrow and will likely report back here (unless someone else has already done it or has a better approach?) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to do automatic prefixing available for vanilla-extract? I'm styling a slider and the number of prefixes needed to get any sort of consistency across browsers is painful. If there is a plugin or addon available or it's already implemented and simply not documented or I missed the place where it's explained, please point me to it (I use Vite if that's relevant). Otherwise, it's a feature I would love to see.
Beta Was this translation helpful? Give feedback.
All reactions