node-cssjanus icon indicating copy to clipboard operation
node-cssjanus copied to clipboard

Gradients in 'background' flipped incorrectly

Open jelisejev opened this issue 10 years ago • 2 comments

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

jelisejev avatar Mar 17 '15 12:03 jelisejev

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.

Krinkle avatar Aug 29 '15 00:08 Krinkle

(Just pointing out that this is one of the bugs that are fixed in #36 .)

YairRand avatar Jun 19 '18 05:06 YairRand