@qovira/theme 0.0.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/LICENSE +201 -0
- package/README.md +246 -0
- package/dist/boot.d.ts +21 -0
- package/dist/boot.js +18 -0
- package/dist/fonts/figtree-OFL.txt +93 -0
- package/dist/fonts/figtree-variable.woff2 +0 -0
- package/dist/fonts/fraunces-OFL.txt +93 -0
- package/dist/fonts/fraunces-variable.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-OFL.txt +93 -0
- package/dist/fonts/jetbrains-mono-variable.woff2 +0 -0
- package/dist/fonts.css +45 -0
- package/dist/runtime.d.ts +28 -0
- package/dist/runtime.js +72 -0
- package/dist/theme.css +347 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 OMNILIUM ADVANCED CYBERNETICS SRL
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# @qovira/theme
|
|
2
|
+
|
|
3
|
+
Qovira's visual foundation as a distributable package: **Tailwind v4 tokens**,
|
|
4
|
+
**self-hosted fonts**, and a small **framework-agnostic theming runtime**. It is
|
|
5
|
+
the single source of color, type, spacing, radius, elevation, motion, and the two
|
|
6
|
+
themes — **Daylight** and **Evening** — shared by every Qovira surface (the
|
|
7
|
+
product web app and the [qovira.ai](http://qovira.ai) marketing site), so the
|
|
8
|
+
brand stays identical across them without copy-paste.
|
|
9
|
+
|
|
10
|
+
The package is the _foundation_ a component library is built on — it ships only
|
|
11
|
+
tokens, fonts, and a tiny runtime, and has **no framework dependency**.
|
|
12
|
+
|
|
13
|
+
> Status: early development. Tokens, fonts, runtime, and utilities are being
|
|
14
|
+
> filled in; some entry points still resolve to placeholders.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
This package requires [Tailwind CSS v4](https://tailwindcss.com) in the consumer
|
|
19
|
+
(both consumers use the `@tailwindcss/vite` plugin). The package manager is
|
|
20
|
+
**pnpm**.
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pnpm add @qovira/theme
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### 1. Tokens + fonts — `app.css`
|
|
29
|
+
|
|
30
|
+
Import order matters: bring in `tailwindcss` **first** so the package's `@theme`
|
|
31
|
+
blocks _extend_ the Tailwind defaults rather than precede them.
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
@import "tailwindcss";
|
|
35
|
+
@import "@qovira/theme"; /* tokens + semantic layer + @theme inline */
|
|
36
|
+
@import "@qovira/theme/fonts"; /* self-hosted @font-face (no CDN) */
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The fonts are bundled in the package and referenced with relative URLs; Vite
|
|
40
|
+
fingerprints them and serves them from your own origin — no external request.
|
|
41
|
+
|
|
42
|
+
### 2. Pre-paint theme (no flash) — app shell `<head>`
|
|
43
|
+
|
|
44
|
+
Inline the boot snippet in the document `<head>` **before any stylesheet** so
|
|
45
|
+
`data-theme` is set on `<html>` before first paint. It resolves the theme as
|
|
46
|
+
`localStorage` → `prefers-color-scheme` → `evening`.
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
import { boot } from "@qovira/theme/boot"; // the raw snippet, as a string
|
|
50
|
+
// inject `boot` into a synchronous <script> in <head>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> **SvelteKit:** the boot string must go in `src/app.html` inside `<head>`, **not**
|
|
54
|
+
> a layout — `%sveltekit.head%` runs too late to prevent a flash.
|
|
55
|
+
|
|
56
|
+
### 3. Toggle / persist — `@qovira/theme/runtime`
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import {
|
|
60
|
+
getTheme,
|
|
61
|
+
setTheme,
|
|
62
|
+
toggleTheme,
|
|
63
|
+
subscribe,
|
|
64
|
+
} from "@qovira/theme/runtime";
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Framework-agnostic get/set/persist with cross-tab sync. A Svelte store/rune
|
|
68
|
+
wrapper, and the three-state Daylight/Evening/System control, are the app's
|
|
69
|
+
concern — built on `subscribe`.
|
|
70
|
+
|
|
71
|
+
## Entry points
|
|
72
|
+
|
|
73
|
+
| Import | Resolves to | Contents |
|
|
74
|
+
| ----------------------- | ----------------- | ----------------------------------------- |
|
|
75
|
+
| `@qovira/theme` | `dist/theme.css` | tokens + semantic layer + `@theme inline` |
|
|
76
|
+
| `@qovira/theme/fonts` | `dist/fonts.css` | `@font-face` + bundled woff2 |
|
|
77
|
+
| `@qovira/theme/runtime` | `dist/runtime.js` | get/set/persist toggle API |
|
|
78
|
+
| `@qovira/theme/boot` | `dist/boot.js` | the raw pre-paint string, for inlining |
|
|
79
|
+
|
|
80
|
+
## Component recipes
|
|
81
|
+
|
|
82
|
+
These are **reference patterns, not shipped components.** `@qovira/theme` has no
|
|
83
|
+
framework dependency and ships only tokens, utilities, and fonts — a component
|
|
84
|
+
library is built _on top_ of it, separately, in app code. The class strings
|
|
85
|
+
below are copy-pasteable and built entirely from the semantic layer, so **one
|
|
86
|
+
recipe is correct in both Daylight and Evening** with no per-theme edits — the
|
|
87
|
+
`data-theme` attribute on `<html>` does the switching.
|
|
88
|
+
|
|
89
|
+
### Headings
|
|
90
|
+
|
|
91
|
+
Pair a family utility with a role size token (font-family isn't carried by the
|
|
92
|
+
`text-*` tokens):
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
font-display text-h1
|
|
96
|
+
font-display text-h2
|
|
97
|
+
font-sans text-h4
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Body copy uses `text-body`, caps measure at `max-w-[70ch]`, and always uses
|
|
101
|
+
`text-text` (never `text-text-muted`).
|
|
102
|
+
|
|
103
|
+
### Button
|
|
104
|
+
|
|
105
|
+
Shared base (all variants). Touch contexts bump `h-10` → `h-11` (≥44px):
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
inline-flex items-center justify-center gap-2 rounded-md text-button h-10 px-4
|
|
109
|
+
select-none transition-[background,box-shadow,transform] duration-micro ease-qovira
|
|
110
|
+
focus-ring disabled:opacity-50 disabled:pointer-events-none
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Primary — espresso (Daylight) ↔ honey (Evening), automatic via `--btn-primary`:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
bg-btn-primary text-btn-primary-fg hover:bg-btn-primary-hover active:bg-btn-primary-active active:scale-[.99]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Key-CTA — the single most important action; raw honey in both themes. Only
|
|
120
|
+
**one** per view (the ≤10% accent rule):
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
bg-accent text-warm-900 hover:bg-honey-600 active:bg-honey-700
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Secondary — hairline-bordered:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
bg-transparent text-text border border-border hover:bg-surface-raised active:bg-warm-200/40
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Ghost — text-only:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
bg-transparent text-link hover:bg-link/8 active:bg-link/12
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Destructive — pair with a confirm for irreversible actions:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
bg-error text-white hover:brightness-95 active:brightness-90
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Input
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
flex h-10 w-full rounded-md px-3 text-body bg-surface-raised text-text border border-border
|
|
148
|
+
placeholder:text-text-muted focus-ring aria-[invalid=true]:border-error disabled:opacity-50
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Label uses `text-label text-text-muted`; helper/error text uses `text-small`,
|
|
152
|
+
with the error message in:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
text-small text-error-text
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Never rely on the red border alone — set `aria-invalid` and show the message.
|
|
159
|
+
|
|
160
|
+
### Card / panel
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
rounded-lg bg-surface-raised border border-border p-6 shadow-[var(--shadow-sm)]
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Interactive cards add:
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
focus-ring hover:shadow-[var(--shadow-md)] transition-shadow duration-base ease-qovira
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Modals / dialogs use:
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
rounded-xl shadow-[var(--shadow-lg)]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Focus
|
|
179
|
+
|
|
180
|
+
Every interactive element gets the brand's non-negotiable ring. Never removed,
|
|
181
|
+
never a bare `outline: none`:
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
focus-ring
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Lamp-glow
|
|
188
|
+
|
|
189
|
+
The signature honey motif — focus emphasis, loaders, special moments; **never**
|
|
190
|
+
general elevation. Static halo:
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
lamp-glow
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
As a loader, drive the pulse on a honey radial-gradient. Always provide a
|
|
197
|
+
static / `aria-live` fallback so meaning isn't trapped in animation (the pulse is
|
|
198
|
+
collapsed under `prefers-reduced-motion`):
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
lamp-glow-pulse
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Chip / pill
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
inline-flex items-center gap-1 rounded-sm h-7 px-2.5 text-small bg-surface-raised text-text-muted border border-border
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Status chips swap to the matching tint/text **with an icon** — never color
|
|
211
|
+
alone:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
bg-success-tint text-success-text
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Use `rounded-full` only for true pills, toggles, and avatars.
|
|
218
|
+
|
|
219
|
+
### Guardrails
|
|
220
|
+
|
|
221
|
+
- **Accent discipline.** Honey covers ≤ ~10% of any screen. Primary actions are
|
|
222
|
+
espresso (Daylight) / honey (Evening); raw honey is reserved for the one
|
|
223
|
+
Key-CTA, focus, and highlights.
|
|
224
|
+
- **Accent never signals status.** Status uses the semantic colors only — honey
|
|
225
|
+
and warning-amber stay distinct so "heads up" never reads as "brand".
|
|
226
|
+
- **Never color alone.** Every status pairs color with an icon or text label;
|
|
227
|
+
error inputs get `aria-invalid` + a message, not just a red border.
|
|
228
|
+
- **Focus is never removed.** Always the visible 2px honey ring via `focus-ring`;
|
|
229
|
+
no bare `outline: none`.
|
|
230
|
+
- **Type.** Body copy always uses `text-text`, never `text-text-muted` (muted is
|
|
231
|
+
for genuinely secondary text — timestamps, counts, hints).
|
|
232
|
+
- **Hit targets.** ≥40px desktop (`h-10`), ≥44px touch (`h-11`).
|
|
233
|
+
|
|
234
|
+
## Development
|
|
235
|
+
|
|
236
|
+
```sh
|
|
237
|
+
pnpm install
|
|
238
|
+
pnpm build # tsup → dist/{runtime,boot}.js + copy CSS/fonts → dist/
|
|
239
|
+
pnpm typecheck # tsc --noEmit
|
|
240
|
+
pnpm lint # eslint + prettier --check
|
|
241
|
+
pnpm test # vitest run
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
[Apache-2.0](./LICENSE) © OMNILIUM ADVANCED CYBERNETICS SRL
|
package/dist/boot.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-paint boot snippet.
|
|
3
|
+
*
|
|
4
|
+
* A tiny synchronous IIFE shipped as a STRING so consumers can inline it
|
|
5
|
+
* verbatim in `<head>` — before any stylesheet — and have `data-theme` set on
|
|
6
|
+
* `<html>` before first paint (no flash on reload).
|
|
7
|
+
*
|
|
8
|
+
* Resolution order, matching the toggle API:
|
|
9
|
+
* 1. stored choice — localStorage["qovira-theme"], if "daylight" | "evening"
|
|
10
|
+
* 2. system preference — prefers-color-scheme: dark → "evening", else "daylight"
|
|
11
|
+
* 3. default — "evening" (also the fallback if anything throws)
|
|
12
|
+
*
|
|
13
|
+
* The localStorage key is duplicated here as a literal because this snippet is
|
|
14
|
+
* standalone (it cannot import from the runtime); a test asserts the two agree.
|
|
15
|
+
*
|
|
16
|
+
* SvelteKit: inline this in `src/app.html` inside `<head>`, NOT a layout —
|
|
17
|
+
* `%sveltekit.head%` runs too late to prevent a flash.
|
|
18
|
+
*/
|
|
19
|
+
declare const boot = "(function () {\n try {\n var s = localStorage.getItem(\"qovira-theme\");\n var t =\n s === \"daylight\" || s === \"evening\"\n ? s\n : matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"evening\"\n : \"daylight\";\n document.documentElement.setAttribute(\"data-theme\", t);\n } catch (e) {\n document.documentElement.setAttribute(\"data-theme\", \"evening\");\n }\n})();";
|
|
20
|
+
|
|
21
|
+
export { boot };
|
package/dist/boot.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/runtime/boot.ts
|
|
2
|
+
var boot = `(function () {
|
|
3
|
+
try {
|
|
4
|
+
var s = localStorage.getItem("qovira-theme");
|
|
5
|
+
var t =
|
|
6
|
+
s === "daylight" || s === "evening"
|
|
7
|
+
? s
|
|
8
|
+
: matchMedia("(prefers-color-scheme: dark)").matches
|
|
9
|
+
? "evening"
|
|
10
|
+
: "daylight";
|
|
11
|
+
document.documentElement.setAttribute("data-theme", t);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
document.documentElement.setAttribute("data-theme", "evening");
|
|
14
|
+
}
|
|
15
|
+
})();`;
|
|
16
|
+
export {
|
|
17
|
+
boot
|
|
18
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2022 The Figtree Project Authors (https://github.com/erikdkennedy/figtree) Figtree-Italic[wght].ttf: Copyright 2022 The Figtree Project Authors (https://github.com/erikdkennedy/figtree)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The Fraunces Project Authors (github.com/undercasetype/Fraunces) Fraunces-Italic[SOFT,WONK,opsz,wght].ttf: Copyright 2020 The Fraunces Project Authors (github.com/undercasetype/Fraunces)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) JetBrainsMono-Italic[wght].ttf: Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
package/dist/fonts.css
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @qovira/theme/fonts — self-hosted @font-face.
|
|
3
|
+
*
|
|
4
|
+
* The three brand families ship as variable woff2 bundled in this package under
|
|
5
|
+
* `fonts/` and referenced with RELATIVE urls, so there is no font-CDN and no
|
|
6
|
+
* external request (the privacy-and-offline ethos). A consumer's Vite build
|
|
7
|
+
* fingerprints these files and serves them from the consumer's own origin.
|
|
8
|
+
*
|
|
9
|
+
* `font-display: swap` renders the fallback stack immediately, then swaps to the
|
|
10
|
+
* web font once loaded — the fallback stacks live on the `--font-*` tokens
|
|
11
|
+
* (Fraunces→Georgia→serif, Figtree→system-ui→sans-serif,
|
|
12
|
+
* JetBrains Mono→ui-monospace→monospace), so layout holds before the swap.
|
|
13
|
+
*
|
|
14
|
+
* Each is a single variable file spanning the weight axis. Fraunces also carries
|
|
15
|
+
* its optical-size, SOFT and WONK axes — `font-optical-sizing: auto` (the CSS
|
|
16
|
+
* default) drives opsz automatically; SOFT/WONK can be tuned per use via
|
|
17
|
+
* `font-variation-settings` (the brand default is gentle SOFT, WONK off).
|
|
18
|
+
*
|
|
19
|
+
* Fonts are licensed under the SIL Open Font License 1.1; see the per-family
|
|
20
|
+
* OFL texts alongside the woff2 in `fonts/`.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
@font-face {
|
|
24
|
+
font-family: "Fraunces";
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-display: swap;
|
|
27
|
+
font-weight: 100 900;
|
|
28
|
+
src: url("./fonts/fraunces-variable.woff2") format("woff2");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@font-face {
|
|
32
|
+
font-family: "Figtree";
|
|
33
|
+
font-style: normal;
|
|
34
|
+
font-display: swap;
|
|
35
|
+
font-weight: 300 900;
|
|
36
|
+
src: url("./fonts/figtree-variable.woff2") format("woff2");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@font-face {
|
|
40
|
+
font-family: "JetBrains Mono";
|
|
41
|
+
font-style: normal;
|
|
42
|
+
font-display: swap;
|
|
43
|
+
font-weight: 100 800;
|
|
44
|
+
src: url("./fonts/jetbrains-mono-variable.woff2") format("woff2");
|
|
45
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme runtime — framework-agnostic get/set/persist for the active theme.
|
|
3
|
+
*
|
|
4
|
+
* The active theme is the `data-theme` attribute on `<html>`, always one of
|
|
5
|
+
* `daylight` | `evening`; everything visual keys off it through the semantic
|
|
6
|
+
* layer. This module reads and writes that attribute and the `qovira-theme`
|
|
7
|
+
* localStorage key, and notifies subscribers — including across tabs via the
|
|
8
|
+
* `storage` event. Pre-paint application is the boot snippet's job (`./boot`);
|
|
9
|
+
* a Svelte store/rune wrapper and the theme-control UI are the app's concern.
|
|
10
|
+
*/
|
|
11
|
+
type Theme = "daylight" | "evening";
|
|
12
|
+
type Listener = (theme: Theme) => void;
|
|
13
|
+
/** The current theme — the `data-theme` attribute, or the resolved default. */
|
|
14
|
+
declare function getTheme(): Theme;
|
|
15
|
+
/**
|
|
16
|
+
* Apply and persist a theme. `setTheme(null)` clears the stored choice and
|
|
17
|
+
* re-resolves from the system preference (i.e. follow system again).
|
|
18
|
+
*/
|
|
19
|
+
declare function setTheme(theme: Theme | null): void;
|
|
20
|
+
/** Flip between the two themes and return the new value. */
|
|
21
|
+
declare function toggleTheme(): Theme;
|
|
22
|
+
/**
|
|
23
|
+
* Subscribe to theme changes (this tab via set/toggle, other tabs via the
|
|
24
|
+
* `storage` event). Returns an unsubscribe function.
|
|
25
|
+
*/
|
|
26
|
+
declare function subscribe(callback: Listener): () => void;
|
|
27
|
+
|
|
28
|
+
export { type Theme, getTheme, setTheme, subscribe, toggleTheme };
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// src/runtime/theme.ts
|
|
2
|
+
var STORAGE_KEY = "qovira-theme";
|
|
3
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
4
|
+
var storageBound = false;
|
|
5
|
+
function isTheme(value) {
|
|
6
|
+
return value === "daylight" || value === "evening";
|
|
7
|
+
}
|
|
8
|
+
function resolve() {
|
|
9
|
+
try {
|
|
10
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
11
|
+
if (isTheme(stored)) return stored;
|
|
12
|
+
return matchMedia("(prefers-color-scheme: dark)").matches ? "evening" : "daylight";
|
|
13
|
+
} catch {
|
|
14
|
+
return "evening";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function apply(theme) {
|
|
18
|
+
document.documentElement.setAttribute("data-theme", theme);
|
|
19
|
+
}
|
|
20
|
+
function emit(theme) {
|
|
21
|
+
for (const listener of listeners) listener(theme);
|
|
22
|
+
}
|
|
23
|
+
function bindStorage() {
|
|
24
|
+
if (storageBound) return;
|
|
25
|
+
storageBound = true;
|
|
26
|
+
window.addEventListener("storage", (event) => {
|
|
27
|
+
if (event.key !== STORAGE_KEY) return;
|
|
28
|
+
const next = resolve();
|
|
29
|
+
apply(next);
|
|
30
|
+
emit(next);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function getTheme() {
|
|
34
|
+
const attr = document.documentElement.getAttribute("data-theme");
|
|
35
|
+
return isTheme(attr) ? attr : resolve();
|
|
36
|
+
}
|
|
37
|
+
function setTheme(theme) {
|
|
38
|
+
if (theme === null) {
|
|
39
|
+
try {
|
|
40
|
+
localStorage.removeItem(STORAGE_KEY);
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
const next = resolve();
|
|
44
|
+
apply(next);
|
|
45
|
+
emit(next);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
localStorage.setItem(STORAGE_KEY, theme);
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
apply(theme);
|
|
53
|
+
emit(theme);
|
|
54
|
+
}
|
|
55
|
+
function toggleTheme() {
|
|
56
|
+
const next = getTheme() === "evening" ? "daylight" : "evening";
|
|
57
|
+
setTheme(next);
|
|
58
|
+
return next;
|
|
59
|
+
}
|
|
60
|
+
function subscribe(callback) {
|
|
61
|
+
listeners.add(callback);
|
|
62
|
+
bindStorage();
|
|
63
|
+
return () => {
|
|
64
|
+
listeners.delete(callback);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
getTheme,
|
|
69
|
+
setTheme,
|
|
70
|
+
subscribe,
|
|
71
|
+
toggleTheme
|
|
72
|
+
};
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @qovira/theme — token entry.
|
|
3
|
+
*
|
|
4
|
+
* Three-layer token architecture:
|
|
5
|
+
* - Layer 1 — @theme primitives (this file, theme-agnostic)
|
|
6
|
+
* - Layer 2 — semantic [data-theme] aliases (theme-aware)
|
|
7
|
+
* - Layer 3 — @theme inline exposure of the semantic layer
|
|
8
|
+
* - utilities (focus-ring, lamp-glow, duration-*) + the motion guard
|
|
9
|
+
*
|
|
10
|
+
* Consumers import this AFTER `@import "tailwindcss";` so these @theme blocks
|
|
11
|
+
* EXTEND the Tailwind defaults rather than precede them.
|
|
12
|
+
*
|
|
13
|
+
* All values are transcribed verbatim from Brand & Design (design doc §5).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
17
|
+
* Layer 1 — Primitives (theme-agnostic; identical in Daylight and Evening).
|
|
18
|
+
* Declared in @theme so Tailwind generates the usual utilities
|
|
19
|
+
* (bg-honey-500, text-warm-700, rounded-md, font-display, text-h1, ease-qovira).
|
|
20
|
+
* ──────────────────────────────────────────────────────────────────────── */
|
|
21
|
+
@theme {
|
|
22
|
+
/* Warm neutrals — espresso ↔ cream ramp */
|
|
23
|
+
--color-warm-50: #faf6ef;
|
|
24
|
+
--color-warm-100: #f1e9dc;
|
|
25
|
+
--color-warm-200: #e6dac8;
|
|
26
|
+
--color-warm-300: #d4c4ad;
|
|
27
|
+
--color-warm-400: #b09a7e;
|
|
28
|
+
--color-warm-500: #8a745b;
|
|
29
|
+
--color-warm-600: #6b563f;
|
|
30
|
+
--color-warm-700: #4a3a2a;
|
|
31
|
+
--color-warm-800: #2c2118;
|
|
32
|
+
--color-warm-900: #1e1712;
|
|
33
|
+
|
|
34
|
+
/* Honey accent ramp — 500 = brand honey; 600 = hover/press; 800 = AA text/link
|
|
35
|
+
* on cream (the semantic --link). 700 is AA-large only on cream, so it is not
|
|
36
|
+
* used for normal-size text. */
|
|
37
|
+
--color-honey-50: #fcf3e4;
|
|
38
|
+
--color-honey-100: #f8e6c8;
|
|
39
|
+
--color-honey-200: #f1d199;
|
|
40
|
+
--color-honey-300: #ebbe74;
|
|
41
|
+
--color-honey-400: #e5b063;
|
|
42
|
+
--color-honey-500: #e0a458;
|
|
43
|
+
--color-honey-600: #c9883c;
|
|
44
|
+
--color-honey-700: #a66b28;
|
|
45
|
+
--color-honey-800: #7e4f1c;
|
|
46
|
+
--color-honey-900: #573514;
|
|
47
|
+
|
|
48
|
+
/* Clay secondary ramp */
|
|
49
|
+
--color-clay-400: #d08c66;
|
|
50
|
+
--color-clay-500: #c2754c;
|
|
51
|
+
--color-clay-600: #a85f3a;
|
|
52
|
+
--color-clay-700: #8a4b2c;
|
|
53
|
+
|
|
54
|
+
/* Status base colors — reserved for meaning, never decoration.
|
|
55
|
+
* Per-theme tint/text aliases live in the semantic layer. */
|
|
56
|
+
--color-success: #2f9e6b;
|
|
57
|
+
--color-warning: #e08a1e;
|
|
58
|
+
--color-error: #d6452e;
|
|
59
|
+
--color-info: #3b72c0;
|
|
60
|
+
|
|
61
|
+
/* Font families. font-family is intentionally NOT carried by the --text-*
|
|
62
|
+
* tokens below; headings pair the size token with a family utility, e.g.
|
|
63
|
+
* `font-display text-h1` (see the component recipes in the README). */
|
|
64
|
+
--font-display: "Fraunces", Georgia, serif;
|
|
65
|
+
--font-sans: "Figtree", system-ui, sans-serif;
|
|
66
|
+
--font-mono: "JetBrains Mono", ui-monospace, monospace;
|
|
67
|
+
|
|
68
|
+
/* Radius — overrides Tailwind's defaults; md (10px) is the default for
|
|
69
|
+
* buttons and inputs. Brand owns these names. */
|
|
70
|
+
--radius-sm: 8px;
|
|
71
|
+
--radius-md: 10px;
|
|
72
|
+
--radius-lg: 14px;
|
|
73
|
+
--radius-xl: 18px;
|
|
74
|
+
--radius-full: 999px;
|
|
75
|
+
|
|
76
|
+
/* Type scale — role tokens carrying size + line-height + letter-spacing +
|
|
77
|
+
* weight via the v4 modifier syntax. (text-label additionally pairs with the
|
|
78
|
+
* `uppercase` utility in recipes; text-transform is not expressible on a
|
|
79
|
+
* --text-* token.) */
|
|
80
|
+
--text-display: 3.25rem;
|
|
81
|
+
--text-display--line-height: 1.05;
|
|
82
|
+
--text-display--letter-spacing: -0.01em;
|
|
83
|
+
--text-display--font-weight: 500;
|
|
84
|
+
|
|
85
|
+
--text-h1: 2.375rem;
|
|
86
|
+
--text-h1--line-height: 1.1;
|
|
87
|
+
--text-h1--letter-spacing: -0.01em;
|
|
88
|
+
--text-h1--font-weight: 500;
|
|
89
|
+
|
|
90
|
+
--text-h2: 1.75rem;
|
|
91
|
+
--text-h2--line-height: 1.18;
|
|
92
|
+
--text-h2--letter-spacing: -0.005em;
|
|
93
|
+
--text-h2--font-weight: 500;
|
|
94
|
+
|
|
95
|
+
--text-h3: 1.375rem;
|
|
96
|
+
--text-h3--line-height: 1.25;
|
|
97
|
+
--text-h3--font-weight: 600;
|
|
98
|
+
|
|
99
|
+
--text-h4: 1.125rem;
|
|
100
|
+
--text-h4--line-height: 1.3;
|
|
101
|
+
--text-h4--font-weight: 600;
|
|
102
|
+
|
|
103
|
+
--text-lead: 1.125rem;
|
|
104
|
+
--text-lead--line-height: 1.6;
|
|
105
|
+
--text-lead--font-weight: 400;
|
|
106
|
+
|
|
107
|
+
--text-body: 1rem;
|
|
108
|
+
--text-body--line-height: 1.6;
|
|
109
|
+
--text-body--font-weight: 400;
|
|
110
|
+
|
|
111
|
+
--text-small: 0.875rem;
|
|
112
|
+
--text-small--line-height: 1.55;
|
|
113
|
+
--text-small--font-weight: 400;
|
|
114
|
+
|
|
115
|
+
--text-button: 0.875rem;
|
|
116
|
+
--text-button--letter-spacing: 0.005em;
|
|
117
|
+
--text-button--font-weight: 500;
|
|
118
|
+
|
|
119
|
+
--text-label: 0.75rem;
|
|
120
|
+
--text-label--letter-spacing: 0.08em;
|
|
121
|
+
--text-label--font-weight: 600;
|
|
122
|
+
|
|
123
|
+
--text-code: 0.875rem;
|
|
124
|
+
--text-code--line-height: 1.6;
|
|
125
|
+
--text-code--font-weight: 400;
|
|
126
|
+
|
|
127
|
+
/* Motion — easing in the --ease-* namespace so `ease-qovira` generates
|
|
128
|
+
* natively. (Duration shorthands `duration-micro|base|overlay` are defined as
|
|
129
|
+
* @utility rules alongside the other utilities; the raw values live below.) */
|
|
130
|
+
--ease-qovira: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
134
|
+
* Plain custom properties — NOT Tailwind utility namespaces, so they emit as
|
|
135
|
+
* regular CSS variables (no utilities generated).
|
|
136
|
+
* - durations: consumed by the duration-* @utility shorthands
|
|
137
|
+
* - z-index (spec addition): referenced via arbitrary values, e.g.
|
|
138
|
+
* `z-[var(--z-modal)]`
|
|
139
|
+
* ──────────────────────────────────────────────────────────────────────── */
|
|
140
|
+
:root {
|
|
141
|
+
--duration-micro: 140ms;
|
|
142
|
+
--duration-base: 200ms;
|
|
143
|
+
--duration-overlay: 280ms;
|
|
144
|
+
|
|
145
|
+
--z-base: 0;
|
|
146
|
+
--z-dropdown: 1000;
|
|
147
|
+
--z-sticky: 1100;
|
|
148
|
+
--z-overlay: 1200;
|
|
149
|
+
--z-modal: 1300;
|
|
150
|
+
--z-toast: 1400;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
154
|
+
* Layer 2 — Semantic aliases (theme-aware). Plain custom properties carrying
|
|
155
|
+
* MEANING, redeclared per theme so they resolve to the right value for the
|
|
156
|
+
* active `data-theme`. This is the only place a color is tied to a role and the
|
|
157
|
+
* only place the two themes diverge. Kept OUTSIDE @theme so they can be
|
|
158
|
+
* redeclared under the attribute selector.
|
|
159
|
+
*
|
|
160
|
+
* `:root` always matches <html>, so the daylight block is the default; the
|
|
161
|
+
* evening block follows it (equal specificity) and wins when data-theme=evening.
|
|
162
|
+
* ──────────────────────────────────────────────────────────────────────── */
|
|
163
|
+
:root,
|
|
164
|
+
[data-theme="daylight"] {
|
|
165
|
+
--bg: #f1e9dc; /* app background */
|
|
166
|
+
--surface: #f1e9dc; /* default surface */
|
|
167
|
+
--surface-raised: #faf6ef; /* raised cards, input fill */
|
|
168
|
+
--text: #1e1712; /* primary text (body always uses this) */
|
|
169
|
+
--text-muted: #5c4a37; /* secondary only — timestamps, counts, hints */
|
|
170
|
+
--border-hairline: #e6dac8;
|
|
171
|
+
--accent: #e0a458; /* honey — key CTA, highlights */
|
|
172
|
+
--link: #7e4f1c; /* honey-800 — AA on cream (5.8:1); honey-700 #a66b28 is AA-large only */
|
|
173
|
+
--accent-clay: #8a4b2c; /* clay secondary emphasis / links */
|
|
174
|
+
|
|
175
|
+
--btn-primary: #1e1712; /* espresso fill */
|
|
176
|
+
--btn-primary-fg: #f1e9dc;
|
|
177
|
+
--btn-primary-hover: #2c2118; /* warm-800 */
|
|
178
|
+
--btn-primary-active: #15100c;
|
|
179
|
+
|
|
180
|
+
--focus-ring: #e0a458; /* honey, both themes */
|
|
181
|
+
|
|
182
|
+
--shadow-sm:
|
|
183
|
+
0 1px 2px rgba(30, 24, 18, 0.1), 0 1px 1px rgba(30, 24, 18, 0.06);
|
|
184
|
+
--shadow-md:
|
|
185
|
+
0 2px 4px rgba(30, 24, 18, 0.08), 0 8px 20px rgba(30, 24, 18, 0.18);
|
|
186
|
+
--shadow-lg:
|
|
187
|
+
0 4px 8px rgba(30, 24, 18, 0.1), 0 20px 48px rgba(30, 24, 18, 0.26);
|
|
188
|
+
--lamp-glow: 0 0 22px rgba(224, 164, 88, 0.5);
|
|
189
|
+
|
|
190
|
+
/* Status tint/text — meaning only, never decoration. */
|
|
191
|
+
--success-tint: #e2f1ea;
|
|
192
|
+
--success-text: #1e7a50;
|
|
193
|
+
--warning-tint: #fbebd2;
|
|
194
|
+
--warning-text: #855400; /* darkened from #97600f to clear AA (5.5:1 on tint) */
|
|
195
|
+
--error-tint: #fbe6e1;
|
|
196
|
+
--error-text: #a8331f;
|
|
197
|
+
--info-tint: #e5eef9;
|
|
198
|
+
--info-text: #285699;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
[data-theme="evening"] {
|
|
202
|
+
--bg: #15100c;
|
|
203
|
+
--surface: #1e1712;
|
|
204
|
+
--surface-raised: #241b12;
|
|
205
|
+
--text: #f3ecdf;
|
|
206
|
+
--text-muted: #b7a892;
|
|
207
|
+
--border-hairline: #2c2118;
|
|
208
|
+
--accent: #e0a458;
|
|
209
|
+
--link: #ebbe74; /* lifted for contrast on dark */
|
|
210
|
+
--accent-clay: #d08c66;
|
|
211
|
+
|
|
212
|
+
--btn-primary: #e0a458; /* honey fill */
|
|
213
|
+
--btn-primary-fg: #1e1712;
|
|
214
|
+
--btn-primary-hover: #c9883c; /* honey-600 */
|
|
215
|
+
--btn-primary-active: #a66b28; /* honey-700 */
|
|
216
|
+
|
|
217
|
+
--focus-ring: #e0a458;
|
|
218
|
+
|
|
219
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24), 0 1px 1px rgba(0, 0, 0, 0.16);
|
|
220
|
+
--shadow-md: 0 2px 4px rgba(0, 0, 0, 0.28), 0 8px 20px rgba(0, 0, 0, 0.45);
|
|
221
|
+
--shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.55);
|
|
222
|
+
--lamp-glow: 0 0 22px rgba(224, 164, 88, 0.5);
|
|
223
|
+
|
|
224
|
+
/* Status tint/text — derived for the dark surface; AA-verified. */
|
|
225
|
+
--success-tint: #16271e;
|
|
226
|
+
--success-text: #6fd3a1;
|
|
227
|
+
--warning-tint: #2a2012;
|
|
228
|
+
--warning-text: #e9b25e;
|
|
229
|
+
--error-tint: #2e1813;
|
|
230
|
+
--error-text: #f0917f;
|
|
231
|
+
--info-tint: #16213a;
|
|
232
|
+
--info-text: #8fb4e8;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
236
|
+
* Layer 3 — Tailwind exposure. Re-export the semantic vars as Tailwind theme
|
|
237
|
+
* tokens. `inline` is the key: it emits `var(--surface)` INTO each utility
|
|
238
|
+
* instead of freezing the value, so `bg-surface`, `text-text`, `bg-success-tint`
|
|
239
|
+
* etc. automatically track whichever theme is on <html>.
|
|
240
|
+
*
|
|
241
|
+
* Shadows and the lamp glow stay as raw `var(--shadow-*)` / `var(--lamp-glow)`
|
|
242
|
+
* in recipes — they are not color utilities. `--focus-ring` is consumed directly
|
|
243
|
+
* by the focus-ring utility, and the status BASE colors come from layer 1.
|
|
244
|
+
* ──────────────────────────────────────────────────────────────────────── */
|
|
245
|
+
@theme inline {
|
|
246
|
+
--color-surface: var(--surface);
|
|
247
|
+
--color-surface-raised: var(--surface-raised);
|
|
248
|
+
--color-text: var(--text);
|
|
249
|
+
--color-text-muted: var(--text-muted);
|
|
250
|
+
--color-border: var(--border-hairline);
|
|
251
|
+
--color-accent: var(--accent);
|
|
252
|
+
--color-link: var(--link);
|
|
253
|
+
|
|
254
|
+
--color-btn-primary: var(--btn-primary);
|
|
255
|
+
--color-btn-primary-fg: var(--btn-primary-fg);
|
|
256
|
+
--color-btn-primary-hover: var(--btn-primary-hover);
|
|
257
|
+
--color-btn-primary-active: var(--btn-primary-active);
|
|
258
|
+
|
|
259
|
+
--color-success-tint: var(--success-tint);
|
|
260
|
+
--color-success-text: var(--success-text);
|
|
261
|
+
--color-warning-tint: var(--warning-tint);
|
|
262
|
+
--color-warning-text: var(--warning-text);
|
|
263
|
+
--color-error-tint: var(--error-tint);
|
|
264
|
+
--color-error-text: var(--error-text);
|
|
265
|
+
--color-info-tint: var(--info-tint);
|
|
266
|
+
--color-info-text: var(--info-text);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
270
|
+
* Utilities + motion guard. A few `@utility` definitions so components don't
|
|
271
|
+
* reinvent them, plus the global reduced-motion reset. These consume the
|
|
272
|
+
* primitive (`--ease-qovira`, `--duration-*`) and semantic (`--surface`,
|
|
273
|
+
* `--focus-ring`, `--lamp-glow`) tokens.
|
|
274
|
+
*
|
|
275
|
+
* `ease-qovira` is NOT defined here — it generates natively from the
|
|
276
|
+
* `--ease-qovira` primitive in the `--ease-*` namespace.
|
|
277
|
+
* ──────────────────────────────────────────────────────────────────────── */
|
|
278
|
+
|
|
279
|
+
/* The brand's non-negotiable focus ring: a 2px surface gap then a 2px honey
|
|
280
|
+
* ring. Applied to every interactive element; never removed. */
|
|
281
|
+
@utility focus-ring {
|
|
282
|
+
&:focus-visible {
|
|
283
|
+
outline: none;
|
|
284
|
+
box-shadow:
|
|
285
|
+
0 0 0 2px var(--surface),
|
|
286
|
+
0 0 0 4px var(--focus-ring);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* The signature lamp glow — a soft honey halo for focus emphasis, loaders, and
|
|
291
|
+
* special moments (never general elevation). */
|
|
292
|
+
@utility lamp-glow {
|
|
293
|
+
box-shadow: var(--lamp-glow);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* Loader form: a ~1200ms pulse driving the `qovira-pulse` keyframe. Pair with a
|
|
297
|
+
* honey radial-gradient background and a static / aria-live fallback so meaning
|
|
298
|
+
* is never trapped in animation. Collapsed by the reduced-motion guard below. */
|
|
299
|
+
@utility lamp-glow-pulse {
|
|
300
|
+
animation: qovira-pulse 1200ms var(--ease-qovira) infinite;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@keyframes qovira-pulse {
|
|
304
|
+
0%,
|
|
305
|
+
100% {
|
|
306
|
+
opacity: 0.55;
|
|
307
|
+
transform: scale(0.92);
|
|
308
|
+
}
|
|
309
|
+
50% {
|
|
310
|
+
opacity: 1;
|
|
311
|
+
transform: scale(1);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* Duration shorthands — v4 has no duration theme namespace, so these expose the
|
|
316
|
+
* `--duration-*` custom properties as `transition-duration` utilities. */
|
|
317
|
+
@utility duration-micro {
|
|
318
|
+
transition-duration: var(--duration-micro);
|
|
319
|
+
}
|
|
320
|
+
@utility duration-base {
|
|
321
|
+
transition-duration: var(--duration-base);
|
|
322
|
+
}
|
|
323
|
+
@utility duration-overlay {
|
|
324
|
+
transition-duration: var(--duration-overlay);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* Global reduced-motion guard — one reset so consumers don't each reinvent it.
|
|
328
|
+
* Meaning is never trapped in animation. */
|
|
329
|
+
@media (prefers-reduced-motion: reduce) {
|
|
330
|
+
*,
|
|
331
|
+
::before,
|
|
332
|
+
::after {
|
|
333
|
+
animation-duration: 0.01ms !important;
|
|
334
|
+
transition-duration: 0.01ms !important;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/* For the rare genuine structural (non-color) theme branch — most differences
|
|
339
|
+
* should be absorbed by the semantic layer, not this variant. */
|
|
340
|
+
@custom-variant evening (&:where([data-theme="evening"] *));
|
|
341
|
+
|
|
342
|
+
/*
|
|
343
|
+
* Spacing is intentionally NOT redefined. Brand's 4px base = 0.25rem = Tailwind
|
|
344
|
+
* v4's default --spacing step exactly, so the brand scale
|
|
345
|
+
* (4·8·12·16·20·24·32·40·48·64) maps 1:1 to p-1 p-2 p-3 p-4 p-5 p-6 p-8 p-10
|
|
346
|
+
* p-12 p-16. Rule: no off-grid spacing values — always use the scale steps.
|
|
347
|
+
*/
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qovira/theme",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Qovira's visual foundation — Tailwind v4 tokens, self-hosted fonts, and a framework-agnostic theming runtime.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"qovira",
|
|
7
|
+
"design-tokens",
|
|
8
|
+
"tailwindcss",
|
|
9
|
+
"theme",
|
|
10
|
+
"css"
|
|
11
|
+
],
|
|
12
|
+
"license": "Apache-2.0",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/qovira/theme.git"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/qovira/theme#readme",
|
|
18
|
+
"bugs": "https://github.com/qovira/theme/issues",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"packageManager": "pnpm@11.3.0",
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.18"
|
|
23
|
+
},
|
|
24
|
+
"sideEffects": [
|
|
25
|
+
"*.css"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./dist/theme.css",
|
|
29
|
+
"./fonts": "./dist/fonts.css",
|
|
30
|
+
"./runtime": "./dist/runtime.js",
|
|
31
|
+
"./boot": "./dist/boot.js"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsup && node scripts/copy-assets.mjs",
|
|
41
|
+
"typecheck": "tsc --noEmit",
|
|
42
|
+
"lint": "eslint . && prettier --check .",
|
|
43
|
+
"format": "prettier --write .",
|
|
44
|
+
"test": "vitest run"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"tailwindcss": "^4.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@eslint/js": "^10.0.1",
|
|
51
|
+
"@fontsource-variable/figtree": "^5.2.10",
|
|
52
|
+
"@fontsource-variable/fraunces": "^5.2.9",
|
|
53
|
+
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
|
54
|
+
"@tailwindcss/postcss": "^4.3.0",
|
|
55
|
+
"@tsconfig/strictest": "^2.0.8",
|
|
56
|
+
"@types/node": "^25.9.2",
|
|
57
|
+
"eslint": "^10.4.1",
|
|
58
|
+
"eslint-config-prettier": "^10.1.8",
|
|
59
|
+
"globals": "^17.6.0",
|
|
60
|
+
"happy-dom": "^20.10.2",
|
|
61
|
+
"postcss": "^8.5.15",
|
|
62
|
+
"prettier": "^3.8.3",
|
|
63
|
+
"tailwindcss": "^4.3.0",
|
|
64
|
+
"tsup": "^8.5.1",
|
|
65
|
+
"typescript": "^6.0.3",
|
|
66
|
+
"typescript-eslint": "^8.60.1",
|
|
67
|
+
"vitest": "^4.1.8"
|
|
68
|
+
}
|
|
69
|
+
}
|