After updating to 2.6.0.beta6, users reported that the user card does not open on mobile in RTL environments, while it works fine on desktop. The issue was traced to a bug in the R2 CSS compiler, which mishandles certain linear-gradient patterns involving CSS variables and stops, causing subsequent CSS rules (like those for the user card) to be rendered incorrectly. Johani identified the root cause and provided a fix by simplifying the gradient syntax, submitting a PR to resolve the issue. nildarar confirmed the problem and thanked the contributor for the detailed explanation and solution.
After updating to 2.6.0.beta6 (3e1b94c227), the user card will not open on the mobile. I tested in meta and there was no problem. Maybe because our discourse is RTL, this problem has occurred.
We do not have a problem on the desktop, but on the mobile phone, tapping on the user’s image does not open the card, but by tapping again, we enter the profile.
There is no error log …
I did the test with a default template without any components.
I can reproduce this issue. It looks like a bug in R2.
If the :rtl option is passed to the compiler, it runs the CSS through R2, and it does the magic RTL changes.
This works great, but for some reason, we seem to be hitting an edge case where it returns jumbled CSS. We use a pattern for creating a fade effect for mobile nav menus, and it looks like this.
This is not the only place where we use it; it’s just an example.
It seems like this pattern is more than R2 can handle. We’re calling an RGBA function and passing a CSS variable to it, and then we also add a stop.
When this is passed through R2, it returns something like this.