Skip to content

Commit 029204e

Browse files
committed
fix: fonts
1 parent d518a39 commit 029204e

2 files changed

Lines changed: 38 additions & 51 deletions

File tree

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,36 @@ Import only the CSS custom properties (design tokens) and non-Tailwind styles:
4646
import "cortex-react-components/styles.css";
4747
```
4848

49-
#### Step 2: Extend your Tailwind config with our preset
49+
#### Step 2: Load the Manrope font
50+
51+
This library uses the [Manrope](https://fonts.google.com/specimen/Manrope) font. You need to load it in your application.
52+
53+
**Option A: Google Fonts (HTML)**
54+
55+
Add this to your HTML `<head>`:
56+
57+
```html
58+
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap" rel="stylesheet">
59+
```
60+
61+
**Option B: Next.js (next/font) - Recommended**
62+
63+
```tsx
64+
// app/layout.tsx
65+
import { Manrope } from 'next/font/google';
66+
67+
const manrope = Manrope({ subsets: ['latin'] });
68+
69+
export default function RootLayout({ children }) {
70+
return (
71+
<html lang="en" className={manrope.className}>
72+
<body>{children}</body>
73+
</html>
74+
);
75+
}
76+
```
77+
78+
#### Step 3: Extend your Tailwind config with our preset
5079

5180
```js
5281
// tailwind.config.js or tailwind.config.ts

src/styles.css

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,16 @@
77
* Usage in consuming app:
88
* 1. Import this CSS file: import 'cortex-react-components/styles.css';
99
* 2. Extend your tailwind.config.js with our preset (see package exports)
10+
* 3. Load the Manrope font (e.g., via Google Fonts or self-hosted)
11+
*
12+
* To load Manrope font, add to your HTML head:
13+
* <link href="https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap" rel="stylesheet">
14+
*
15+
* Or in Next.js, use next/font:
16+
* import { Manrope } from 'next/font/google';
17+
* const manrope = Manrope({ subsets: ['latin'] });
1018
*/
1119

12-
/* Font face declarations */
13-
@font-face {
14-
font-family: 'Manrope';
15-
font-style: normal;
16-
font-weight: 400;
17-
src: url('./fonts/Manrope-Regular.ttf') format('truetype');
18-
}
19-
20-
@font-face {
21-
font-family: 'Manrope';
22-
font-style: normal;
23-
font-weight: 300;
24-
src: url('./fonts/Manrope-Light.ttf') format('truetype');
25-
}
26-
27-
@font-face {
28-
font-family: 'Manrope';
29-
font-style: normal;
30-
font-weight: 200;
31-
src: url('./fonts/Manrope-ExtraLight.ttf') format('truetype');
32-
}
33-
34-
@font-face {
35-
font-family: 'Manrope';
36-
font-style: normal;
37-
font-weight: 500;
38-
src: url('./fonts/Manrope-Medium.ttf') format('truetype');
39-
}
40-
41-
@font-face {
42-
font-family: 'Manrope';
43-
font-style: normal;
44-
font-weight: 600;
45-
src: url('./fonts/Manrope-SemiBold.ttf') format('truetype');
46-
}
47-
48-
@font-face {
49-
font-family: 'Manrope';
50-
font-style: normal;
51-
font-weight: 700;
52-
src: url('./fonts/Manrope-Bold.ttf') format('truetype');
53-
}
54-
55-
@font-face {
56-
font-family: 'Manrope';
57-
font-style: normal;
58-
font-weight: 800;
59-
src: url('./fonts/Manrope-ExtraBold.ttf') format('truetype');
60-
}
61-
6220
/* CSS Custom Properties (Design Tokens) */
6321
:root {
6422
--background: 20 14.3% 4.1%;

0 commit comments

Comments
 (0)