[openstreetmap/openstreetmap-website] Consider dropping r2 (Issue #3433)
Andy Allan
notifications at github.com
Thu Jan 20 14:12:43 UTC 2022
I'm saying "consider" here since I haven't researched enough to check that it's fully feasible.
We use https://github.com/ded/R2 (technically https://github.com/mzsanford/R2rb ) for generating an RTL version of our CSS, with all the `left` swapped to `right` etc.
However, with modern approaches to CSS and grid layouts, we might be able to drop the need for this altogether. Rather than e.g. float-left for user icons, I've been refactoring to use grid layouts where the first item comes first, and that's either left or right depending on the text direction. That approach makes the layout happen correctly automatically, without needing two CSS files for the different text directions. Understanding our direction-dependent CSS stuff is additional overhead for new developers.
So we need to work through our CSS file, and remove any mentions of left and right (and any asymmetrical `padding` or `margin` combined declarations). See also #3432.
(We also need to remove any direction-dependent margin and padding bootstrap classes that have crept in to use, of which there are a couple, but these aren't affected by r2 so can be dealt with separately).
At that point, the only direction-dependent declarations will be things like icon-maps, which are surrounded by `no-r2` comments. If we make it to that point, then r2 can be dropped.
After this, anything needing left or right can be dealt with by using CSS or grid concepts of start and end, and these will work regardless of text direction.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3433
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/3433 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220120/589ce3e2/attachment-0001.htm>
More information about the rails-dev
mailing list