Closed ntf closed 7 years ago
I found that properties with !important is generating [dir=rtl] rule with !important !important which is not expected.
!important
!important !important
Affected version : 0.5.9
test script:
const rtl = require('postcss-rtl'); const postcss = require('postcss'); const css = '.test{margin-left:0 !important;padding-left:0 !important}'; const rtlcss = require('rtlcss'); console.log('rtlcss', rtlcss.process(css)); const processor = postcss([rtl()]); processor.process(css) .then((result) => console.log('postcss-rtl', result.css));
Input
.test{margin-left:0 !important;padding-left:0 !important}
Output of rtlcss ( expected output ):
.test{margin-right:0 !important;padding-right:0 !important}
Output of postcss + postcss-rtl:
[dir=ltr] .test { margin-left:0 !important; padding-left:0 !important } [dir=rtl] .test { margin-right:0 !important !important; padding-right:0 !important !important }
I am having this issue as well.
Fixed by @ntf (#14) and published as v0.5.10!
I found that properties with
!important
is generating [dir=rtl] rule with!important !important
which is not expected.Affected version : 0.5.9
test script:
Input
Output of rtlcss ( expected output ):
Output of postcss + postcss-rtl: