elchininet / postcss-rtlcss

PostCSS plugin to automatically build Cascading Style Sheets (CSS) with Left-To-Right (LTR) and Right-To-Left (RTL) rules using RTLCSS
https://elchininet.github.io/postcss-rtlcss/
Apache License 2.0
100 stars 15 forks source link

property "background" is not working with hex color with opacity #368

Closed jieweizheng closed 1 month ago

jieweizheng commented 1 month ago

input:

.a {
    background: #00000080
}

expecting:

[dir="rtl"] .a {
    background: #00000080
}

but getting:

[dir="rtl"] .a {
    background: #000000right 80 top 50%
}

result from playground:

image
elchininet commented 1 month ago

Hi @jieweizheng,

Two things:

  1. That rule should not be modified because it doesn't contain any declaration that should be flipped. So, the only way that you should expect that rule to be prefixed is if you use the safeBothPrefix option.

  2. You should report your issue in the RTLCSS repo (which postcss-rtlcss uses behind the scenes). Insert that rule in the playground and check the result.

If you want to ignore that for now, just add an ignore directive before the rule:

/*rtl:ignore*/
.a {
    background: #00000080;
}

Regards

elchininet commented 1 month ago

Hi @jieweizheng, It is just to update you that the version 5.3.1 contains the last RTLCSS version which fixes your issue. The Playground is updated with the last version.