Building consumer web applications for North African and Middle Eastern markets comes with two very specific frontend engineering challenges:
- Seamless Bilingual UX (French & Arabic): Users switch constantly between Left-to-Right (LTR) and Right-to-Left (RTL) interfaces, often within the same browsing session.
- WhatsApp-First Link Sharing: Unlike Western markets where email and desktop browsers dominate event communication, almost all link sharing happens inside mobile WhatsApp chats.
While working on Haflaty—a bilingual event directory and digital invitation platform—I had to solve both problems cleanly without bloating the frontend or maintaining duplicate codebases.
Here is a practical guide to the CSS patterns and Open Graph techniques that work reliably in production.
Part 1: Designing True LTR/RTL Interfaces Without Duplicate CSS
A common mistake when adding Arabic support to a French or English web app is writing conditional overrides everywhere (e.g., .is-rtl .card { margin-left: 0; margin-right: 1rem; }). That approach doubles your CSS surface area and guarantees visual bugs whenever new components are added.
1. Switch Entirely to CSS Logical Properties
Modern browsers have full support for CSS Logical Properties, which map layout directions relative to the document's writing flow (start and end) rather than physical screen edges (left and right).
Instead of physical properties, standardize your components on logical equivalents:
| Physical Property (Avoid) | Logical Property (Use) | Behavior in LTR / RTL |
|---|---|---|
margin-left / margin-right | margin-inline-start / margin-inline-end | Flips automatically |
padding-left / padding-right | padding-inline-start / padding-inline-end | Flips automatically |
border-left | border-inline-start | Flips automatically |
text-align: left | text-align: start | Aligns left in FR, right in AR |
left: 0 / right: 0 | inset-inline-start: 0 / inset-inline-end: 0 | Mirrors positioned badges/icons |
When the root HTML tag toggles between dir="ltr" and dir="rtl", the entire layout mirrors itself naturally with zero extra CSS rules:
.feature-card { display: flex; align-items: center; gap: 1rem; padding-inline-start: 1.25rem; border-inline-start: 3px solid currentColor; text-align: start; } 2. Typography Scaling Between Latin and Arabic Scripts
Even with identical font-size values, Arabic typography visually renders smaller and denser than Latin characters due to diacritics and vertical ascenders/descenders.
To keep visual hierarchy balanced across both languages:
- Increase base line-height for Arabic: Use
line-height: 1.7or1.8for Arabic body copy compared to1.5for French. - Adjust font-size slightly: Bumping Arabic font sizes by
5%–8%via a CSS custom property (--font-scale) keeps headings and buttons equally legible across both locales. - Avoid strict uppercase transforms:
text-transform: uppercasehas no effect on Arabic script, so avoid relying on all-caps alone to establish visual hierarchy in navigation or badges.
3. Handling Directional vs. Universal Icons
Not every SVG icon should flip in RTL mode:
- Flip directional icons: Back arrows, chevrons, and progress indicators should mirror horizontally (
transform: scaleX(-1)in RTL). - Never flip universal icons: Checkmarks, clocks, search magnifying glasses, camera icons, and location pins must remain unflipped regardless of language direction.
Part 2: Optimizing Link Previews for WhatsApp Mobile Sharing
When building interactive web tools—such as the browser-based digital invitation creator in Haflaty Studio—the user's journey rarely ends on your website. The moment a user finishes creating or finding something, their next action is copying the URL and pasting it into WhatsApp.
If your Open Graph metadata is static or misconfigured, WhatsApp either displays a broken gray box or shows a generic homepage thumbnail that hurts click-through rates.
1. Strict Open Graph Rules for WhatsApp's Crawler
WhatsApp's link preview parser is much stricter than desktop social networks. To guarantee that rich preview cards render every time:
- Keep
og:imageunder 300 KB: Heavy PNGs often fail to render on mobile data connections. Serve compressed JPEG or WebP images (1200x630pxor800x418px). - Use absolute HTTPS URLs: Relative paths like
/images/preview.jpgare ignored by WhatsApp's scraper. Always output fullhttps://...URLs. - Include explicit dimensions: Always declare
og:image:widthandog:image:heightso the preview card renders immediately without waiting for image headers.
<meta property="og:type" content="website" /> <meta property="og:title" content="Custom Event Invitation" /> <meta property="og:description" content="Date, Location & Event Details" /> <meta property="og:image" content="[https://example.com/preview-card.jpg](https://example.com/preview-card.jpg)" /> <meta property="og:image:width" content="1200" /> <meta property="og:image:height" content="630" /> 2. Designing for WhatsApp's In-App Browser
Most mobile users tap links directly inside WhatsApp, which opens pages in an embedded WebView rather than their primary browser. A few subtle adjustments prevent common WebView friction:
- Use
100dvhinstead of100vh: Embedded browsers have dynamic top and bottom toolbars. Using dynamic viewport units (min-height: 100dvh) prevents bottom action buttons from getting cut off. - Support native external intents: Links for maps directions (
https://maps.google.com/...) or calendar downloads should trigger clean system handoffs so users don't get stuck inside a restricted WebView. - Respect
prefers-reduced-motion: Keep entrance animations lightweight and GPU-accelerated (transformandopacityonly) so lower-end Android devices render smooth transitions instantly.
Summary Checklist for Bilingual & Mobile-First Apps
If you are building web applications targeting multilingual or mobile-messaging audiences, keeping these fundamentals in place early saves significant refactoring later:
- Adopt logical CSS properties (
inline-start/inline-end) from the first component. - Tune Arabic line-height and font scaling separately from Latin typography.
- Keep Open Graph preview images lightweight (
< 300 KB) with absolute HTTPS URLs. - Test every critical user flow inside WhatsApp's embedded mobile browser, not just Chrome DevTools.
How do you handle multi-directional layouts or mobile link previews in your projects? Feel free to share your tips in the comments!