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}
className={classNames(
"flex h-6 w-full justify-center no-underline mb-1 rounded border-accent",
l.direction === "rtl" ? "font-cairo" : "font-kanit",
l.direction,
l.name === locale.name ? "active" : undefined,
)}

View file

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

View file

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