postcss-rtl
postcss-rtl copied to clipboard
postcss-rtl does not support scss but rtlcss can handle.
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
postcss-nested
should take care of your nested rules, just move postcss-rtl
after postcss-nested
and it should work.
Closed as stale, reopen it if needed