@fest-lib/veela 1.0.10 → 1.0.11

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fest-lib/veela",
3
3
  "description": "fest-lib Veela: CSS tokens, --c2 color functions, Agate.UX, SCSS + runtime loaders",
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": true,
@@ -0,0 +1,193 @@
1
+ /*
2
+ * Overlay syntax paint + CSS Custom Highlight selection.
3
+ *
4
+ * FIND:code-highlight
5
+ * WHY: Syntax colors are a fixed light-dark() palette. Chrome tokens
6
+ * (`--color-primary`) and `color-mix` with `CanvasText` resolve to navy/black
7
+ * on the code background. `::highlight(code-selection)` mirrors host selection.
8
+ */
9
+ @layer components {
10
+ .code-highlight-overlay {
11
+ display: block;
12
+ pointer-events: none;
13
+ user-select: none;
14
+ overflow: hidden;
15
+ margin: 0;
16
+ padding: 0;
17
+ padding-inline-start: var(--code-gutter, 0px);
18
+ box-sizing: border-box;
19
+ color-scheme: inherit;
20
+ color: light-dark(#1f2328, #e6edf3);
21
+ -webkit-text-fill-color: currentColor;
22
+ white-space: pre;
23
+ tab-size: 4;
24
+ z-index: 1;
25
+ visibility: visible;
26
+ opacity: 1;
27
+ }
28
+
29
+ .code-highlight-overlay,
30
+ .code-highlight-overlay__gutter,
31
+ .code-highlight-overlay__paint,
32
+ .code-highlight-overlay__paint * {
33
+ font-family: inherit;
34
+ font-size: inherit;
35
+ font-weight: inherit;
36
+ font-style: inherit;
37
+ font-stretch: inherit;
38
+ font-variant: inherit;
39
+ font-variant-ligatures: none;
40
+ font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "dlig" 0;
41
+ font-kerning: none;
42
+ font-variation-settings: inherit;
43
+ line-height: var(--code-line-height, inherit);
44
+ letter-spacing: inherit;
45
+ word-spacing: inherit;
46
+ tab-size: inherit;
47
+ text-rendering: inherit;
48
+ font-synthesis: none;
49
+ -webkit-text-fill-color: currentColor;
50
+ }
51
+
52
+ .code-highlight-overlay__gutter {
53
+ position: absolute;
54
+ inset-block-start: 0;
55
+ inset-inline-start: 0;
56
+ inline-size: var(--code-gutter, 0px);
57
+ text-align: end;
58
+ padding-inline-end: 0.5rem;
59
+ box-sizing: border-box;
60
+ color: light-dark(#656d76, #8b949e);
61
+ white-space: pre;
62
+ overflow: hidden;
63
+ user-select: none;
64
+ pointer-events: none;
65
+ }
66
+
67
+ .code-highlight-overlay__paint {
68
+ min-inline-size: 0;
69
+ margin: 0;
70
+ padding: 0;
71
+ white-space: pre;
72
+ overflow: visible;
73
+ }
74
+
75
+ pre:has(> .code-highlight-overlay),
76
+ .code-highlight-host:has(> .code-highlight-overlay) {
77
+ position: relative;
78
+ }
79
+
80
+ pre:has(> .code-highlight-overlay) > code,
81
+ .code-highlight-source:has(+ .code-highlight-overlay),
82
+ .code-highlight-host > .code-highlight-source {
83
+ display: block;
84
+ line-height: var(--code-line-height, normal);
85
+ padding-inline-start: var(--code-gutter, 0px);
86
+ font-variant-ligatures: none;
87
+ font-kerning: none;
88
+ font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "dlig" 0;
89
+ caret-color: light-dark(#1f2328, #e6edf3);
90
+ }
91
+
92
+ /* INVARIANT: never hide source unless overlay paint has glyphs. */
93
+ pre:has(> .code-highlight-painted + .code-highlight-overlay) > code.code-highlight-painted,
94
+ .code-highlight-source.code-highlight-painted:has(+ .code-highlight-overlay),
95
+ .code-highlight-host > .code-highlight-source.code-highlight-painted {
96
+ color: transparent;
97
+ -webkit-text-fill-color: transparent;
98
+ }
99
+
100
+ pre:has(> .code-highlight-overlay) > code::selection,
101
+ .code-highlight-source::selection {
102
+ background-color: color-mix(in oklab, #79c0ff 32%, transparent);
103
+ color: transparent;
104
+ -webkit-text-fill-color: transparent;
105
+ }
106
+
107
+ pre[data-language]:not([data-language=""]) {
108
+ position: relative;
109
+ }
110
+
111
+ pre[data-language]:not([data-language=""])::after {
112
+ content: attr(data-language);
113
+ position: absolute;
114
+ inset-block-start: 0.35rem;
115
+ inset-inline-end: 0.5rem;
116
+ z-index: 2;
117
+ padding: 0.1em 0.45em;
118
+ border-radius: var(--radius-xs, 4px);
119
+ font-family: var(--md-font-sans, var(--font-family, sans-serif));
120
+ font-size: 0.7em;
121
+ line-height: 1.2;
122
+ letter-spacing: 0.02em;
123
+ text-transform: lowercase;
124
+ color: light-dark(#656d76, #8b949e);
125
+ background: color-mix(in oklab, var(--md-bg-code, var(--view-code-bg, Canvas)) 70%, transparent);
126
+ pointer-events: none;
127
+ }
128
+
129
+ .code-highlight-overlay {
130
+ .hljs-comment,
131
+ .hljs-quote {
132
+ color: light-dark(#656d76, #8b949e);
133
+ }
134
+
135
+ .hljs-keyword,
136
+ .hljs-selector-tag,
137
+ .hljs-literal,
138
+ .hljs-built_in {
139
+ color: light-dark(#0550ae, #79c0ff);
140
+ }
141
+
142
+ .hljs-string,
143
+ .hljs-addition,
144
+ .hljs-attr {
145
+ color: light-dark(#0a3069, #a5d6ff);
146
+ }
147
+
148
+ .hljs-number,
149
+ .hljs-variable,
150
+ .hljs-template-variable,
151
+ .hljs-type {
152
+ color: light-dark(#116329, #3fb950);
153
+ }
154
+
155
+ .hljs-title,
156
+ .hljs-title.function_,
157
+ .hljs-section,
158
+ .hljs-name {
159
+ color: light-dark(#0550ae, #79c0ff);
160
+ }
161
+
162
+ .hljs-property,
163
+ .hljs-attribute,
164
+ .hljs-selector-class,
165
+ .hljs-selector-id {
166
+ color: light-dark(#116329, #7ee787);
167
+ }
168
+
169
+ .hljs-meta,
170
+ .hljs-doctag,
171
+ .hljs-punctuation,
172
+ .hljs-operator,
173
+ .hljs-tag {
174
+ color: light-dark(#656d76, #c9d1d9);
175
+ }
176
+
177
+ .hljs-deletion {
178
+ color: light-dark(#cf222e, #ffa198);
179
+ }
180
+
181
+ .hljs-emphasis,
182
+ .hljs-strong {
183
+ color: inherit;
184
+ }
185
+ }
186
+ }
187
+
188
+ @layer overrides {
189
+ ::highlight(code-selection) {
190
+ background-color: color-mix(in oklab, #79c0ff 32%, transparent);
191
+ color: inherit;
192
+ }
193
+ }
@@ -23,6 +23,7 @@
23
23
  @use "../core/config" as config;
24
24
  @use "../core/tokens" as tokens;
25
25
  @use "../core/mixins" as mixins;
26
+ @use "./code-highlight";
26
27
 
27
28
  /* ─── Animations ──────────────────────────────────────────────────────────── */
28
29