@filipgutica/ui 1.2.0 → 1.4.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 +47 -0
- package/dist/components/UiCodeBlock.vue.d.ts +1 -0
- package/dist/index.js +125 -108
- package/dist/site/UiSiteHeader.vue.d.ts +24 -0
- package/dist/site/appearance.d.ts +35 -0
- package/dist/site/index.d.ts +6 -0
- package/dist/site/projects.d.ts +36 -0
- package/dist/site.js +177 -0
- package/package.json +13 -3
- package/src/components.css +52 -7
- package/src/site.css +169 -0
- package/src/themes/graphite-indigo.css +111 -0
package/README.md
CHANGED
|
@@ -87,6 +87,48 @@ Themes supply colors; the library keeps typography, spacing, and component
|
|
|
87
87
|
structure consistent. Open VSX search and imports are available through
|
|
88
88
|
`@filipgutica/ui/open-vsx`, which must run on a Node server.
|
|
89
89
|
|
|
90
|
+
The default theme is unchanged. To opt in to Graphite Indigo, import it after
|
|
91
|
+
`theme.css`:
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
@import "@filipgutica/ui/theme.css";
|
|
95
|
+
@import "@filipgutica/ui/themes/graphite-indigo.css";
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Project sites
|
|
99
|
+
|
|
100
|
+
The `site` entry gives the project sites one header, one appearance choice, and
|
|
101
|
+
shared page styles. Import `@filipgutica/ui/site.css` and the Graphite Indigo
|
|
102
|
+
theme above, which supplies the type and spacing roles `site.css` reads. Keep
|
|
103
|
+
document-wide link styles in `@layer base` so the header owns its navigation
|
|
104
|
+
appearance.
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
import { UiSiteHeader } from '@filipgutica/ui/site'
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<template>
|
|
112
|
+
<UiSiteHeader
|
|
113
|
+
project="wtree"
|
|
114
|
+
:links="[{ label: 'User guide', href: '#guide' }]"
|
|
115
|
+
/>
|
|
116
|
+
</template>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`project` is `wtree`, `annoterm`, `devps`, `workbench`, or `ui`. The project
|
|
120
|
+
menu is a native disclosure that works without JavaScript; Escape closes it and
|
|
121
|
+
returns focus to its button. Without a default slot the header renders a
|
|
122
|
+
System, Light, and Dark picker. A page with its own appearance control passes it
|
|
123
|
+
in the default slot and uses `useSiteAppearance({ applyToRoot: false })` when it
|
|
124
|
+
owns the root element.
|
|
125
|
+
|
|
126
|
+
`useSiteAppearance()` returns `choice`, the resolved `appearance`, and
|
|
127
|
+
`chooseAppearance(value)`. The choice is stored under `tool-site-theme`, follows
|
|
128
|
+
the operating system and other tabs, and is safe during server rendering and
|
|
129
|
+
when storage is blocked. To avoid a flash of the wrong appearance, inline
|
|
130
|
+
`siteThemeBootScript` in the document head.
|
|
131
|
+
|
|
90
132
|
## Development
|
|
91
133
|
|
|
92
134
|
```sh
|
|
@@ -94,3 +136,8 @@ pnpm install
|
|
|
94
136
|
pnpm docs:dev
|
|
95
137
|
pnpm verify
|
|
96
138
|
```
|
|
139
|
+
|
|
140
|
+
Graphite Indigo values live in `themes/graphite-indigo.json`. After editing it,
|
|
141
|
+
run `pnpm themes:build` to regenerate the opt-in theme and the standalone
|
|
142
|
+
`themes/graphite-indigo.tokens.css`; `pnpm themes:check` fails when either is
|
|
143
|
+
stale.
|