@loidolt/theme-styles 0.5.0 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loidolt/theme-styles",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Base styles, fonts, accessibility helpers, and utilities for Loidolt applications",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "build": "node -e \"console.log('theme-styles: source CSS is publish-ready')\""
29
29
  },
30
30
  "dependencies": {
31
- "@loidolt/theme-tokens": "^0.5.0"
31
+ "@loidolt/theme-tokens": "^0.7.0"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public",
@@ -20,7 +20,15 @@
20
20
  .ldt-dialog__body,
21
21
  .ldt-drawer__body,
22
22
  .ldt-tabs__list,
23
- .ldt-toggle-group
23
+ .ldt-toggle-group,
24
+ .ldt-listbox,
25
+ .ldt-media-grid,
26
+ .ldt-map,
27
+ .ldt-map-features__list,
28
+ .ldt-layer-manager,
29
+ .ldt-code__pre,
30
+ .ldt-toc-panel__wide,
31
+ .ldt-mermaid
24
32
  )
25
33
  :where(:focus-visible) {
26
34
  outline-offset: -2px;
@@ -41,6 +49,20 @@
41
49
  border: 0 !important;
42
50
  }
43
51
 
52
+ /* Hidden until it, or something inside it, takes focus — for a "skip" or "back to top" link
53
+ that should not occupy the layout for pointer users. */
54
+ .ldt-sr-only-focusable:not(:focus, :focus-within) {
55
+ position: absolute !important;
56
+ width: 1px !important;
57
+ height: 1px !important;
58
+ padding: 0 !important;
59
+ margin: -1px !important;
60
+ overflow: hidden !important;
61
+ clip: rect(0, 0, 0, 0) !important;
62
+ white-space: nowrap !important;
63
+ border: 0 !important;
64
+ }
65
+
44
66
  .ldt-skip-link {
45
67
  position: fixed;
46
68
  z-index: var(--loidolt-z-skip-link);
@@ -58,6 +80,20 @@
58
80
  min-width: 44px;
59
81
  min-height: 44px;
60
82
  }
83
+ /* Enlarges the hit area without moving anything: a small glyph button in dense UI keeps its
84
+ visual size, and an invisible 44px square centred on it takes the press. */
85
+ .ldt-touch-target-expand {
86
+ position: relative;
87
+ }
88
+ .ldt-touch-target-expand::after {
89
+ content: '';
90
+ position: absolute;
91
+ top: 50%;
92
+ left: 50%;
93
+ width: max(100%, 44px);
94
+ height: max(100%, 44px);
95
+ transform: translate(-50%, -50%);
96
+ }
61
97
 
62
98
  /* Preserve the compact visual density for mouse/keyboard layouts, but give touch-first devices
63
99
  the 44px target size recommended for comfortable coarse-pointer operation. */
@@ -73,17 +109,63 @@
73
109
  .ldt-choice,
74
110
  .ldt-switch,
75
111
  .ldt-number-field__button,
76
- .ldt-menu__item
112
+ .ldt-menu__item,
113
+ .ldt-listbox__item,
114
+ .ldt-combobox,
115
+ .ldt-password-input,
116
+ .ldt-chip,
117
+ .ldt-data-table__edit,
118
+ .ldt-media-controls__button,
119
+ .ldt-media-controls__speed,
120
+ .ldt-media-controls__range,
121
+ .ldt-lightbox__control,
122
+ .ldt-media-carousel__control,
123
+ .ldt-map-features__item,
124
+ .ldt-map .maplibregl-ctrl-group button,
125
+ .ldt-layer-manager__toggle,
126
+ .ldt-code__copy,
127
+ .ldt-toc__link
77
128
  ) {
78
129
  min-height: 44px;
79
130
  }
80
- :where(.ldt-icon-button, .ldt-number-field__button) {
131
+ :where(
132
+ .ldt-icon-button,
133
+ .ldt-number-field__button,
134
+ .ldt-combobox__trigger,
135
+ .ldt-password-input__toggle,
136
+ .ldt-chip__remove,
137
+ .ldt-media-controls__button,
138
+ .ldt-lightbox__control,
139
+ .ldt-media-carousel__control,
140
+ .ldt-map .maplibregl-ctrl-group button
141
+ ) {
81
142
  min-width: 44px;
82
143
  }
144
+ /* A map marker keeps its drawn size — it points at a spot — and takes a 44px touch. */
145
+ .ldt-map-marker::after {
146
+ content: '';
147
+ position: absolute;
148
+ inset: 50% auto auto 50%;
149
+ width: 44px;
150
+ height: 44px;
151
+ transform: translate(-50%, -50%);
152
+ }
153
+ /* The thumb keeps its drawn size; an invisible 44px square around it takes the touch. */
154
+ .ldt-slider__thumb {
155
+ position: relative;
156
+ }
157
+ .ldt-slider__thumb::after {
158
+ content: '';
159
+ position: absolute;
160
+ inset: 50% auto auto 50%;
161
+ width: 44px;
162
+ height: 44px;
163
+ transform: translate(-50%, -50%);
164
+ }
83
165
  :where(.ldt-icon-button) {
84
166
  width: 44px;
85
167
  }
86
- .ldt-number-field {
168
+ .ldt-number-field:not(.ldt-number-field--bare) {
87
169
  grid-template-columns: 44px minmax(0, 1fr) 44px;
88
170
  }
89
171
  }
@@ -104,6 +104,19 @@
104
104
  border-radius: 50%;
105
105
  animation: ldt-spin 0.7s linear infinite;
106
106
  }
107
+ .ldt-spinner--sm {
108
+ width: 0.875rem;
109
+ height: 0.875rem;
110
+ }
111
+ .ldt-spinner--md {
112
+ width: 1.25rem;
113
+ height: 1.25rem;
114
+ }
115
+ .ldt-spinner--lg {
116
+ width: 2rem;
117
+ height: 2rem;
118
+ border-width: 3px;
119
+ }
107
120
  @keyframes ldt-spin {
108
121
  to {
109
122
  transform: rotate(360deg);
@@ -0,0 +1,39 @@
1
+ /* @loidolt/theme-charts. The chart itself is painted by ECharts from the same tokens (read at
2
+ runtime through `createTokenColors`); this file styles everything around the canvas. */
3
+ .ldt-chart {
4
+ display: grid;
5
+ gap: 0.5rem;
6
+ min-width: 0;
7
+ margin: 0;
8
+ }
9
+ /* The label voice, as a stat's label: a chart caption names data, it is not a heading. */
10
+ .ldt-chart__title {
11
+ color: var(--loidolt-text-muted);
12
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-utility);
13
+ letter-spacing: var(--loidolt-font-tracking-utility);
14
+ text-transform: uppercase;
15
+ }
16
+ .ldt-chart__canvas,
17
+ .ldt-chart__state {
18
+ position: relative;
19
+ width: 100%;
20
+ min-width: 0;
21
+ height: var(--ldt-chart-height, 20rem);
22
+ }
23
+ .ldt-chart__canvas[hidden] {
24
+ display: none;
25
+ }
26
+ .ldt-chart__state.ldt-empty-state {
27
+ height: auto;
28
+ min-height: var(--ldt-chart-height, 20rem);
29
+ align-content: center;
30
+ }
31
+ .ldt-chart__alert :where(p) {
32
+ margin: 0 0 0.5rem;
33
+ }
34
+ .ldt-chart__table-toggle {
35
+ justify-self: start;
36
+ }
37
+ .ldt-chart__table[hidden] {
38
+ display: none;
39
+ }
@@ -196,3 +196,114 @@
196
196
  .ldt-record-stepper__count {
197
197
  white-space: nowrap;
198
198
  }
199
+ /* The filters narrowing a list, each removable on its own. Sits under the list's toolbar. */
200
+ .ldt-filter-chips {
201
+ display: flex;
202
+ flex-wrap: wrap;
203
+ align-items: center;
204
+ gap: var(--loidolt-space-2);
205
+ }
206
+ .ldt-filter-chips__list {
207
+ display: flex;
208
+ flex-wrap: wrap;
209
+ gap: var(--loidolt-space-2);
210
+ margin: 0;
211
+ padding: 0;
212
+ list-style: none;
213
+ }
214
+ /* DataTable: selection, editable cells, responsive columns, virtual spacers. */
215
+ .ldt-table :where(th, td).ldt-data-table__select {
216
+ width: 2.75rem;
217
+ padding-inline-end: 0;
218
+ }
219
+ .ldt-data-table__radio {
220
+ width: 1rem;
221
+ height: 1rem;
222
+ accent-color: var(--loidolt-accent);
223
+ }
224
+ .ldt-table tbody tr[data-selected] {
225
+ background: var(--loidolt-surface-alt);
226
+ }
227
+ .ldt-table tbody tr[data-selected] td:first-child {
228
+ box-shadow: inset 3px 0 0 var(--loidolt-accent);
229
+ }
230
+ .ldt-data-table__spacer td {
231
+ padding: 0;
232
+ border: 0;
233
+ }
234
+ /* The resting state of an editable cell: reads as the value, reveals itself on hover or focus. */
235
+ .ldt-data-table__edit {
236
+ min-height: 1.5rem;
237
+ width: 100%;
238
+ border: 0;
239
+ border-bottom: var(--loidolt-border-width) dashed transparent;
240
+ padding: 0;
241
+ color: inherit;
242
+ background: transparent;
243
+ font: inherit;
244
+ text-align: inherit;
245
+ cursor: text;
246
+ }
247
+ .ldt-data-table__edit:hover {
248
+ border-bottom-color: var(--loidolt-border-control);
249
+ }
250
+ .ldt-data-table__edit-input {
251
+ width: 100%;
252
+ min-height: 1.5rem;
253
+ border: 0;
254
+ border-bottom: var(--loidolt-border-width) solid var(--loidolt-accent);
255
+ padding: 0;
256
+ color: inherit;
257
+ background: var(--loidolt-surface-input);
258
+ font: inherit;
259
+ text-align: inherit;
260
+ }
261
+ @media (max-width: 1024px) {
262
+ .ldt-table :where(th, td)[data-hide-below='expanded'] {
263
+ display: none;
264
+ }
265
+ }
266
+ @media (max-width: 760px) {
267
+ .ldt-table :where(th, td)[data-hide-below='compact'] {
268
+ display: none;
269
+ }
270
+ }
271
+
272
+ /* A faceted-filter trigger carries the number of values chosen. */
273
+ .ldt-facet__count {
274
+ display: inline-grid;
275
+ min-width: 1.25rem;
276
+ place-items: center;
277
+ margin-inline-start: 0.4rem;
278
+ padding-inline: 0.3rem;
279
+ color: var(--loidolt-on-accent);
280
+ background: var(--loidolt-accent);
281
+ font-size: var(--loidolt-font-size-xs);
282
+ }
283
+
284
+ /* The footer under a data table: status line, rows-per-page, page trail. */
285
+ .ldt-data-table-pagination {
286
+ display: flex;
287
+ flex-wrap: wrap;
288
+ align-items: center;
289
+ justify-content: space-between;
290
+ gap: var(--loidolt-space-3);
291
+ }
292
+ .ldt-data-table-pagination__summary {
293
+ margin: 0;
294
+ color: var(--loidolt-text-muted);
295
+ font: var(--loidolt-font-size-sm) var(--loidolt-font-utility);
296
+ font-variant-numeric: tabular-nums;
297
+ }
298
+ .ldt-data-table-pagination__size {
299
+ display: flex;
300
+ align-items: center;
301
+ gap: var(--loidolt-space-2);
302
+ color: var(--loidolt-text-muted);
303
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-utility);
304
+ letter-spacing: var(--loidolt-font-tracking-utility);
305
+ text-transform: uppercase;
306
+ }
307
+ .ldt-data-table-pagination__size .ldt-select {
308
+ width: auto;
309
+ }
@@ -0,0 +1,298 @@
1
+ /* @loidolt/theme-docs. Rendered markdown takes `.ldt-prose` for its typography; this file adds
2
+ what markdown documentation needs beyond it — code frames and highlighting, admonitions,
3
+ footnotes, diagrams, the table of contents, and the page around them. */
4
+
5
+ /* --- Headings that link to themselves ------------------------------------------------------- */
6
+ .ldt-heading-anchor {
7
+ color: inherit;
8
+ text-decoration: none;
9
+ }
10
+ .ldt-heading-anchor:hover {
11
+ text-decoration: underline;
12
+ text-decoration-color: var(--loidolt-accent);
13
+ text-underline-offset: 0.2em;
14
+ }
15
+
16
+ /* --- Code ------------------------------------------------------------------------------------ */
17
+ /* Shiki's CSS-variables theme reads `--ldt-syntax-*`; mapping them to the syntax tokens makes
18
+ highlighted code follow the light and dark themes with no second render. */
19
+ .ldt-code {
20
+ --ldt-syntax-foreground: var(--loidolt-text-inverse);
21
+ --ldt-syntax-background: var(--loidolt-surface-inverse);
22
+ --ldt-syntax-token-keyword: var(--loidolt-syntax-keyword);
23
+ --ldt-syntax-token-string: var(--loidolt-syntax-string);
24
+ --ldt-syntax-token-string-expression: var(--loidolt-syntax-string);
25
+ --ldt-syntax-token-comment: var(--loidolt-syntax-comment);
26
+ --ldt-syntax-token-constant: var(--loidolt-syntax-constant);
27
+ --ldt-syntax-token-function: var(--loidolt-syntax-function);
28
+ --ldt-syntax-token-parameter: var(--loidolt-syntax-parameter);
29
+ --ldt-syntax-token-punctuation: var(--loidolt-syntax-punctuation);
30
+ --ldt-syntax-token-link: var(--loidolt-syntax-function);
31
+ margin: 0 0 1.1em;
32
+ min-width: 0;
33
+ }
34
+ .ldt-code__header {
35
+ display: flex;
36
+ gap: 0.75rem;
37
+ align-items: center;
38
+ justify-content: space-between;
39
+ min-height: 2rem;
40
+ padding: 0 0 0 0.75rem;
41
+ border: var(--loidolt-border-width) solid var(--loidolt-border);
42
+ border-bottom: 0;
43
+ color: var(--loidolt-text-muted);
44
+ background: var(--loidolt-surface-alt);
45
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-mono);
46
+ }
47
+ .ldt-code__filename {
48
+ overflow: hidden;
49
+ text-overflow: ellipsis;
50
+ white-space: nowrap;
51
+ }
52
+ .ldt-code__copy {
53
+ flex: none;
54
+ margin-inline-start: auto;
55
+ min-height: 2rem;
56
+ padding: 0 0.75rem;
57
+ border: 0;
58
+ border-inline-start: var(--loidolt-border-width) solid var(--loidolt-border);
59
+ color: var(--loidolt-text);
60
+ background: none;
61
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-utility);
62
+ letter-spacing: var(--loidolt-font-tracking-utility);
63
+ text-transform: uppercase;
64
+ cursor: pointer;
65
+ }
66
+ .ldt-code__copy:hover {
67
+ background: var(--loidolt-surface);
68
+ }
69
+ .ldt-code__pre {
70
+ margin: 0;
71
+ padding: 0.9em 1.1em;
72
+ overflow-x: auto;
73
+ border: var(--loidolt-border-width) solid var(--loidolt-border);
74
+ color: var(--ldt-syntax-foreground);
75
+ background: var(--ldt-syntax-background);
76
+ font: 0.85em / var(--loidolt-font-line-height-normal) var(--loidolt-font-mono);
77
+ tab-size: 2;
78
+ }
79
+ .ldt-code__pre code {
80
+ padding: 0;
81
+ border: 0;
82
+ color: inherit;
83
+ background: transparent;
84
+ font: inherit;
85
+ }
86
+
87
+ /* --- Admonitions ----------------------------------------------------------------------------- */
88
+ .ldt-admonition {
89
+ margin: 0 0 1.1em;
90
+ }
91
+ .ldt-admonition .ldt-alert__title {
92
+ margin: 0 0 0.25rem;
93
+ }
94
+ .ldt-admonition .ldt-alert__description > :last-child {
95
+ margin-bottom: 0;
96
+ }
97
+
98
+ /* --- Footnotes ------------------------------------------------------------------------------- */
99
+ .ldt-footnote-ref a {
100
+ padding-inline: 0.1em;
101
+ text-decoration: none;
102
+ }
103
+ .ldt-footnotes {
104
+ margin-top: 2em;
105
+ padding-top: 1em;
106
+ border-top: var(--loidolt-border-width) solid var(--loidolt-border);
107
+ color: var(--loidolt-text-muted);
108
+ font-size: 0.9em;
109
+ }
110
+ .ldt-unsafe-link {
111
+ text-decoration: underline dotted;
112
+ }
113
+
114
+ /* --- Diagrams -------------------------------------------------------------------------------- */
115
+ .ldt-mermaid {
116
+ display: grid;
117
+ gap: 0.5rem;
118
+ margin: 0 0 1.1em;
119
+ padding: 1rem;
120
+ overflow-x: auto;
121
+ border: var(--loidolt-border-width) solid var(--loidolt-border);
122
+ background: var(--loidolt-background);
123
+ }
124
+ .ldt-mermaid__diagram[hidden] {
125
+ display: none;
126
+ }
127
+ .ldt-mermaid__diagram svg {
128
+ display: block;
129
+ max-width: 100%;
130
+ height: auto;
131
+ margin-inline: auto;
132
+ }
133
+ .ldt-mermaid__caption {
134
+ color: var(--loidolt-text-muted);
135
+ font-size: var(--loidolt-font-size-sm);
136
+ }
137
+ .ldt-mermaid__source summary {
138
+ color: var(--loidolt-text-muted);
139
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-utility);
140
+ letter-spacing: var(--loidolt-font-tracking-utility);
141
+ text-transform: uppercase;
142
+ cursor: pointer;
143
+ }
144
+ .ldt-mermaid__source pre,
145
+ .ldt-mermaid__fallback,
146
+ pre.ldt-mermaid {
147
+ margin: 0.5rem 0 0;
148
+ white-space: pre-wrap;
149
+ font: var(--loidolt-font-size-sm) var(--loidolt-font-mono);
150
+ }
151
+
152
+ /* --- Table of contents ----------------------------------------------------------------------- */
153
+ .ldt-toc {
154
+ font: var(--loidolt-font-size-sm) var(--loidolt-font-utility);
155
+ }
156
+ .ldt-toc__title {
157
+ margin: 0 0 0.5rem;
158
+ color: var(--loidolt-text-muted);
159
+ font-size: var(--loidolt-font-size-xs);
160
+ letter-spacing: var(--loidolt-font-tracking-utility);
161
+ text-transform: uppercase;
162
+ }
163
+ .ldt-toc__list {
164
+ margin: 0;
165
+ padding: 0;
166
+ list-style: none;
167
+ }
168
+ .ldt-toc__item {
169
+ padding-inline-start: calc(var(--ldt-toc-level, 0) * 0.85rem);
170
+ }
171
+ .ldt-toc__link {
172
+ display: flex;
173
+ align-items: center;
174
+ min-block-size: 1.5rem;
175
+ padding: 0.2rem 0 0.2rem 0.65rem;
176
+ border-inline-start: 2px solid var(--loidolt-border-soft);
177
+ color: var(--loidolt-text-muted);
178
+ text-decoration: none;
179
+ }
180
+ .ldt-toc__link:hover {
181
+ color: var(--loidolt-text);
182
+ }
183
+ .ldt-toc__link[aria-current='location'] {
184
+ border-inline-start-color: var(--loidolt-accent);
185
+ color: var(--loidolt-text);
186
+ }
187
+ .ldt-toc-panel__wide {
188
+ position: sticky;
189
+ top: var(--ldt-docs-top, calc(var(--loidolt-size-topbar) + 1rem));
190
+ max-height: calc(100vh - var(--ldt-docs-top, calc(var(--loidolt-size-topbar) + 1rem)) - 1rem);
191
+ overflow-y: auto;
192
+ }
193
+ .ldt-toc-panel__compact {
194
+ display: none;
195
+ }
196
+ /* The contents go behind a button where there is no room beside the page for them. */
197
+ @media (max-width: 1023.98px) {
198
+ .ldt-toc-panel__wide {
199
+ display: none;
200
+ }
201
+ .ldt-toc-panel__compact {
202
+ display: block;
203
+ }
204
+ }
205
+
206
+ /* --- The page -------------------------------------------------------------------------------- */
207
+ .ldt-markdown-page {
208
+ display: grid;
209
+ gap: 1.5rem;
210
+ min-width: 0;
211
+ }
212
+ .ldt-markdown-page__main {
213
+ min-width: 0;
214
+ }
215
+ @media (min-width: 1024px) {
216
+ .ldt-markdown-page--toc {
217
+ grid-template-columns: minmax(0, 1fr) 14rem;
218
+ gap: 2.5rem;
219
+ align-items: start;
220
+ }
221
+ .ldt-markdown-page--toc .ldt-markdown-page__toc {
222
+ grid-column: 2;
223
+ grid-row: 1;
224
+ }
225
+ .ldt-markdown-page--toc .ldt-markdown-page__main {
226
+ grid-column: 1;
227
+ grid-row: 1;
228
+ }
229
+ }
230
+ .ldt-markdown-page__pager {
231
+ display: flex;
232
+ flex-wrap: wrap;
233
+ gap: 0.75rem;
234
+ justify-content: space-between;
235
+ margin-top: 2.5rem;
236
+ padding-top: 1.25rem;
237
+ border-top: var(--loidolt-border-width) solid var(--loidolt-border);
238
+ }
239
+ .ldt-markdown-page__pager a {
240
+ display: grid;
241
+ gap: 0.15rem;
242
+ min-width: min(14rem, 100%);
243
+ padding: 0.65rem 0.9rem;
244
+ border: var(--loidolt-border-width) solid var(--loidolt-border);
245
+ color: var(--loidolt-text);
246
+ text-decoration: none;
247
+ }
248
+ .ldt-markdown-page__pager a:hover {
249
+ border-color: var(--loidolt-border-strong);
250
+ }
251
+ .ldt-markdown-page__next {
252
+ margin-inline-start: auto;
253
+ text-align: end;
254
+ }
255
+ .ldt-markdown-page__direction {
256
+ color: var(--loidolt-text-muted);
257
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-utility);
258
+ letter-spacing: var(--loidolt-font-tracking-utility);
259
+ text-transform: uppercase;
260
+ }
261
+
262
+ /* --- Docs index ------------------------------------------------------------------------------ */
263
+ .ldt-docs-hub {
264
+ display: grid;
265
+ gap: 2.25rem;
266
+ }
267
+ .ldt-docs-hub__title {
268
+ margin: 0;
269
+ }
270
+ .ldt-docs-hub__description {
271
+ margin: 0.35rem 0 0;
272
+ color: var(--loidolt-text-muted);
273
+ }
274
+ .ldt-docs-hub__grid {
275
+ display: grid;
276
+ grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
277
+ gap: 1rem;
278
+ margin: 1rem 0 0;
279
+ padding: 0;
280
+ list-style: none;
281
+ }
282
+ .ldt-docs-hub__grid > li {
283
+ display: grid;
284
+ }
285
+ /* A docs card is often only a heading and a line; drop the empty body and its rule. */
286
+ .ldt-docs-card .ldt-card__content:empty {
287
+ display: none;
288
+ }
289
+ .ldt-docs-card .ldt-card__header:has(+ .ldt-card__content:empty) {
290
+ border-bottom: 0;
291
+ }
292
+ .ldt-docs-card__eyebrow {
293
+ margin: 0 0 0.35rem;
294
+ color: var(--loidolt-text-accent);
295
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-utility);
296
+ letter-spacing: var(--loidolt-font-tracking-wide);
297
+ text-transform: uppercase;
298
+ }