Skip to content

Instantly share code, notes, and snippets.

@LumberJaxolotl
Last active March 21, 2024 19:50
Show Gist options
  • Save LumberJaxolotl/d4ae008dadef3e5e5500564c9c7f63dd to your computer and use it in GitHub Desktop.
Save LumberJaxolotl/d4ae008dadef3e5e5500564c9c7f63dd to your computer and use it in GitHub Desktop.
CSS rule that scales text of any content using arabic-script. Works with an exaustive list of languages that use arabic-based scripts or have arabic-script varients.
/* scales-up any text using arabic-script for improved legibility */
*:is(:lang(ar), :lang(fa), :lang(fa-AF), :lang(tg), :lang(ur), :lang(ps), :lang(ckb), :lang(ug), :lang(ks), :lang(skr), :lang(bal), :lang(sd), :lang(ota-Arab), :lang(kk-Arab), :lang(ky-Arab), :lang(az-Arab), :lang(tk-Arab), :lang(uz-Arab), :lang(pa-Arab), :lang(ms-Arab), :lang(tt-Arab), :lang(ha-Arab), :lang(ff-Arab), :lang(kr-Arab), :lang(wo-Arab), :lang(bm-Arab), :lang(tmh-Arab), :lang(yo-Arab), :lang(ig-Arab), :lang(sw-Arab), :lang(so-Arab)) {
font-size: 1.2em;
}
/*
Languages supported:
ar - Arabic
fa - Persian
fa-AF - Dari (Afghan Persian)
tg - Tajik
ur - Urdu
ps - Pashto
ckb - Central Kurdish
ug - Uighur
ks - Kashmiri
skr - Saraiki
bal - Baluchi
sd - Sindhi
ota-Arab - Ottoman Turkish (Arabic script)
kk-Arab - Kazakh (Arabic script)
ky-Arab - Kyrgyz (Arabic script)
az-Arab - Azerbaijani (Arabic script)
tk-Arab - Turkmen (Arabic script)
uz-Arab - Uzbek (Arabic script)
pa-Arab - Punjabi (Shahmukhi script)
ms-Arab - Malay (Jawi script)
tt-Arab - Tatar (Arabic script)
ha-Arab - Hausa (Ajami script)
ff-Arab - Fula (Ajami script)
kr-Arab - Kanuri (Ajami script)
wo-Arab - Wolof (Ajami script)
bm-Arab - Bambara (Ajami script)
tmh-Arab - Tamashek (Ajami script)
yo-Arab - Yoruba (Ajami script)
ig-Arab - Igbo (Ajami script, hypothetical as Igbo traditionally does not use Arabic script)
sw-Arab - Swahili (Arabic script)
so-Arab - Somali (Arabic script)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment