Mistakes, then lessons: a bug I hit while building this site
Mistakes, then lessons · · 1 min read
While building this site, I wrote a style that adds space to the left of an element, using the ml-4 property. It looked right on the screen in front of me, because the page was in Arabic and read right-to-left, so the layout happened to look fine by coincidence, not by correctness.
When I opened the English version of the same page, the mistake showed itself: the space stayed on the left in both directions, so the English layout ended up different from the Arabic one, even though it was the exact same style.
I went back to the rule I'd written for myself: no ml- or mr-, but ms- and me- — the properties that follow the start and end of the line, not its fixed left and right. I changed the property, and the layout matched again in both directions.
The lesson was simple: what looks correct in one language can be a hidden mistake in another, and there's no way to see it except by actually testing both directions, not assuming they'll match.