foldkit-mixins 0.5.0 → 0.6.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.
Files changed (2) hide show
  1. package/README.md +24 -0
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -802,6 +802,30 @@ expect(Inert.missingTokens(tree, stylesheet)).toEqual([])
802
802
  A tree whose Styles read no token passes the second vacuously; assert that
803
803
  `Inert.css(Inert.all(tree))` contains `var(--fk-` where that would be a mistake.
804
804
 
805
+ ## Foundations in the first paint
806
+
807
+ A view's Styles arrive as it draws, so a page that has not run its script yet is
808
+ unstyled. `foldkit-mixins/foundations` writes the one stylesheet that belongs to
809
+ no view — the reset, the palette, the type — into the document's head, in
810
+ development through the running server and in a build through one of its own. It
811
+ compiles a module the application owns, through a server, as the page would
812
+ compile it, so the build's foundations are the application's rather than a copy.
813
+
814
+ ```ts
815
+ // vite.config.ts
816
+ import { foundations } from 'foldkit-mixins/foundations'
817
+
818
+ export default defineConfig({
819
+ plugins: [foundations({ module: '/src/styles/sheet.ts' })],
820
+ })
821
+ ```
822
+
823
+ The module must be pure (it builds a string) and export the stylesheet text;
824
+ `export` names that export (default `stylesheet`), and `root` what `vite build`
825
+ runs from. `loadFoundations(options)` is the same compile without the plugin,
826
+ returning the text for a caller that writes it itself. The subpath is node-only:
827
+ a page that imports it fails fast naming `vite`.
828
+
805
829
  ## `@foldkit/ui`
806
830
 
807
831
  `foldkit-mixins-ui` adapts `@foldkit/ui` components that expose attribute bundles or a consumer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldkit-mixins",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Typed slot contracts and inside-out Style/Behavior attachments for Foldkit.",
5
5
  "keywords": [
6
6
  "foldkit",
@@ -85,13 +85,13 @@
85
85
  "LICENSE"
86
86
  ],
87
87
  "peerDependencies": {
88
- "effect": ">=4.0.0-rc.116 <4.0.0-rc.118",
89
- "foldkit": "^0.163.0"
88
+ "effect": "^4.0.0",
89
+ "foldkit": "^0.165.0"
90
90
  },
91
91
  "devDependencies": {
92
- "@effect/platform-browser": "4.0.0-rc.116",
93
- "effect": "4.0.0-rc.116",
94
- "foldkit": "0.163.0",
92
+ "@effect/platform-browser": "4.0.0",
93
+ "effect": "4.0.0",
94
+ "foldkit": "0.165.0",
95
95
  "tsdown": "^0.23.0",
96
96
  "typescript": "5.9.3",
97
97
  "vite": "5.4.21"