babel-plugin-styled-components
babel-plugin-styled-components copied to clipboard
Plugin breaks 'stylis-plugin-rtl' with /* @noflip */ comment when minifying the styles
I am using stylis-plugin-rtl to convert CSS stylesheets between ltr and rtl.
stylis-plugin-rtl plugin internally uses cssjanus to flip the styles.
cssjanus comes with special comment /* @noflip */ to protect a rule from being changed.
Apparently @noflip will not work when using babel-plugin-styled-components with minify: true. I think that's because it will be removed by the plugin as part of the minification process.
So wondering how is it possible to minify the styles and also be able to use /* @noflip */ comment to prevent flipping a rule?
You could probably make a PR against the Babel plugin to not strip that particular comment
Sent from my iPhone
On Jan 15, 2020, at 9:24 AM, cyrus [email protected] wrote:
I am using stylis-plugin-rtl to convert CSS stylesheets between ltr and rtl.
stylis-plugin-rtl plugin internally uses cssjanus to flip the styles.
cssjanus comes with special comment /* @noflip */ to protect a rule from being changed.
Apparently @noflip will not work when using babel-plugin-styled-components with minify: true. I think that's because it will be removed by the plugin as part of the minification process.
So wondering how is it possible to minify the styles and also be able to use /* @noflip */ comment to prevent flipping a rule?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
thanks for the advice, I will look into it when I get a chance.