Skip to content

Commit fd11654

Browse files
committed
Add font families configuration to ThemeShowcase component
1 parent 78b7e4a commit fd11654

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

packages/frappe-ui-react/src/components/themeShowCase/ThemeShowcase.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ type RadiusToken = {
3939
value: string;
4040
};
4141

42+
type FontFamilyToken = {
43+
name: string;
44+
value: string;
45+
className: string;
46+
};
47+
4248
// Types for default Tailwind tokens
4349
type DefaultToken = {
4450
name: string;
@@ -948,6 +954,26 @@ const ThemeShowcase: React.FC = () => {
948954
},
949955
];
950956

957+
const fontFamilies: FontFamilyToken[] = [
958+
{
959+
name: "Sans",
960+
value:
961+
"Inter, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
962+
className: "font-sans",
963+
},
964+
{
965+
name: "Serif",
966+
value: "ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif",
967+
className: "font-serif",
968+
},
969+
{
970+
name: "Mono",
971+
value:
972+
"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
973+
className: "font-mono",
974+
},
975+
];
976+
951977
const fontSizes: FontSizeToken[] = [
952978
{
953979
name: "2xs",
@@ -1291,6 +1317,36 @@ const ThemeShowcase: React.FC = () => {
12911317

12921318
{activeTab === "typography" && (
12931319
<div className="typography">
1320+
<h2>Typography</h2>
1321+
1322+
{/* Font Families Section */}
1323+
<h2>Font Families</h2>
1324+
<div className="typography-section">
1325+
<div className="space-y-4">
1326+
{fontFamilies.map((font) => (
1327+
<div
1328+
key={font.name}
1329+
className="p-4 bg-white"
1330+
>
1331+
<div className="flex items-baseline justify-between mb-2">
1332+
<span className="font-semibold text-gray-700">
1333+
{font.name}
1334+
</span>
1335+
<code className="text-xs text-ink-blue-2 font-semibold">
1336+
{font.className}
1337+
</code>
1338+
</div>
1339+
<p
1340+
className={`${font.className} text-2xl text-gray-900 mb-1`}
1341+
>
1342+
The quick brown fox jumps over the lazy dog
1343+
</p>
1344+
<p className="text-xs text-gray-500 mt-2">{font.value}</p>
1345+
</div>
1346+
))}
1347+
</div>
1348+
</div>
1349+
12941350
<h2>Font Sizes</h2>
12951351
<div className="typography-section">
12961352
<h3>Headings</h3>

0 commit comments

Comments
 (0)