@inkbar/theme 0.0.0-stage → 0.1.1
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 +21 -0
- package/README.md +78 -2
- package/package.json +33 -3
- package/theme.css +575 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Redactr Platforms Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/inkbar/inkbar/main/.github/assets/inkbar-mark-on-dark.svg">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/inkbar/inkbar/main/.github/assets/inkbar-mark-on-light.svg" alt="Inkbar" width="72" height="72">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
<h1 align="center">@inkbar/theme</h1>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
The default look for Inkbar: one stylesheet, no JavaScript.
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://inkbar.dev">Website</a> ·
|
|
16
|
+
<a href="https://inkbar.dev/docs/">Docs</a> ·
|
|
17
|
+
<a href="https://sandbox.inkbar.dev">Sandbox</a> ·
|
|
18
|
+
<a href="https://github.com/inkbar/inkbar">GitHub</a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
`@inkbar/theme` styles the viewer, toolbar, note threads and suggestion cards from `@inkbar/vue`, `@inkbar/react`, `@inkbar/svelte` and `createViewer` in `@inkbar/core`. Import it and ship, or override any part of it with your own CSS. If your app already defines shadcn tokens, the theme picks up your colours and radius.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pnpm add @inkbar/theme
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Import the stylesheet once in your app:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import '@inkbar/theme/theme.css'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Every rule sits in `@layer inkbar` and inside `:where()`, so each selector has zero specificity. Your unlayered CSS overrides it without `!important`.
|
|
38
|
+
|
|
39
|
+
## Layer order
|
|
40
|
+
|
|
41
|
+
Cascade layers win by order, whatever the specificity. The browser orders layers by first appearance, so if your stylesheet declares its own layers before this file loads, `inkbar` comes later and beats them. Declare `inkbar` first, at the top of your main stylesheet:
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
@layer inkbar, utilities;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Put `inkbar` ahead of your own layer names, and your utility classes override the theme.
|
|
48
|
+
|
|
49
|
+
## Tokens
|
|
50
|
+
|
|
51
|
+
The stylesheet is compatible with shadcn token names. It reads `--background`, `--foreground`, `--muted`, `--muted-foreground`, `--border`, `--primary`, `--primary-foreground`, `--ring` and `--radius` when your page defines them, and uses its own values when it does not. Dark values apply under `prefers-color-scheme: dark` or inside a `.dark` ancestor. Add `.light` to the root or an ancestor to keep the light values, including inside a `.dark` ancestor.
|
|
52
|
+
|
|
53
|
+
Colour tokens must hold complete CSS colour values. Tokens written as bare HSL channels (`--muted: 210 40% 96%`) do not work. Write the full colour instead:
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
--muted: hsl(210 40% 96%);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Annotation colours
|
|
60
|
+
|
|
61
|
+
Set these variables on `[data-ink-root]` to change the default colour for new annotations:
|
|
62
|
+
|
|
63
|
+
| Variable | Used for |
|
|
64
|
+
| -------------------------------------------------------------------------- | ----------------------------------- |
|
|
65
|
+
| `--ink-highlight`, `--ink-underline`, `--ink-strikeout`, `--ink-squiggly` | Text markup |
|
|
66
|
+
| `--ink-note`, `--ink-free-text` | Notes and text boxes |
|
|
67
|
+
| `--ink-shape`, `--ink-ink` | Shapes and freehand drawing |
|
|
68
|
+
| `--ink-redact`, `--ink-redact-fill` | Redaction outline and fill |
|
|
69
|
+
| `--ink-suggestion-low`, `--ink-suggestion-medium`, `--ink-suggestion-high` | Suggested redactions, by confidence |
|
|
70
|
+
|
|
71
|
+
Inkbar reads a colour when you create the annotation and stores it on the annotation, because the colour goes into the PDF. Changing a variable later affects new annotations only.
|
|
72
|
+
|
|
73
|
+
## Layout
|
|
74
|
+
|
|
75
|
+
The root and viewport fill their parent as a column, and the scroll area takes the remaining height. Give the parent a height and the document scrolls inside it.
|
|
76
|
+
|
|
77
|
+
## Licence
|
|
78
|
+
|
|
79
|
+
[MIT](https://github.com/inkbar/inkbar/blob/main/LICENSE). From the team behind [Redactr](https://redactr.io).
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkbar/theme",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Default stylesheet for Inkbar. Zero specificity, so your CSS wins.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://inkbar.dev",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/inkbar/inkbar.git",
|
|
10
|
+
"directory": "packages/theme"
|
|
11
|
+
},
|
|
12
|
+
"bugs": "https://github.com/inkbar/inkbar/issues",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"*.css"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
"theme.css",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"exports": {
|
|
22
|
+
"./theme.css": "./theme.css",
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"postcss": "^8.5.0",
|
|
27
|
+
"postcss-selector-parser": "^7.1.0",
|
|
28
|
+
"vitest": "^5.0.4"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "echo skip",
|
|
32
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
33
|
+
"lint": "eslint . && prettier --check theme.css",
|
|
34
|
+
"test": "vitest run"
|
|
35
|
+
}
|
|
6
36
|
}
|
package/theme.css
ADDED
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Inkbar default theme.
|
|
3
|
+
*
|
|
4
|
+
* Every rule sits in @layer inkbar and every selector is wrapped in :where(), so any rule of
|
|
5
|
+
* yours wins without !important. Interface colours read shadcn token names (--background,
|
|
6
|
+
* --foreground, --muted, --border, --primary, --radius) and fall back to Inkbar's own values
|
|
7
|
+
* when the page does not define them.
|
|
8
|
+
*
|
|
9
|
+
* Annotation colours (--ink-highlight and the rest) are read once, when an annotation is
|
|
10
|
+
* created, and stored on it, because they are written into the PDF. Changing them restyles
|
|
11
|
+
* new annotations only.
|
|
12
|
+
*/
|
|
13
|
+
@layer inkbar {
|
|
14
|
+
/* Tokens. Popovers are portalled out of the root, so they carry the tokens too. */
|
|
15
|
+
:where([data-ink-root], [data-ink-note-popover], [data-ink-suggestion-card]) {
|
|
16
|
+
--ink-highlight: #f2c230;
|
|
17
|
+
--ink-underline: #2b5a9e;
|
|
18
|
+
--ink-strikeout: #c0392b;
|
|
19
|
+
--ink-squiggly: #1f7a4d;
|
|
20
|
+
--ink-note: #f2c230;
|
|
21
|
+
--ink-free-text: #151820;
|
|
22
|
+
--ink-shape: #c0392b;
|
|
23
|
+
--ink-ink: #151820;
|
|
24
|
+
--ink-redact: #c0392b;
|
|
25
|
+
--ink-redact-fill: #000000;
|
|
26
|
+
--ink-suggestion-low: #d4a017;
|
|
27
|
+
--ink-suggestion-medium: #e67e22;
|
|
28
|
+
--ink-suggestion-high: #c0392b;
|
|
29
|
+
|
|
30
|
+
--ink-bg: var(--muted, #f1f2f5);
|
|
31
|
+
--ink-fg: var(--foreground, #151820);
|
|
32
|
+
--ink-muted-fg: var(--muted-foreground, #5a6170);
|
|
33
|
+
--ink-surface: var(--background, #ffffff);
|
|
34
|
+
--ink-border: var(--border, #dce0e7);
|
|
35
|
+
--ink-accent: var(--primary, #151820);
|
|
36
|
+
--ink-accent-fg: var(--primary-foreground, #ffffff);
|
|
37
|
+
--ink-ring: var(--ring, #2b5a9e);
|
|
38
|
+
--ink-radius: var(--radius, 0.5rem);
|
|
39
|
+
--ink-page-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
|
|
40
|
+
--ink-text-selection: color-mix(in srgb, AccentColor, transparent 50%);
|
|
41
|
+
|
|
42
|
+
color: var(--ink-fg);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (prefers-color-scheme: dark) {
|
|
46
|
+
:where(
|
|
47
|
+
[data-ink-root]:not(.light, .light *),
|
|
48
|
+
[data-ink-note-popover]:not(.light *),
|
|
49
|
+
[data-ink-suggestion-card]:not(.light *)
|
|
50
|
+
) {
|
|
51
|
+
--ink-bg: var(--muted, #0f1217);
|
|
52
|
+
--ink-fg: var(--foreground, #e6e9ef);
|
|
53
|
+
--ink-muted-fg: var(--muted-foreground, #9aa1ae);
|
|
54
|
+
--ink-surface: var(--background, #161a21);
|
|
55
|
+
--ink-border: var(--border, #2a303b);
|
|
56
|
+
--ink-accent: var(--primary, #e6e9ef);
|
|
57
|
+
--ink-accent-fg: var(--primary-foreground, #151820);
|
|
58
|
+
--ink-ring: var(--ring, #7aa5e6);
|
|
59
|
+
--ink-page-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* A .light element inside a .dark one keeps the light values. */
|
|
64
|
+
:where(
|
|
65
|
+
.dark [data-ink-root]:not(.light, .dark .light *),
|
|
66
|
+
[data-ink-root].dark,
|
|
67
|
+
.dark [data-ink-note-popover]:not(.dark .light *),
|
|
68
|
+
.dark [data-ink-suggestion-card]:not(.dark .light *)
|
|
69
|
+
) {
|
|
70
|
+
--ink-bg: var(--muted, #0f1217);
|
|
71
|
+
--ink-fg: var(--foreground, #e6e9ef);
|
|
72
|
+
--ink-muted-fg: var(--muted-foreground, #9aa1ae);
|
|
73
|
+
--ink-surface: var(--background, #161a21);
|
|
74
|
+
--ink-border: var(--border, #2a303b);
|
|
75
|
+
--ink-accent: var(--primary, #e6e9ef);
|
|
76
|
+
--ink-accent-fg: var(--primary-foreground, #151820);
|
|
77
|
+
--ink-ring: var(--ring, #7aa5e6);
|
|
78
|
+
--ink-page-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Layout: root and viewport fill their parent; the scroll area takes the space left over. */
|
|
82
|
+
:where([data-ink-root]) {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
height: 100%;
|
|
86
|
+
min-height: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:where([data-ink-viewport-root]) {
|
|
90
|
+
position: relative;
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
flex: 1 1 auto;
|
|
94
|
+
height: 100%;
|
|
95
|
+
min-height: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:where(.ink-scroll) {
|
|
99
|
+
flex: 1 1 auto;
|
|
100
|
+
min-height: 0;
|
|
101
|
+
background: var(--ink-bg);
|
|
102
|
+
outline-offset: -2px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:where(.ink-scroll:focus-visible) {
|
|
106
|
+
outline: 2px solid var(--ink-ring);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:where(.ink-page) {
|
|
110
|
+
background: #ffffff;
|
|
111
|
+
box-shadow: var(--ink-page-shadow);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Loading, error and empty states cover the scroll area. */
|
|
115
|
+
:where(.ink-status) {
|
|
116
|
+
position: absolute;
|
|
117
|
+
inset: 0;
|
|
118
|
+
z-index: 1;
|
|
119
|
+
display: grid;
|
|
120
|
+
place-content: center;
|
|
121
|
+
gap: 0.25rem;
|
|
122
|
+
padding: 1rem;
|
|
123
|
+
text-align: center;
|
|
124
|
+
background: var(--ink-bg);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:where(.ink-error-title) {
|
|
128
|
+
margin: 0;
|
|
129
|
+
font-weight: 600;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:where(.ink-error-code) {
|
|
133
|
+
margin-right: 0.5rem;
|
|
134
|
+
font-family: ui-monospace, monospace;
|
|
135
|
+
font-size: 0.8rem;
|
|
136
|
+
color: var(--ink-muted-fg);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* A page that failed to render: covers that page only. */
|
|
140
|
+
:where(.ink-page-error) {
|
|
141
|
+
position: absolute;
|
|
142
|
+
inset: 0;
|
|
143
|
+
z-index: 2;
|
|
144
|
+
display: grid;
|
|
145
|
+
place-content: center;
|
|
146
|
+
gap: 0.25rem;
|
|
147
|
+
padding: 1rem;
|
|
148
|
+
text-align: center;
|
|
149
|
+
color: var(--ink-fg);
|
|
150
|
+
background: var(--ink-surface);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:where(.ink-page-error p) {
|
|
154
|
+
margin: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/*
|
|
158
|
+
* Text layer: the .textLayer rules from pdfjs-dist 6.4.299 web/pdf_viewer.css, renamed to
|
|
159
|
+
* .ink-text-layer. PDF.js sizes the layer from --total-scale-factor (set on the page) and
|
|
160
|
+
* --scale-round-x/y, writes --font-height, --scale-x and --rotate on each span and
|
|
161
|
+
* data-main-rotation on the layer. These rules turn those into the final layout.
|
|
162
|
+
*/
|
|
163
|
+
:where(.ink-text-layer) {
|
|
164
|
+
--scale-round-x: 1px;
|
|
165
|
+
--scale-round-y: 1px;
|
|
166
|
+
--min-font-size: 1;
|
|
167
|
+
--text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
|
|
168
|
+
--min-font-size-inv: calc(1 / var(--min-font-size));
|
|
169
|
+
|
|
170
|
+
color-scheme: only light;
|
|
171
|
+
overflow: clip;
|
|
172
|
+
opacity: 1;
|
|
173
|
+
text-align: initial;
|
|
174
|
+
line-height: 1;
|
|
175
|
+
letter-spacing: normal;
|
|
176
|
+
word-spacing: normal;
|
|
177
|
+
text-size-adjust: none;
|
|
178
|
+
forced-color-adjust: none;
|
|
179
|
+
transform-origin: 0 0;
|
|
180
|
+
caret-color: CanvasText;
|
|
181
|
+
z-index: 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:where(.ink-text-layer span, .ink-text-layer br) {
|
|
185
|
+
color: transparent;
|
|
186
|
+
position: absolute;
|
|
187
|
+
white-space: pre;
|
|
188
|
+
cursor: text;
|
|
189
|
+
transform-origin: 0% 0%;
|
|
190
|
+
user-select: text;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:where(
|
|
194
|
+
.ink-text-layer > :not(.markedContent),
|
|
195
|
+
.ink-text-layer .markedContent span:not(.markedContent)
|
|
196
|
+
) {
|
|
197
|
+
--font-height: 0;
|
|
198
|
+
--scale-x: 1;
|
|
199
|
+
--rotate: 0deg;
|
|
200
|
+
|
|
201
|
+
z-index: 1;
|
|
202
|
+
font-size: calc(var(--text-scale-factor) * var(--font-height));
|
|
203
|
+
transform: rotate(var(--rotate)) scaleX(var(--scale-x))
|
|
204
|
+
scale(var(--min-font-size-inv));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
:where(.ink-text-layer .markedContent) {
|
|
208
|
+
display: contents;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
:where(.ink-text-layer span[role='img']) {
|
|
212
|
+
user-select: none;
|
|
213
|
+
cursor: default;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
:where(.ink-text-layer[data-main-rotation='90']) {
|
|
217
|
+
transform: rotate(90deg) translateY(-100%);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:where(.ink-text-layer[data-main-rotation='180']) {
|
|
221
|
+
transform: rotate(180deg) translate(-100%, -100%);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:where(.ink-text-layer[data-main-rotation='270']) {
|
|
225
|
+
transform: rotate(270deg) translateX(-100%);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
:where(.ink-text-layer span)::selection {
|
|
229
|
+
background: var(--ink-text-selection, rgb(0 0 255 / 0.25));
|
|
230
|
+
color: transparent;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:where(.ink-text-layer br)::selection {
|
|
234
|
+
background: transparent;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Tools: the active tool's cursor is set on the root; text spans follow it unless text is the target. */
|
|
238
|
+
:where(
|
|
239
|
+
[data-ink-tool='redact-area'] .ink-text-layer span,
|
|
240
|
+
[data-ink-tool='note'] .ink-text-layer span
|
|
241
|
+
) {
|
|
242
|
+
cursor: inherit;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
:where(.ink-draft, .ink-marquee) {
|
|
246
|
+
border: 1px dashed var(--ink-accent);
|
|
247
|
+
background: color-mix(in srgb, var(--ink-accent) 10%, transparent);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
:where(.ink-draft[data-ink-draft='redact']) {
|
|
251
|
+
border-color: var(--ink-redact);
|
|
252
|
+
background: color-mix(in srgb, var(--ink-redact) 15%, transparent);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Resize handles on a selected area mark, text box or shape: shown with the select tool only. */
|
|
256
|
+
:where(.ink-handle) {
|
|
257
|
+
box-sizing: border-box;
|
|
258
|
+
border: 1px solid var(--ink-accent);
|
|
259
|
+
border-radius: 1px;
|
|
260
|
+
background: var(--ink-surface);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
:where([data-ink-tool]:not([data-ink-tool='select']) .ink-handle) {
|
|
264
|
+
display: none;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
:where(.ink-handle[data-handle='nw'], .ink-handle[data-handle='se']) {
|
|
268
|
+
cursor: nwse-resize;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
:where(.ink-handle[data-handle='ne'], .ink-handle[data-handle='sw']) {
|
|
272
|
+
cursor: nesw-resize;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* Annotations */
|
|
276
|
+
:where(.ink-overlay) {
|
|
277
|
+
z-index: 1;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
:where(.ink-annotation) {
|
|
281
|
+
border-radius: 2px;
|
|
282
|
+
outline: 1px solid transparent;
|
|
283
|
+
outline-offset: 1px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
:where(.ink-annotation:not([data-custom]) > svg) {
|
|
287
|
+
position: absolute;
|
|
288
|
+
left: 0;
|
|
289
|
+
top: 0;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
:where(
|
|
293
|
+
[data-ink-tool='select'] .ink-annotation,
|
|
294
|
+
[data-ink-tool='view'] .ink-annotation
|
|
295
|
+
) {
|
|
296
|
+
cursor: pointer;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
:where(.ink-annotation[data-state='hover']) {
|
|
300
|
+
outline-color: color-mix(in srgb, var(--ink-ring) 50%, transparent);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
:where(.ink-annotation[data-state='selected'], .ink-annotation:focus-visible) {
|
|
304
|
+
outline: 2px solid var(--ink-ring);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/* Locked annotations can be selected but not moved or deleted. */
|
|
308
|
+
:where(.ink-annotation[data-locked]) {
|
|
309
|
+
cursor: default;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
:where(.ink-annotation[data-locked][data-state='selected']) {
|
|
313
|
+
outline-style: dotted;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
:where(.ink-annotation[data-origin='suggested'] .ink-annotation-shape > *) {
|
|
317
|
+
stroke-dasharray: 4 3;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
:where(.ink-note-icon) {
|
|
321
|
+
position: absolute;
|
|
322
|
+
left: 0;
|
|
323
|
+
top: 0;
|
|
324
|
+
display: block;
|
|
325
|
+
width: 20px;
|
|
326
|
+
height: 20px;
|
|
327
|
+
border-radius: 3px 3px 3px 0;
|
|
328
|
+
background: var(--ink-note);
|
|
329
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
|
|
330
|
+
pointer-events: none;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
:where(.ink-free-text) {
|
|
334
|
+
width: 100%;
|
|
335
|
+
height: 100%;
|
|
336
|
+
overflow: hidden;
|
|
337
|
+
font-family: var(--ink-font-family, Helvetica), Helvetica, Arial, sans-serif;
|
|
338
|
+
font-size: var(--ink-font-size);
|
|
339
|
+
line-height: 1.2;
|
|
340
|
+
color: var(--ink-text-color, var(--ink-free-text));
|
|
341
|
+
opacity: var(--ink-opacity, 1);
|
|
342
|
+
overflow-wrap: break-word;
|
|
343
|
+
white-space: pre-wrap;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
:where(.ink-free-text[data-align='left']) {
|
|
347
|
+
text-align: left;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
:where(.ink-free-text[data-align='center']) {
|
|
351
|
+
text-align: center;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
:where(.ink-free-text[data-align='right']) {
|
|
355
|
+
text-align: right;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* Toolbar */
|
|
359
|
+
:where(.ink-toolbar) {
|
|
360
|
+
display: flex;
|
|
361
|
+
flex-wrap: wrap;
|
|
362
|
+
align-items: center;
|
|
363
|
+
gap: 0.5rem;
|
|
364
|
+
padding: 0.375rem 0.5rem;
|
|
365
|
+
background: var(--ink-surface);
|
|
366
|
+
color: var(--ink-fg);
|
|
367
|
+
border-bottom: 1px solid var(--ink-border);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
:where(.ink-toolbar-group) {
|
|
371
|
+
display: flex;
|
|
372
|
+
align-items: center;
|
|
373
|
+
gap: 0.125rem;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
:where(.ink-toolbar-group + .ink-toolbar-group) {
|
|
377
|
+
padding-left: 0.5rem;
|
|
378
|
+
border-left: 1px solid var(--ink-border);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
:where(.ink-toolbar button) {
|
|
382
|
+
display: inline-flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
justify-content: center;
|
|
385
|
+
min-width: 2.25rem;
|
|
386
|
+
height: 2.25rem;
|
|
387
|
+
padding: 0 0.5rem;
|
|
388
|
+
border: 1px solid transparent;
|
|
389
|
+
border-radius: calc(var(--ink-radius) - 2px);
|
|
390
|
+
background: transparent;
|
|
391
|
+
color: inherit;
|
|
392
|
+
font: inherit;
|
|
393
|
+
cursor: pointer;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
:where(.ink-toolbar button:hover) {
|
|
397
|
+
background: color-mix(in srgb, var(--ink-fg) 8%, transparent);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
:where(.ink-toolbar button[data-state='on']) {
|
|
401
|
+
background: var(--ink-accent);
|
|
402
|
+
color: var(--ink-accent-fg);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
:where(.ink-toolbar button:disabled) {
|
|
406
|
+
opacity: 0.5;
|
|
407
|
+
cursor: default;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
:where(.ink-toolbar select, .ink-toolbar input) {
|
|
411
|
+
height: 2.25rem;
|
|
412
|
+
padding: 0 0.5rem;
|
|
413
|
+
border: 1px solid var(--ink-border);
|
|
414
|
+
border-radius: calc(var(--ink-radius) - 2px);
|
|
415
|
+
background: var(--ink-surface);
|
|
416
|
+
color: inherit;
|
|
417
|
+
font: inherit;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
:where(.ink-page-input) {
|
|
421
|
+
width: 4rem;
|
|
422
|
+
text-align: center;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
:where(.ink-page-count) {
|
|
426
|
+
padding: 0 0.25rem;
|
|
427
|
+
color: var(--ink-muted-fg);
|
|
428
|
+
font-size: 0.875rem;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* Note threads and suggestion cards */
|
|
432
|
+
:where(.ink-note-popover, .ink-suggestion-card) {
|
|
433
|
+
z-index: 50;
|
|
434
|
+
width: 20rem;
|
|
435
|
+
max-width: calc(100vw - 1rem);
|
|
436
|
+
padding: 0.75rem;
|
|
437
|
+
border: 1px solid var(--ink-border);
|
|
438
|
+
border-radius: var(--ink-radius);
|
|
439
|
+
background: var(--ink-surface);
|
|
440
|
+
color: var(--ink-fg);
|
|
441
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 0.15);
|
|
442
|
+
font-size: 0.875rem;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
:where(.ink-thread) {
|
|
446
|
+
display: grid;
|
|
447
|
+
gap: 0.5rem;
|
|
448
|
+
max-height: 16rem;
|
|
449
|
+
margin: 0 0 0.5rem;
|
|
450
|
+
padding: 0;
|
|
451
|
+
overflow: auto;
|
|
452
|
+
list-style: none;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
:where(.ink-thread-item[data-reply]) {
|
|
456
|
+
margin-left: 0.75rem;
|
|
457
|
+
padding-left: 0.5rem;
|
|
458
|
+
border-left: 2px solid var(--ink-border);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
:where(.ink-thread-author) {
|
|
462
|
+
font-weight: 600;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
:where(.ink-thread-time) {
|
|
466
|
+
margin-left: 0.5rem;
|
|
467
|
+
color: var(--ink-muted-fg);
|
|
468
|
+
font-size: 0.75rem;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
:where(.ink-thread-text) {
|
|
472
|
+
margin: 0.125rem 0 0;
|
|
473
|
+
white-space: pre-wrap;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
:where(.ink-thread-reply textarea) {
|
|
477
|
+
box-sizing: border-box;
|
|
478
|
+
width: 100%;
|
|
479
|
+
padding: 0.375rem;
|
|
480
|
+
border: 1px solid var(--ink-border);
|
|
481
|
+
border-radius: calc(var(--ink-radius) - 2px);
|
|
482
|
+
background: var(--ink-surface);
|
|
483
|
+
color: inherit;
|
|
484
|
+
font: inherit;
|
|
485
|
+
resize: vertical;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
:where(.ink-thread-actions, .ink-suggestion-actions) {
|
|
489
|
+
display: flex;
|
|
490
|
+
gap: 0.375rem;
|
|
491
|
+
margin-top: 0.5rem;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
:where(.ink-thread-actions button, .ink-suggestion-actions button) {
|
|
495
|
+
padding: 0.375rem 0.75rem;
|
|
496
|
+
border: 1px solid var(--ink-border);
|
|
497
|
+
border-radius: calc(var(--ink-radius) - 2px);
|
|
498
|
+
background: var(--ink-surface);
|
|
499
|
+
color: inherit;
|
|
500
|
+
font: inherit;
|
|
501
|
+
cursor: pointer;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
:where(
|
|
505
|
+
.ink-thread-actions button[type='submit'],
|
|
506
|
+
.ink-suggestion-actions button:first-child
|
|
507
|
+
) {
|
|
508
|
+
border-color: var(--ink-accent);
|
|
509
|
+
background: var(--ink-accent);
|
|
510
|
+
color: var(--ink-accent-fg);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
:where(.ink-thread-actions button:disabled) {
|
|
514
|
+
opacity: 0.5;
|
|
515
|
+
cursor: default;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
:where(
|
|
519
|
+
.ink-toolbar button:focus-visible,
|
|
520
|
+
.ink-toolbar select:focus-visible,
|
|
521
|
+
.ink-toolbar input:focus-visible,
|
|
522
|
+
.ink-thread-actions button:focus-visible,
|
|
523
|
+
.ink-suggestion-actions button:focus-visible,
|
|
524
|
+
.ink-thread-reply textarea:focus-visible
|
|
525
|
+
) {
|
|
526
|
+
outline: 2px solid var(--ink-ring);
|
|
527
|
+
outline-offset: 2px;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
:where(.ink-suggestion-reason, .ink-suggestion-explanation) {
|
|
531
|
+
margin: 0;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
:where(.ink-suggestion-explanation) {
|
|
535
|
+
margin-top: 0.25rem;
|
|
536
|
+
color: var(--ink-muted-fg);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/* The label text keeps the body colour for contrast; the confidence colour is a swatch. */
|
|
540
|
+
:where(.ink-suggestion-confidence) {
|
|
541
|
+
display: inline-flex;
|
|
542
|
+
align-items: center;
|
|
543
|
+
gap: 0.375rem;
|
|
544
|
+
margin-left: 0.5rem;
|
|
545
|
+
color: var(--ink-fg);
|
|
546
|
+
font-size: 0.75rem;
|
|
547
|
+
text-transform: capitalize;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
:where(.ink-suggestion-confidence)::before {
|
|
551
|
+
content: '';
|
|
552
|
+
width: 0.5rem;
|
|
553
|
+
height: 0.5rem;
|
|
554
|
+
border-radius: 50%;
|
|
555
|
+
background: currentColor;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
:where(.ink-suggestion-confidence[data-confidence='low'])::before {
|
|
559
|
+
background: var(--ink-suggestion-low);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
:where(.ink-suggestion-confidence[data-confidence='medium'])::before {
|
|
563
|
+
background: var(--ink-suggestion-medium);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
:where(.ink-suggestion-confidence[data-confidence='high'])::before {
|
|
567
|
+
background: var(--ink-suggestion-high);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
571
|
+
:where(.ink-annotation) {
|
|
572
|
+
transition: outline-color 120ms ease;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|