Skip to content

Commit b244ed4

Browse files
authored
Merge pull request #63 from rtCamp/enhance/font-family
Enhancement: Add font family section
2 parents 66131bb + fd11654 commit b244ed4

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
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>

tailwind.config.cjs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,34 @@ module.exports = {
88
theme: {
99
extend: {
1010
fontFamily: {
11-
sans: ["Inter", "ui-sans-serif", "system-ui", "sans-serif"],
11+
sans: [
12+
"Inter",
13+
"ui-sans-serif",
14+
"system-ui",
15+
"sans-serif",
16+
'"Apple Color Emoji"',
17+
'"Segoe UI Emoji"',
18+
'"Segoe UI Symbol"',
19+
'"Noto Color Emoji"',
20+
],
21+
serif: [
22+
"ui-serif",
23+
"Georgia",
24+
"Cambria",
25+
'"Times New Roman"',
26+
"Times",
27+
"serif",
28+
],
29+
mono: [
30+
"ui-monospace",
31+
"SFMono-Regular",
32+
"Menlo",
33+
"Monaco",
34+
"Consolas",
35+
'"Liberation Mono"',
36+
'"Courier New"',
37+
"monospace",
38+
],
1239
},
1340
colors: {
1441
inherit: "var(--color-inherit)",

0 commit comments

Comments
 (0)