lutra 0.1.15 → 0.1.17

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.
@@ -437,4 +437,26 @@
437
437
  @property --menu-border-color { syntax: "*"; inherits: true; initial-value: #cccccc; }
438
438
  @property --menu-border-size { syntax: "<length>"; inherits: true; initial-value: 1px; }
439
439
  @property --menu-border-style { syntax: "solid | dashed | dotted | double | groove | ridge | inset | outset"; inherits: true; initial-value: solid; }
440
- @property --menu-border-radius { syntax: "<length>"; inherits: true; initial-value: 8px; }
440
+ @property --menu-border-radius { syntax: "<length>"; inherits: true; initial-value: 8px; }
441
+
442
+ /**
443
+ * Table
444
+ */
445
+
446
+ @property --table-border-color { syntax: "*"; inherits: true; initial-value: #d1d5db; }
447
+ @property --table-border-size { syntax: "<length>"; inherits: true; initial-value: 1px; }
448
+ @property --table-border-style { syntax: "solid | dashed | dotted | double | groove | ridge | inset | outset"; inherits: true; initial-value: solid; }
449
+ @property --table-border-radius { syntax: "<length>"; inherits: true; initial-value: 8px; }
450
+
451
+ @property --table-cell-padding-inline { syntax: "<length>"; inherits: true; initial-value: 12px; }
452
+ @property --table-cell-padding-block { syntax: "<length>"; inherits: true; initial-value: 8px; }
453
+
454
+ @property --table-header-background { syntax: "<color>"; inherits: true; initial-value: #f8fafc; }
455
+ @property --table-header-color { syntax: "*"; inherits: true; initial-value: #1a1a1a; }
456
+ @property --table-header-font-weight { syntax: "<number>"; inherits: true; initial-value: 600; }
457
+
458
+ @property --table-row-background { syntax: "<color>"; inherits: true; initial-value: transparent; }
459
+ @property --table-row-background-even { syntax: "<color>"; inherits: true; initial-value: #f8fafc; }
460
+ @property --table-row-background-hover { syntax: "<color>"; inherits: true; initial-value: #f1f5f9; }
461
+
462
+ @property --table-cell-color { syntax: "*"; inherits: true; initial-value: #1a1a1a; }
@@ -115,6 +115,10 @@
115
115
  --tooltip-border-radius: var(--border-radius-base);
116
116
  --tooltip-shadow-color: var(--shadow-color);
117
117
 
118
+ /* Table compound variables */
119
+ --table-border: var(--table-border-size) var(--table-border-style) var(--table-border-color);
120
+ --table-cell-padding: var(--table-cell-padding-block) var(--table-cell-padding-inline);
121
+
118
122
  --mix-target: light-dark(black, white);
119
123
  }
120
124
 
@@ -133,6 +137,7 @@ body {
133
137
  min-width: 280px;
134
138
  width: 100%;
135
139
  min-height: 0;
140
+ scrollbar-gutter: stable;
136
141
  }
137
142
 
138
143
  body * {
@@ -176,12 +181,17 @@ input, textarea, select, .button, ::file-selector-button, .Field {
176
181
  outline-offset var(--transition-duration-fast) var(--transition-timing-function);
177
182
  }
178
183
 
179
- input:focus-visible, textarea:focus-visible, select:focus-visible {
184
+ input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
180
185
  outline: var(--focus-ring-size) solid var(--focus-ring-color);
181
186
  outline-offset: var(--focus-ring-offset);
182
187
  border-color: var(--focus-ring-color);
183
188
  }
184
189
 
190
+ /* Remove focus styles for mouse/touch users, keep for keyboard */
191
+ :focus:not(:focus-visible) {
192
+ outline: none;
193
+ }
194
+
185
195
  input::placeholder, textarea::placeholder, select::placeholder {
186
196
  color: var(--field-placeholder-color);
187
197
  }
@@ -1,11 +1,19 @@
1
1
  @scope (.PageContent) to (.UIContent) {
2
+ /* Optional hyphenation when lang attribute is present */
3
+ :scope:where([lang]) {
4
+ hyphens: auto;
5
+ hyphenate-limit-chars: 6 3 3;
6
+ }
7
+
2
8
  /* Heading spacing for proper markdown hierarchy */
3
9
  h1, h2, h3, h4, h5, h6 {
4
10
  margin-block: var(--space-xl) var(--space-md);
11
+ text-wrap: balance;
12
+ scroll-margin-block-start: var(--space-xl);
5
13
 
6
14
  /* No top margin for first heading or when following another heading */
7
15
  &:first-child,
8
- &:has(+ :is(h1, h2, h3, h4, h5, h6)) {
16
+ :is(h1, h2, h3, h4, h5, h6) + & {
9
17
  margin-block-start: 0;
10
18
  }
11
19
 
@@ -28,6 +36,7 @@
28
36
  /* Paragraph spacing with smart adjustments */
29
37
  p {
30
38
  margin-block: 0 var(--space-md);
39
+ text-wrap: pretty;
31
40
 
32
41
  /* Paragraphs with images get extra spacing */
33
42
  &:has(img) {
@@ -94,6 +103,8 @@
94
103
  margin-block: var(--space-xl);
95
104
  margin-inline: 0;
96
105
  color: var(--text-color-p-subtle);
106
+ text-wrap: pretty;
107
+ hanging-punctuation: first last;
97
108
 
98
109
  /* Nested blockquotes get reduced spacing */
99
110
  & blockquote {
@@ -122,6 +133,8 @@
122
133
  overflow-x: auto;
123
134
  line-height: var(--font-line-height);
124
135
  margin-block: var(--space-xl);
136
+ scrollbar-width: thin;
137
+ tab-size: 2;
125
138
 
126
139
  /* Code blocks following lists get extra spacing */
127
140
  :is(ul, ol) + & {
@@ -195,18 +208,35 @@
195
208
  }
196
209
 
197
210
  :is(th, td) {
198
- padding: var(--space-xs);
199
- border: var(--border-size-thin) var(--border-style) var(--border-color);
211
+ padding-block: var(--table-cell-padding-block);
212
+ padding-inline: var(--table-cell-padding-inline);
213
+ border: var(--table-border-size) var(--table-border-style) var(--table-border-color);
200
214
  text-align: start;
201
-
202
- /* First/last cells get adjusted padding */
203
- &:first-child { padding-inline-start: var(--space-md); }
204
- &:last-child { padding-inline-end: var(--space-md); }
215
+ vertical-align: top;
216
+ color: var(--table-cell-color);
205
217
  }
206
218
 
207
219
  th {
208
- background-color: var(--background-color-subtle);
209
- font-weight: var(--font-weight-semibold);
220
+ background-color: var(--table-header-background);
221
+ color: var(--table-header-color);
222
+ font-weight: var(--table-header-font-weight);
223
+ position: sticky;
224
+ top: 0;
225
+ z-index: 1;
226
+ }
227
+
228
+ tbody tr {
229
+ background-color: var(--table-row-background);
230
+
231
+ /* Zebra striping for readability */
232
+ &:nth-child(even) {
233
+ background-color: var(--table-row-background-even);
234
+ }
235
+
236
+ /* Hover state for interactive tables */
237
+ &:hover {
238
+ background-color: var(--table-row-background-hover);
239
+ }
210
240
  }
211
241
 
212
242
  /* Smart image spacing */
@@ -230,6 +260,11 @@
230
260
  li & {
231
261
  margin-block: var(--space-xs);
232
262
  }
263
+
264
+ /* Aspect ratio preservation during loading */
265
+ &[width][height] {
266
+ aspect-ratio: attr(width) / attr(height);
267
+ }
233
268
  }
234
269
 
235
270
  /* Figure with enhanced spacing logic */
@@ -293,6 +328,8 @@
293
328
  a {
294
329
  color: var(--link-color);
295
330
  text-decoration: var(--link-text-decoration);
331
+ text-decoration-skip-ink: auto;
332
+ text-underline-offset: 0.15em;
296
333
 
297
334
  /* Links in headings get subtle styling */
298
335
  :is(h1, h2, h3, h4, h5, h6) & {
@@ -308,8 +345,8 @@
308
345
  display: inline-block;
309
346
  }
310
347
 
311
- /* External links (starting with http) */
312
- &[href^="http"]::after {
348
+ /* External links (starting with http) - but not if they only contain an image */
349
+ &[href^="http"]:not(:has(> img:only-child))::after {
313
350
  content: " ↗";
314
351
  font-size: 0.8em;
315
352
  color: var(--text-color-p-subtler);
@@ -9,6 +9,35 @@
9
9
 
10
10
  --lutra-primary-color: oklch(0.5 var(--chroma) var(--hue));
11
11
 
12
+ /*
13
+ * Reusable surface colors (derived from primary)
14
+ * These provide consistent backgrounds across components
15
+ */
16
+
17
+ /* Very subtle, near-white surface (code, table headers) */
18
+ --theme-surface-subtlest: light-dark(
19
+ oklch(from var(--lutra-primary-color) calc(l * 1.92) calc(c * 0.02) h),
20
+ oklch(from var(--lutra-primary-color) calc(l * 0.6) calc(c * 0.02) h)
21
+ );
22
+
23
+ /* Subtle surface for slight differentiation */
24
+ --theme-surface-subtle: light-dark(
25
+ oklch(from var(--lutra-primary-color) calc(l * 1.96) calc(c * 0.01) h),
26
+ oklch(from var(--lutra-primary-color) calc(l * 0.65) calc(c * 0.01) h)
27
+ );
28
+
29
+ /* Interactive surface (hover states) */
30
+ --theme-surface-interactive: light-dark(
31
+ oklch(from var(--lutra-primary-color) calc(l * 1.85) calc(c * 0.05) h),
32
+ oklch(from var(--lutra-primary-color) calc(l * 0.7) calc(c * 0.05) h)
33
+ );
34
+
35
+ /* Selected/active surface with more chroma */
36
+ --theme-surface-selected: light-dark(
37
+ oklch(from var(--lutra-primary-color) calc(l * 0.95) calc(c * 0.15) h),
38
+ oklch(from var(--lutra-primary-color) calc(l * 0.8) calc(c * 0.15) h)
39
+ );
40
+
12
41
  /*
13
42
  * Background colors
14
43
  */
@@ -23,10 +52,8 @@
23
52
  oklch(from var(--lutra-primary-color) calc(l * 0.5) calc(c * 0.025) h)
24
53
  );
25
54
 
26
- --background-selected: light-dark(
27
- oklch(from var(--lutra-primary-color) calc(l * 0.95) calc(c * 0.15) h),
28
- oklch(from var(--lutra-primary-color) calc(l * 0.8) calc(c * 0.15) h)
29
- );
55
+ --background-main-subtle: var(--theme-surface-subtlest);
56
+ --background-selected: var(--theme-surface-selected);
30
57
 
31
58
  /*
32
59
  * Text
@@ -71,11 +98,7 @@
71
98
  * Code
72
99
  */
73
100
 
74
- --code-background: light-dark(
75
- oklch(from var(--lutra-primary-color) calc(l * 1.92) calc(c * 0.02) h),
76
- oklch(from var(--lutra-primary-color) calc(l * 0.5) calc(c * 0.02) h)
77
- );
78
-
101
+ --code-background: var(--theme-surface-subtlest);
79
102
  --code-border-color: var(--code-background);
80
103
 
81
104
  --code-color: light-dark(
@@ -149,10 +172,7 @@
149
172
 
150
173
  --field-label-color: var(--text-color-p);
151
174
 
152
- --form-background-actions: light-dark(
153
- oklch(from var(--lutra-primary-color) calc(l * 1.75) calc(c * 0.05) h / 0.35),
154
- oklch(from var(--lutra-primary-color) calc(l * 0.75) calc(c * 0.05) h / 0.35)
155
- );
175
+ --form-background-actions: color-mix(in srgb, var(--theme-surface-interactive) 35%, transparent);
156
176
 
157
177
  /**
158
178
  * Borders
@@ -196,14 +216,23 @@
196
216
  */
197
217
 
198
218
  --menu-background-color: var(--background-body);
199
- --menu-background-color-hover: light-dark(
200
- oklch(from var(--lutra-primary-color) l calc(c * 0.5) h / 0.1),
201
- oklch(from var(--lutra-primary-color) calc(l * 2) calc(c * 0.25) h / 0.15)
202
- );
219
+ --menu-background-color-hover: color-mix(in srgb, var(--theme-surface-interactive) 35%, transparent);
203
220
  --menu-border-color: var(--border-color-subtle);
204
221
  --menu-border-size: var(--border-size-thin);
205
222
  --menu-border-style: var(--border-style);
206
223
  --menu-border-radius: var(--border-radius-base);
224
+
225
+ /**
226
+ * Tables
227
+ */
228
+
229
+ --table-border-color: var(--border-color);
230
+ --table-header-background: var(--theme-surface-subtlest);
231
+ --table-header-color: var(--text-color-heading);
232
+ --table-row-background: transparent;
233
+ --table-row-background-even: color-mix(in srgb, var(--theme-surface-subtle) 50%, transparent);
234
+ --table-row-background-hover: color-mix(in srgb, var(--theme-surface-interactive) 60%, transparent);
235
+ --table-cell-color: var(--text-color-p);
207
236
 
208
237
  }
209
238
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lutra",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",