Many e-commerce themes claim "RTL ready," yet the moment you switch a store to Arabic ( ar ), slide-out cart drawers jump offscreen, breadcrumbs point backwards, and serif letter-spacing disconnects Arabic characters.
While engineering our bilingual Shopify OS 2.0 and WooCommerce FSE themes at CodeKit Studio, here are the 5 non-negotiable CSS and template rules that eliminated every RTL layout bug:
1. Derive dir Dynamically in layout/theme.liquid
Never hardcode dir="ltr" . Detect RTL locales automatically:
{% assign is_rtl = false %} {% if request . locale . iso_code == 'ar' or request . locale . iso_code == 'he' or request . locale . iso_code == 'fa' %} {% assign is_rtl = true %} {% endif %} <html lang = "{{ request.locale.iso_code }}" dir = "{% if is_rtl %}rtl{% else %}ltr{% endif %}" >
Enter fullscreen mode
Exit fullscreen mode
(In WordPress/WooCommerce FSE block themes, WordPress automatically enqueues rtl.css and loads compiled languages/<domain>-ar.mo whenever Site Language is Arabic.)
2.…