postcss-rtl icon indicating copy to clipboard operation
postcss-rtl copied to clipboard

Class names with Left/Right

Open mharsat opened this issue 4 years ago • 2 comments

Class names in which the name contains the words left or right are translated in the following manner:

Input:

.arrowLeft {
  margin-right: -3px;
}

Output:

[dir=ltr] :export {
  alignLeft: ***_marginRight_***; }

[dir=rtl] :export{
  alignLeft: ***_marginLeft_***; }

mharsat avatar Aug 11 '19 09:08 mharsat

I can't reproduce it, and add test for you case.

If the issue is still actual, can you provide your postcss/webpack-config?

vkalinichev avatar Aug 24 '19 11:08 vkalinichev

We are using rollup with with rollup-plugin-postcss for postcss with the following configuration

  postcss({
    minimize: {
      reduceIdents: false,
      safe: true,
    },
    modules: {
      generateScopedName: IS_DEV_ENV ? '[name]__[local]___[hash:base64:5]' : '[hash:base64:5]',
    },
    extract: 'dist/styles.min.css',
    plugins: [
      postcssExclude({
        filter: ['**/*.global.scss', '**/inline-toolbar.scss'],
        plugins: [postcssRTL()],
      }),
      postcssURL({
        url: asset => asset.url.replace('../', '/statics/'),
      }),
    ],
  })

mharsat avatar Aug 26 '19 12:08 mharsat