@swift-rust/font 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/google.d.ts +2076 -0
- package/dist/google.d.ts.map +1 -0
- package/dist/google.js +4163 -0
- package/dist/google.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/local.d.ts +106 -0
- package/dist/local.d.ts.map +1 -0
- package/dist/local.js +194 -0
- package/dist/local.js.map +1 -0
- package/dist/smoke.test.d.ts +2 -0
- package/dist/smoke.test.d.ts.map +1 -0
- package/dist/smoke.test.js +6 -0
- package/dist/smoke.test.js.map +1 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @swift-rust/font
|
|
2
|
+
|
|
3
|
+
The font component. Resolves Google Fonts and local fonts, generates `className` and CSS variable names that the bundler uses to wire up `@font-face` declarations at build time.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
### Google
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Inter } from "swift-rust/font/google";
|
|
11
|
+
|
|
12
|
+
const inter = Inter({ subsets: ["latin"], display: "swap" });
|
|
13
|
+
|
|
14
|
+
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
15
|
+
return <html className={inter.className}><body>{children}</body></html>;
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> Or import from `@swift-rust/font` directly.
|
|
20
|
+
|
|
21
|
+
### Local
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import localFont from "swift-rust/font/local";
|
|
25
|
+
const myFont = localFont({ src: "./fonts/MyFont.woff2" });
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Available Google families
|
|
29
|
+
|
|
30
|
+
`Inter`, `Roboto`, `Poppins`, `Manrope`, `IBM Plex Sans`, `JetBrains Mono`. Add your own by exporting from `@swift-rust/font/google`.
|