Apply Amiri font for Farsi
Some checks are pending
The Quran / ci (push) Waiting to run

This commit is contained in:
0x1eef 2024-10-04 12:52:02 -03:00
parent 4146973cf6
commit 265b580a08
3 changed files with 11 additions and 4 deletions

View file

@ -2,6 +2,12 @@
* vNEXT * vNEXT
** Apply Amiri font for Farsi
Similar to Arabic - apply the Amiri Regular font for the content
of a surah. With this change the distinction is more so between a
RTL language vs a LTR language rather than between Arabic vs English
vs Farsi
** Center-align ~ul.body.stream~ ** Center-align ~ul.body.stream~
For RTL languages we will show the content of a surah centered, For RTL languages we will show the content of a surah centered,
and within a max width of 470px and within a max width of 470px

View file

@ -19,7 +19,7 @@ body .root .content.theme {
} }
body .root .content.theme.rtl { body .root .content.theme.rtl {
ul.body.stream[lang="ar"] { ul.body.stream {
li.ayah p { li.ayah p {
@extend .font-amiri; @extend .font-amiri;
} }

View file

@ -22,6 +22,7 @@ export function Stream({
}: Props) { }: Props) {
const className = endOfStream || isPaused ? ["scroll-y"] : []; const className = endOfStream || isPaused ? ["scroll-y"] : [];
const isArabic = locale.name === "ar"; const isArabic = locale.name === "ar";
const isRTL = locale.direction === "rtl";
const ref = useRef<HTMLUListElement>(null); const ref = useRef<HTMLUListElement>(null);
const ul = useMemo<JSX.Element>(() => { const ul = useMemo<JSX.Element>(() => {
return ( return (
@ -38,8 +39,8 @@ export function Stream({
<li <li
key={ayah.id} key={ayah.id}
className={classNames("ayah fade", { className={classNames("ayah fade", {
"mb-8": isArabic, "mb-8": isRTL,
"mb-5": !isArabic, "mb-5": !isRTL,
})} })}
> >
<span className="flex h-8 items-center color-primary"> <span className="flex h-8 items-center color-primary">
@ -63,7 +64,7 @@ export function Stream({
</span> </span>
<p <p
className={classNames("m-0 color-accent", { className={classNames("m-0 color-accent", {
"text-2xl mt-5": isArabic, "text-2xl mt-5": isRTL,
})} })}
> >
{ayah.body} {ayah.body}