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:
parent
8518b5f491
commit
ed0d493a17
3 changed files with 14 additions and 13 deletions
|
@ -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,
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -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 = (() => {
|
||||||
|
const f = [
|
||||||
|
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
|
||||||
|
item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
|
||||||
|
];
|
||||||
if (doc.dir === "rtl") {
|
if (doc.dir === "rtl") {
|
||||||
return [
|
f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"));
|
||||||
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
|
|
||||||
item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"),
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
return [item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)")];
|
|
||||||
}
|
}
|
||||||
|
return f;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
postman(
|
postman(
|
||||||
|
|
|
@ -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 = (() => {
|
||||||
|
const f = [
|
||||||
|
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
|
||||||
|
item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
|
||||||
|
];
|
||||||
if (doc.dir === "rtl") {
|
if (doc.dir === "rtl") {
|
||||||
return [
|
f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"));
|
||||||
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
|
f.push(item.font("Amiri Regular", "url(/fonts/amiri-regular.ttf)"));
|
||||||
item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"),
|
|
||||||
item.font("Amiri Regular", "url(/fonts/amiri-regular.ttf)"),
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
return [item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)")];
|
|
||||||
}
|
}
|
||||||
|
return f;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
postman(
|
postman(
|
||||||
|
|
Loading…
Reference in a new issue