@m3ui-vue/m3ui-vue 0.8.1 → 0.8.3

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 CHANGED
@@ -38,7 +38,7 @@ pnpm add @m3ui-vue/m3ui-vue
38
38
 
39
39
  ```html
40
40
  <link
41
- href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap"
41
+ href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Mono:wght@400&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap"
42
42
  rel="stylesheet"
43
43
  />
44
44
  ```
@@ -53,7 +53,39 @@ pnpm add material-symbols
53
53
  @import 'material-symbols/outlined.css';
54
54
  ```
55
55
 
56
- `material-symbols` is listed as an optional peer dependency for this reason. Note this only covers the icon font — if you want `Roboto` offline too, pair it with something like `@fontsource/roboto`.
56
+ `material-symbols` is listed as an optional peer dependency for this reason. For the text fonts, [`@fontsource/roboto`](https://www.npmjs.com/package/@fontsource/roboto) and [`@fontsource/roboto-mono`](https://www.npmjs.com/package/@fontsource/roboto-mono) do the same job:
57
+
58
+ ```bash
59
+ pnpm add @fontsource/roboto @fontsource/roboto-mono
60
+ ```
61
+
62
+ ```css
63
+ @import '@fontsource/roboto/400.css';
64
+ @import '@fontsource/roboto/500.css';
65
+ @import '@fontsource/roboto/700.css';
66
+ @import '@fontsource/roboto-mono/400.css';
67
+ ```
68
+
69
+ Roboto isn't required — without it, text falls back to `system-ui`.
70
+
71
+ #### Using a different font
72
+
73
+ Every component reads its typeface from two tokens in `theme.css`: `--font-sans` (default `'Roboto', system-ui, …`) and `--font-mono` (default `'Roboto Mono', ui-monospace, …`, used by `MCodeEditor` and `MMarkdown` code). Override them after importing the theme, and load the font yourself (CDN, `@fontsource/*`, or your own `@font-face`):
74
+
75
+ ```css
76
+ @import '@m3ui-vue/m3ui-vue/theme';
77
+
78
+ @theme {
79
+ --font-sans: 'Inter', system-ui, sans-serif;
80
+ --font-mono: 'JetBrains Mono', ui-monospace, monospace;
81
+ }
82
+ ```
83
+
84
+ To switch at runtime, set the variable on `<html>` — components (including `MChart`'s canvas) pick it up live:
85
+
86
+ ```ts
87
+ document.documentElement.style.setProperty('--font-sans', "'Inter', system-ui, sans-serif")
88
+ ```
57
89
 
58
90
  ### CSS
59
91