@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 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`.