Apply font to Select.Option elements

Based on whether or not the element is for a RTL or LTR language
This commit is contained in:
0x1eef 2024-10-02 00:32:55 -03:00
parent 8518b5f491
commit ed0d493a17
3 changed files with 14 additions and 13 deletions

View file

@ -17,6 +17,7 @@ export function LanguageSelect({ locale }: Props) {
key={i} key={i}
className={classNames( className={classNames(
"flex h-6 w-full justify-center no-underline mb-1 rounded border-accent", "flex h-6 w-full justify-center no-underline mb-1 rounded border-accent",
l.direction === "rtl" ? "font-cairo" : "font-kanit",
l.direction, l.direction,
l.name === locale.name ? "active" : undefined, l.name === locale.name ? "active" : undefined,
)} )}

View file

@ -11,14 +11,14 @@ import { formatNumber } from "~/lib/t";
.querySelector("meta[name='revision']")! .querySelector("meta[name='revision']")!
.getAttribute("content")!; .getAttribute("content")!;
const fonts = (() => { const fonts = (() => {
if (doc.dir === "rtl") { const f = [
return [
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"), item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"), item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
]; ];
} else { if (doc.dir === "rtl") {
return [item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)")]; f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"));
} }
return f;
})(); })();
postman( postman(

View file

@ -12,15 +12,15 @@ import { formatNumber } from "~/lib/t";
.querySelector("meta[name='revision']")! .querySelector("meta[name='revision']")!
.getAttribute("content")!; .getAttribute("content")!;
const fonts = (() => { const fonts = (() => {
if (doc.dir === "rtl") { const f = [
return [
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"), item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"), item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
item.font("Amiri Regular", "url(/fonts/amiri-regular.ttf)"),
]; ];
} else { if (doc.dir === "rtl") {
return [item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)")]; f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"));
f.push(item.font("Amiri Regular", "url(/fonts/amiri-regular.ttf)"));
} }
return f;
})(); })();
postman( postman(