-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweid.css
More file actions
268 lines (230 loc) · 8.08 KB
/
Copy pathweid.css
File metadata and controls
268 lines (230 loc) · 8.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/*! weid v0.1 — the visible layer of authorship disclosure · MIT
*
* Base rule: in a document declared as AI-assisted, anything NOT marked was
* written by the AI. The marks point at the human, because the human part is
* the scarce thing — and the thing worth being able to audit.
*
* Usage: <link rel="stylesheet" href="weid.css"> and nothing else.
* No build, no JavaScript, no dependencies.
*/
:root {
--weid-accent: #0f766e; /* human marks */
--weid-note-color: #78716c; /* AI-contribution notes */
--weid-border: rgb(214 211 209 / 0.6);
--weid-note-width: 172px;
--weid-note-gap: 28px;
}
/* Dark by system preference. `:not(.light)` lets a site that forces a light
theme opt out by adding class="light" to <html>. */
@media (prefers-color-scheme: dark) {
:root:not(.light) {
--weid-accent: #5eead4;
--weid-note-color: #a8a29e;
--weid-border: rgb(68 64 60 / 0.6);
}
}
/* Dark by class (Tailwind, Astro, themes using data-theme). */
:root.dark,
:root[data-theme="dark"] {
--weid-accent: #5eead4;
--weid-note-color: #a8a29e;
--weid-border: rgb(68 64 60 / 0.6);
}
/* ── 1. Human marks ────────────────────────────────────────────────
Distinguished by line style, not colour: legible to readers who do not
distinguish colours, and they survive monochrome printing. */
.weid-verbatim,
.weid-idea,
.weid-experience {
text-decoration-line: underline;
text-decoration-color: var(--weid-accent);
text-decoration-thickness: 1.5px;
text-underline-offset: 3px;
}
.weid-verbatim { text-decoration-style: solid; }
.weid-idea { text-decoration-style: dashed; }
.weid-experience { text-decoration-style: dotted; }
/* ── 2. AI-contribution notes ──────────────────────────────────────
They live inside the paragraph they annotate. Strip the CSS and they are
still there and still honest: disclosure does not depend on a stylesheet. */
.weid-note {
display: block;
margin: 0.75rem 0;
padding-left: 0.85rem;
border-left: 2px solid var(--weid-border);
color: var(--weid-note-color);
font-size: 0.8rem;
line-height: 1.45;
font-style: normal;
text-align: left;
}
.weid-note::before {
content: "◦ ";
color: var(--weid-accent);
}
/* Inside the legend, a note is a sample of itself, not a note: it stays in
its bullet instead of floating off to the margin. */
.weid-legend .weid-note {
display: inline;
float: none;
width: auto;
margin: 0;
padding: 0;
border: 0;
font-size: inherit;
color: var(--weid-note-color);
}
/* To the margin when there is room. Below 1100px it returns to the flow. */
@media (min-width: 1100px) {
.weid-note {
float: right;
clear: right;
width: var(--weid-note-width);
margin: 0.25rem 0 0.75rem 0;
margin-right: calc(-1 * (var(--weid-note-width) + var(--weid-note-gap)));
padding-left: 0;
border-left: 0;
}
/* Escape hatch for narrow layouts or ones with overflow: hidden. */
.weid-notes-inline .weid-note {
float: none;
width: auto;
margin: 0.75rem 0;
padding-left: 0.85rem;
border-left: 2px solid var(--weid-border);
}
}
@media print {
.weid-note {
float: none;
width: auto;
margin: 0.5rem 0;
padding-left: 0.85rem;
border-left: 2px solid var(--weid-border);
}
}
/* ── 3. Legend ─────────────────────────────────────────────────────
Mandatory: without it the marks are decoration, not disclosure. */
.weid-legend {
font-size: 0.85rem;
line-height: 1.5;
border: 1px solid var(--weid-border);
border-radius: 0.5rem;
padding: 0.85rem 1rem;
margin-bottom: 2rem;
}
.weid-legend ul {
margin: 0.5rem 0 0;
padding-left: 1.1rem;
}
.weid-legend li { margin: 0.15rem 0; }
/* The credit, optional: a link back to the convention at the foot of the
legend. The name wears the verbatim mark — weid signing with its own
underline. */
.weid-credit {
display: block;
margin-top: 0.8rem;
padding-top: 0.55rem;
border-top: 1px solid var(--weid-border);
text-align: right;
font-size: 0.75rem;
color: var(--weid-note-color);
text-decoration: none;
transition: color 0.2s ease;
}
.weid-credit b {
font-weight: 500;
color: var(--weid-accent);
text-decoration-line: underline;
text-decoration-style: solid;
text-decoration-color: var(--weid-accent);
text-decoration-thickness: 1.5px;
text-underline-offset: 3px;
}
.weid-credit:hover { color: var(--weid-accent); }
/* ── 4. Voice pill ─────────────────────────────────────────────────
The visible counterpart of data-weid-voice. It goes above the legend,
because it is the first thing a reader wants to know: whose voice is
this? */
.weid-voice {
/* flex + fit-content, not inline-flex: the pill takes a line of its own
without needing an extra wrapper around it. */
display: flex;
width: fit-content;
align-items: baseline;
margin: 0 0 0.7rem;
padding: 0.15rem 0.65rem;
border: 1px solid currentColor;
border-radius: 999px;
color: var(--weid-accent);
font-size: 0.72rem;
font-weight: 600;
letter-spacing: 0.01em;
line-height: 1.7;
}
/* No opacity here: it would mix the colour into the background and drop the
contrast to 3.4:1. The lighter weight already sets the source apart. */
.weid-voice-src {
font-weight: 400;
}
.weid-voice-src::before {
content: "·";
margin: 0 0.4rem;
opacity: 0.6;
}
/* A third party's voice looks different on purpose: it is the case this
convention exists to expose, not one more entry in a list. */
.weid-voice--third-party { color: #b45309; }
@media (prefers-color-scheme: dark) {
:root:not(.light) .weid-voice--third-party { color: #fbbf24; }
}
:root.dark .weid-voice--third-party,
:root[data-theme="dark"] .weid-voice--third-party { color: #fbbf24; }
/* ── 5. Toggle, without JavaScript ─────────────────────────────────
A checkbox and :has(). The state lives in the DOM, not in a script. */
.weid-toggle {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.weid-toggle-label {
float: right;
margin-left: 1rem;
padding: 0.15rem 0.6rem;
border: 1px solid currentColor;
border-radius: 999px;
color: var(--weid-accent);
font-size: 0.75rem;
white-space: nowrap;
cursor: pointer;
}
/* Both markups: the checkbox inside the label, or beside it with `for=`
(the only option where the editor will not let you nest). */
.weid-toggle-label:has(.weid-toggle:focus-visible),
.weid-toggle:focus-visible + .weid-toggle-label {
outline: 2px solid var(--weid-accent);
outline-offset: 2px;
}
.weid-lbl-off { display: none; }
/* Anchored to the element that carries the disclosure — the same root §3 makes
mandatory, so this works whether the work is an <article> or the whole
<body>. A bare `:has()` would also match `html` and `body`, and on a page
with two posts one toggle would silently unmark the other. */
:is([data-ai-disclosure], [ai-disclosure]):has(.weid-toggle:checked)
:is(.weid-verbatim, .weid-idea, .weid-experience) {
text-decoration-line: none;
}
:is([data-ai-disclosure], [ai-disclosure]):has(.weid-toggle:checked)
.weid-note { display: none; }
/* ...except the legend's sample, which is the label of its own bullet, not a
note. Without this the bullet loses its label and starts with a stray ":". */
:is([data-ai-disclosure], [ai-disclosure]):has(.weid-toggle:checked)
.weid-legend .weid-note { display: inline; }
:is([data-ai-disclosure], [ai-disclosure]):has(.weid-toggle:checked)
.weid-lbl-on { display: none; }
:is([data-ai-disclosure], [ai-disclosure]):has(.weid-toggle:checked)
.weid-lbl-off { display: inline; }
/* The legend is not dimmed while the marks are off: at the opacity that read
as "inactive" it fell to 2.9:1, and the label already says which state it is
in. */