node-cssjanus
node-cssjanus copied to clipboard
Gradients in 'background' flipped incorrectly
Hi,
First of all let me thank you for doing a great work. You project made implementing an RTL version of our project much easier. But I did encounter a small issue when flipping gradients: for some reason if the start position is set to "0%" it is changed to "100%". Just "0" remains unchanged as expected.
Here's an example https://cssjanus.github.io/#input/div%20%7B%0A%20%20background%3A%20linear-gradient(to%20left%2C%20%2300ff00%200%25%2C%20%23ff0000%20100%25)%3B%0A%20%20background%3A%20linear-gradient(to%20left%2C%20%2300ff00%200%2C%20%23ff0000%20100%25)%3B%0A%7D
Through trial-and-error I've narrowed this down to the background property. When using background-image the bug does not occur. Presumably one of the pattern matchers for background-position is interfering.
https://cssjanus.github.io/#input/div%20%7B%0A%20%20background%3A%20linear-gradient(to%20left%2C%20%2300ff00%200%25%2C%20%23ff0000%20100%25)%3B%0A%20%20background%3A%20linear-gradient(to%20left%2C%20%2300ff00%200%2C%20%23ff0000%20100%25)%3B%0A%0A%20%20background-image%3A%20linear-gradient(to%20left%2C%20%2300ff00%200%25%2C%20%23ff0000%20100%25)%3B%0A%20%20background-image%3A%20linear-gradient(to%20left%2C%20%2300ff00%200%2C%20%23ff0000%20100%25)%3B%0A%7D
As workaround, I recommend setting the background via a separate background-image declaration instead.
(Just pointing out that this is one of the bugs that are fixed in #36 .)
Exported to https://phabricator.wikimedia.org/T333273.