Skip to content

Commit

Permalink
Use system brush font when available, ensure ruby text aligned center
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsilvestre committed Feb 12, 2024
1 parent a6c4798 commit 6427399
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ body {
text-wrap: balance;
}
}

rt {
text-align: center;
}
8 changes: 6 additions & 2 deletions src/app/texts/[textId]/ChineseWithPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ export function ChineseWithPopover({
const entries = vocab[char];

if (!entries?.length) {
return <span key={i}>{char}</span>;
return (
<span key={i} className="font-brush">
{char}
</span>
);
}

const enGloss = gloss?.[glossIndex]?.replace(/_/g, " ") || null;
Expand Down Expand Up @@ -94,7 +98,7 @@ export function ChineseWithPopover({
})}
>
<ruby>
{char}
<span className="font-brush">{char}</span>
<RubyText
enGloss={enGloss}
char={char}
Expand Down
20 changes: 19 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Config } from "tailwindcss";
import { colors } from "tailwindcss/defaultTheme";
import { colors, fontFamily } from "tailwindcss/defaultTheme";

const config: Config = {
content: [
Expand All @@ -14,6 +14,24 @@ const config: Config = {
foreground: "rgb(var(--foreground-rgb))",
background: "rgb(var(--background-rgb))",
},
fontFamily: {
brush: [
"Free HK Kai",
"tw-kai",
"STKaiti",
"SimKai",
"KaiTi",
"KaiU",
"DFKai-SB",
"BiauKai",
"Han-Nom Khai",
"kaisho",
"yukyokasho",
"uc digi kyokasho",
"kyokasho",
...fontFamily.sans,
],
},
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
Expand Down

0 comments on commit 6427399

Please sign in to comment.