uniweb 0.12.44 → 0.12.45
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/package.json +6 -6
- package/partials/agents.md +49 -10
- package/src/framework-index.json +7 -7
- package/templates/site/theme.yml +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.45",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"js-yaml": "^4.1.0",
|
|
42
42
|
"prompts": "^2.4.2",
|
|
43
43
|
"tar": "^7.0.0",
|
|
44
|
-
"@uniweb/
|
|
45
|
-
"@uniweb/
|
|
46
|
-
"@uniweb/runtime": "0.8.
|
|
44
|
+
"@uniweb/kit": "0.9.23",
|
|
45
|
+
"@uniweb/core": "0.7.19",
|
|
46
|
+
"@uniweb/runtime": "0.8.25"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@uniweb/build": "0.14.26",
|
|
50
49
|
"@uniweb/content-reader": "1.1.12",
|
|
51
|
-
"@uniweb/semantic-parser": "1.1.17"
|
|
50
|
+
"@uniweb/semantic-parser": "1.1.17",
|
|
51
|
+
"@uniweb/build": "0.14.27"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"@uniweb/build": {
|
package/partials/agents.md
CHANGED
|
@@ -1013,17 +1013,19 @@ Font families are a **site** setting, configured in `theme.yml` under `fonts:`.
|
|
|
1013
1013
|
|---|---|---|
|
|
1014
1014
|
| `body` | `body` (all text by default) | paragraphs, UI |
|
|
1015
1015
|
| `heading` | `h1, h2, h3` | titles |
|
|
1016
|
-
| `
|
|
1016
|
+
| `code` | `code, pre, kbd, samp` | code, monospace |
|
|
1017
1017
|
|
|
1018
1018
|
```yaml
|
|
1019
1019
|
# site/theme.yml
|
|
1020
1020
|
fonts:
|
|
1021
1021
|
body: "Inter, system-ui, sans-serif"
|
|
1022
1022
|
heading: "Poppins, system-ui, sans-serif"
|
|
1023
|
-
|
|
1023
|
+
code: "'Fira Code', monospace"
|
|
1024
1024
|
```
|
|
1025
1025
|
|
|
1026
|
-
|
|
1026
|
+
(`code` was previously named `mono`; `fonts.mono` is no longer an alias — rename it to `fonts.code`.)
|
|
1027
|
+
|
|
1028
|
+
Because the site wires the families onto real elements, **the norm is that a foundation doesn't set fonts itself** — render semantic markup (`<H1>`, `<P>`, `<code>` from the kit) and the roles apply. (It stays Tailwind for everything else — layout, spacing, weights, color.) That convention is what authors can count on: `body`/`heading`/`code` control the fonts the same way in every foundation, and one foundation re-fonts per site with zero code changes.
|
|
1027
1029
|
|
|
1028
1030
|
**Loading the files** — two site-side options, both config-only, neither adds a dependency:
|
|
1029
1031
|
|
|
@@ -1046,27 +1048,64 @@ fonts:
|
|
|
1046
1048
|
- { family: "Söhne", src: /fonts/soehne-regular.woff2, weight: 400 }
|
|
1047
1049
|
```
|
|
1048
1050
|
|
|
1049
|
-
**In a component, weight is yours; family is the site's.** Weight / size / style utilities (`font-bold`, `font-black`, `italic`, `text-xl`) are ordinary design vocabulary — use them freely. A font-**family** utility is
|
|
1051
|
+
**In a component, weight is yours; family is the site's.** Weight / size / style utilities (`font-bold`, `font-black`, `italic`, `text-xl`) are ordinary design vocabulary — use them freely. A font-**family** utility is a different matter: `font-sans` / `font-serif` resolve to Tailwind's built-in stacks unless the foundation makes them site-controlled (below), so a bare `font-serif` in a component silently hardcodes a typeface.
|
|
1050
1052
|
|
|
1051
|
-
**When a design needs typefaces the
|
|
1053
|
+
**When a design needs typefaces the three roles can't express** — an editorial serif on selected prose, a display face for hero titles, a decorative mono for metadata labels that aren't `<code>` — a foundation declares each as a **typed font var** in `main.js`. Marking it `type: 'font'` is what makes it a *typeface* rather than a generic value: the family loads (via the site's `fonts.import` / `fonts.faces`), it appears in the foundation's schema tagged as a font so the site — and the visual editor's theme panel — can set it, and the family stays site-controlled.
|
|
1052
1054
|
|
|
1053
1055
|
```js
|
|
1054
1056
|
// foundation src/main.js — typefaces this foundation manages itself.
|
|
1055
1057
|
// Defaults are OS stacks, so it renders native until a site opts in.
|
|
1056
1058
|
export const vars = {
|
|
1057
|
-
'font-
|
|
1058
|
-
|
|
1059
|
-
|
|
1059
|
+
'font-serif': {
|
|
1060
|
+
type: 'font',
|
|
1061
|
+
default: 'ui-serif, Georgia, serif',
|
|
1062
|
+
description: 'Editorial serif — blurbs, taglines, quotes',
|
|
1063
|
+
applyTo: ['blockquote', '.tagline'], // framework applies it here, like a built-in role
|
|
1064
|
+
},
|
|
1065
|
+
'font-display': {
|
|
1066
|
+
type: 'font',
|
|
1067
|
+
default: 'ui-sans-serif, system-ui, sans-serif',
|
|
1068
|
+
description: 'Display — hero titles',
|
|
1069
|
+
// no applyTo → the component wires it (a `font-display` utility, or var(--font-display))
|
|
1070
|
+
},
|
|
1071
|
+
}
|
|
1072
|
+
```
|
|
1073
|
+
|
|
1074
|
+
Two ways to apply a typed font var — choose per var:
|
|
1075
|
+
|
|
1076
|
+
- **`applyTo: [selectors]`** — the framework emits the `font-family` rule for you, exactly like the three built-in roles. Declarative; no font-family classes in components.
|
|
1077
|
+
- **Omit `applyTo`** — the component wires it: a Tailwind `font-*` utility when the var is named after a Tailwind scale (`font-serif` → the `font-serif` utility), or `font-family: var(--font-display)` for a custom name.
|
|
1078
|
+
|
|
1079
|
+
Either way the site sets the family and loads it — no component changes. The `fonts:` block takes **any** role name, built-in or foundation-added, so a site sets its whole type system in one place:
|
|
1080
|
+
|
|
1081
|
+
```yaml
|
|
1082
|
+
# site/theme.yml
|
|
1083
|
+
fonts:
|
|
1084
|
+
body: "Inter, system-ui, sans-serif"
|
|
1085
|
+
serif: '"Fraunces", Georgia, serif' # a foundation-declared role, set by name
|
|
1086
|
+
faces:
|
|
1087
|
+
- { family: "Fraunces", src: /fonts/fraunces.woff2, weight: "100 900" }
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
(`vars: { font-serif: … }` still works — same role. `serif` and `font-serif` are the same font var; the `font-` spelling is just the one Tailwind's `font-serif` utility reads.)
|
|
1091
|
+
|
|
1092
|
+
**The three roles are defaults you can retarget.** `body`/`heading`/`code` and their selectors are *defaults*, not a fixed contract — a foundation can **redefine** a role (change which elements it paints) or **add** roles, all through the same `type: 'font'` var. Declaring a role's var with a new `applyTo` retargets it; the site still owns the family.
|
|
1093
|
+
|
|
1094
|
+
```js
|
|
1095
|
+
// foundation src/main.js — retarget a built-in role, add a new one.
|
|
1096
|
+
export const vars = {
|
|
1097
|
+
heading: { type: 'font', applyTo: ['h1', 'h2', 'h3', 'h4'] }, // include h4 in the heading font
|
|
1098
|
+
serif: { type: 'font', default: 'ui-serif, Georgia, serif', applyTo: ['blockquote'] },
|
|
1060
1099
|
}
|
|
1061
1100
|
```
|
|
1062
1101
|
|
|
1063
|
-
|
|
1102
|
+
> The `code` role owns `--font-code`. Tailwind's `font-mono` utility (which reads `--font-mono`) is a **separate** concern — a foundation controls it by declaring its own `font-mono` font var. So setting `fonts.code` styles code without disturbing `font-mono`-styled labels, and vice-versa.
|
|
1064
1103
|
|
|
1065
1104
|
### Foundation variables
|
|
1066
1105
|
|
|
1067
1106
|
Most customization is handled by component params. Both section components and layout components declare their own params in `meta.js` — layouts are full components with params, not just structural wrappers. A header height, for example, is typically a layout param, not a foundation var.
|
|
1068
1107
|
|
|
1069
|
-
Foundation-level CSS variables are for values that must stay consistent **across** multiple components — shared radii, spacing scales, or additional
|
|
1108
|
+
Foundation-level CSS variables are for values that must stay consistent **across** multiple components — shared radii, spacing scales, or additional typefaces beyond the three built-in roles (body, heading, code), declared as typed font vars (`type: 'font'`, covered in **Fonts** above). Don't reach for foundation vars when a component or layout param would do.
|
|
1070
1109
|
|
|
1071
1110
|
When you do need one, declare it in **`main.js`** — the single source of truth:
|
|
1072
1111
|
|
package/src/framework-index.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-07-
|
|
3
|
+
"generatedAt": "2026-07-18T12:27:01.279Z",
|
|
4
4
|
"packages": {
|
|
5
5
|
"@uniweb/build": {
|
|
6
|
-
"version": "0.14.
|
|
6
|
+
"version": "0.14.27",
|
|
7
7
|
"path": "framework/build",
|
|
8
8
|
"deps": [
|
|
9
9
|
"@uniweb/content-reader",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"deps": []
|
|
26
26
|
},
|
|
27
27
|
"@uniweb/core": {
|
|
28
|
-
"version": "0.7.
|
|
28
|
+
"version": "0.7.19",
|
|
29
29
|
"path": "framework/core",
|
|
30
30
|
"deps": [
|
|
31
31
|
"@uniweb/semantic-parser",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"deps": []
|
|
44
44
|
},
|
|
45
45
|
"@uniweb/kit": {
|
|
46
|
-
"version": "0.9.
|
|
46
|
+
"version": "0.9.23",
|
|
47
47
|
"path": "framework/kit",
|
|
48
48
|
"deps": [
|
|
49
49
|
"@uniweb/core",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"deps": []
|
|
62
62
|
},
|
|
63
63
|
"@uniweb/runtime": {
|
|
64
|
-
"version": "0.8.
|
|
64
|
+
"version": "0.8.25",
|
|
65
65
|
"path": "framework/runtime",
|
|
66
66
|
"deps": [
|
|
67
67
|
"@uniweb/core",
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
"deps": []
|
|
95
95
|
},
|
|
96
96
|
"@uniweb/theming": {
|
|
97
|
-
"version": "0.1.
|
|
97
|
+
"version": "0.1.7",
|
|
98
98
|
"path": "framework/theming",
|
|
99
99
|
"deps": []
|
|
100
100
|
},
|
|
101
101
|
"@uniweb/unipress": {
|
|
102
|
-
"version": "0.4.
|
|
102
|
+
"version": "0.4.34",
|
|
103
103
|
"path": "framework/unipress",
|
|
104
104
|
"deps": [
|
|
105
105
|
"@uniweb/build",
|
package/templates/site/theme.yml
CHANGED
|
@@ -19,7 +19,7 @@ colors:
|
|
|
19
19
|
# fonts:
|
|
20
20
|
# heading: '"Inter", system-ui, sans-serif'
|
|
21
21
|
# body: '"Inter", system-ui, sans-serif'
|
|
22
|
-
#
|
|
22
|
+
# code: '"JetBrains Mono", ui-monospace, monospace'
|
|
23
23
|
# import:
|
|
24
24
|
# - url: https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap
|
|
25
25
|
# - url: https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap
|