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

postcss-rtl does not support scss but rtlcss can handle.

Open zxs2162 opened this issue 3 years ago • 1 comments

If I use rtlcss, it can handle scss file, saying one scss file:

.selector-1 { .selector-2 { Color: black; margin-left: 20px; } }

rtlcss will handle it successfully, but if I use postcss-rtl, it'll report below error:

$postcss -o temp/main.scss -c temp/postcss.config.js temp/app.scss

{ TypeError: Cannot set property 'parent' of undefined at app.scss:1:1 .... postcssNode: Rule { raws: { before: '', between: ' ', semicolon: false, after: '\r\n' }, type: 'rule', nodes: [ [Rule] ], parent: Root { raws: [Object], type: 'root', nodes: [Array], source: [Object], lastEach: 2, indexes: [Object] }, source: { start: [Object], input: [Input], end: [Object] }, selector: '.selector-1', lastEach: 2, indexes: {} } }

my postcss.config.js:

module.exports = { plugins: [ require('postcss-rtl'), require('postcss-import'), require('postcss-cssnext'), require('postcss-nested'), require('postcss-apply'), require('autoprefixer'), ] }

If I remove the line :

require('postcss-rtl'),

everything works.

Thoughts?

Kent

zxs2162 avatar Sep 04 '20 01:09 zxs2162

postcss-nested should take care of your nested rules, just move postcss-rtl after postcss-nested and it should work.

fabercancio avatar Mar 13 '21 22:03 fabercancio

Closed as stale, reopen it if needed

bab2683 avatar Nov 23 '22 07:11 bab2683