Menu

5 CSS & Liquid Rules for Building a True Bilingual Arabic (RTL) Shopify & WooCommerce Storefront
📰

5 CSS & Liquid Rules for Building a True Bilingual Arabic (RTL) Shopify & WooCommerce Storefront

DEV Community: css·Andrew Zachary·8 days ago
#KSLNyHX9
#devtocss#devto#dev#theme#arabic
Long article (448 words) — no AI summary yet.
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.