@loidolt/theme-styles 0.4.0 → 0.5.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.
|
|
3
|
+
"version": "0.5.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.
|
|
31
|
+
"@loidolt/theme-tokens": "^0.5.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public",
|
package/src/accessibility.css
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* Deep slice: assumes the token custom properties are already loaded.
|
|
2
2
|
Import '@loidolt/theme-styles/tokens' (or the whole '@loidolt/theme-styles') first. */
|
|
3
3
|
.ldt-button {
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
min-width: 0;
|
|
4
6
|
min-height: var(--loidolt-size-control);
|
|
5
7
|
display: inline-flex;
|
|
6
8
|
align-items: center;
|
|
@@ -13,10 +15,12 @@
|
|
|
13
15
|
background: transparent;
|
|
14
16
|
font: var(--loidolt-font-size-sm) var(--loidolt-font-utility);
|
|
15
17
|
letter-spacing: 0.08em;
|
|
16
|
-
line-height: 1;
|
|
18
|
+
line-height: 1.2;
|
|
19
|
+
overflow-wrap: anywhere;
|
|
20
|
+
text-align: center;
|
|
17
21
|
text-decoration: none;
|
|
18
22
|
text-transform: uppercase;
|
|
19
|
-
white-space:
|
|
23
|
+
white-space: normal;
|
|
20
24
|
}
|
|
21
25
|
.ldt-button:hover:not(:disabled, [aria-disabled='true']) {
|
|
22
26
|
color: var(--loidolt-text-inverse);
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
color: var(--loidolt-text);
|
|
12
12
|
background: var(--loidolt-background);
|
|
13
13
|
}
|
|
14
|
-
.ldt-app-shell > :where(header, main, footer) {
|
|
14
|
+
.ldt-app-shell > :where(header, main, footer, .ldt-app-shell__main) {
|
|
15
15
|
min-width: 0;
|
|
16
16
|
}
|
|
17
|
-
.ldt-app-shell > main,
|
|
17
|
+
.ldt-app-shell > :where(main, .ldt-app-shell__main),
|
|
18
18
|
.ldt-workspace-container {
|
|
19
19
|
/* Workspace normally sits directly in AppShell's main row. Naming that row as an inline-size
|
|
20
20
|
container lets the same compact layout work when the shell itself is embedded or split. The
|
|
@@ -289,7 +289,10 @@
|
|
|
289
289
|
gap: 0.15rem;
|
|
290
290
|
}
|
|
291
291
|
.ldt-contextbar__detail {
|
|
292
|
-
|
|
292
|
+
overflow: visible;
|
|
293
|
+
text-overflow: clip;
|
|
294
|
+
white-space: normal;
|
|
295
|
+
overflow-wrap: anywhere;
|
|
293
296
|
}
|
|
294
297
|
.ldt-workspace,
|
|
295
298
|
.ldt-workspace--sidebar,
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Long-form content: rendered Markdown, documentation, help text — any HTML the application does
|
|
3
|
+
* not author element by element. Wrap it in `.ldt-prose`; mark islands of ordinary UI inside it
|
|
4
|
+
* with `.ldt-not-prose`.
|
|
5
|
+
*
|
|
6
|
+
* Every descendant selector is wrapped in `:where()` and filtered with `:not(:where(...))`, so the
|
|
7
|
+
* whole rule weighs (0,0,0). A component class placed inside prose (`.ldt-button`, `.ldt-table`,
|
|
8
|
+
* `.ldt-card`) therefore always beats these element styles by specificity alone, and the opt-out
|
|
9
|
+
* class is only needed for bare elements that should look like UI rather than content.
|
|
10
|
+
*
|
|
11
|
+
* `--ldt-prose-size` scales the body text; everything else is relative to it.
|
|
12
|
+
*/
|
|
13
|
+
.ldt-prose {
|
|
14
|
+
max-width: var(--ldt-prose-width, none);
|
|
15
|
+
color: var(--loidolt-text);
|
|
16
|
+
font-size: var(--ldt-prose-size, var(--loidolt-font-size-md));
|
|
17
|
+
line-height: var(--loidolt-font-line-height-relaxed);
|
|
18
|
+
overflow-wrap: break-word;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* --- Flow ---------------------------------------------------------------------------------- */
|
|
22
|
+
|
|
23
|
+
:where(.ldt-prose :is(p, ul, ol, dl, blockquote, pre, table, figure, hr, details)):not(
|
|
24
|
+
:where(.ldt-not-prose, .ldt-not-prose *)
|
|
25
|
+
) {
|
|
26
|
+
margin-block: 0 1.1em;
|
|
27
|
+
}
|
|
28
|
+
:where(.ldt-prose > :first-child) {
|
|
29
|
+
margin-block-start: 0;
|
|
30
|
+
}
|
|
31
|
+
:where(.ldt-prose > :last-child) {
|
|
32
|
+
margin-block-end: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* --- Headings ------------------------------------------------------------------------------ */
|
|
36
|
+
|
|
37
|
+
:where(.ldt-prose :is(h1, h2, h3, h4, h5, h6)):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
38
|
+
margin-block: 1.8em 0.6em;
|
|
39
|
+
color: var(--loidolt-text);
|
|
40
|
+
font-family: var(--loidolt-font-display);
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
line-height: var(--loidolt-font-line-height-tight);
|
|
43
|
+
/* Clears a sticky top bar when a heading is the target of an in-page link. */
|
|
44
|
+
scroll-margin-top: calc(var(--loidolt-size-topbar) + var(--loidolt-space-4));
|
|
45
|
+
}
|
|
46
|
+
:where(.ldt-prose h1):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
47
|
+
margin-block-start: 0;
|
|
48
|
+
font-size: 2em;
|
|
49
|
+
}
|
|
50
|
+
:where(.ldt-prose h2):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
51
|
+
padding-block-end: 0.3em;
|
|
52
|
+
border-bottom: var(--loidolt-border-width) solid var(--loidolt-border-soft);
|
|
53
|
+
font-size: 1.5em;
|
|
54
|
+
}
|
|
55
|
+
:where(.ldt-prose h3):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
56
|
+
font-size: 1.25em;
|
|
57
|
+
}
|
|
58
|
+
:where(.ldt-prose h4):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
59
|
+
font-size: 1.05em;
|
|
60
|
+
}
|
|
61
|
+
/* The two smallest levels switch to the utility face so they stay distinct from body text. */
|
|
62
|
+
:where(.ldt-prose :is(h5, h6)):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
63
|
+
color: var(--loidolt-text-muted);
|
|
64
|
+
font-family: var(--loidolt-font-utility);
|
|
65
|
+
font-size: 0.8em;
|
|
66
|
+
letter-spacing: var(--loidolt-font-tracking-utility);
|
|
67
|
+
text-transform: uppercase;
|
|
68
|
+
}
|
|
69
|
+
/* A heading directly after another heading sits closer to it. */
|
|
70
|
+
:where(.ldt-prose :is(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6)):not(
|
|
71
|
+
:where(.ldt-not-prose, .ldt-not-prose *)
|
|
72
|
+
) {
|
|
73
|
+
margin-block-start: 0.6em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* --- Inline -------------------------------------------------------------------------------- */
|
|
77
|
+
|
|
78
|
+
:where(.ldt-prose a):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
79
|
+
color: var(--loidolt-text-accent);
|
|
80
|
+
text-decoration-thickness: 1px;
|
|
81
|
+
text-underline-offset: 0.18em;
|
|
82
|
+
}
|
|
83
|
+
:where(.ldt-prose a:hover):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
84
|
+
text-decoration-thickness: 2px;
|
|
85
|
+
}
|
|
86
|
+
/* Only one weight per family ships, so bold is synthesized; colour keeps it legible. */
|
|
87
|
+
:where(.ldt-prose :is(strong, b)):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
88
|
+
color: var(--loidolt-text);
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
}
|
|
91
|
+
:where(.ldt-prose :not(pre) > code):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
92
|
+
padding: 0.12em 0.35em;
|
|
93
|
+
border: var(--loidolt-border-width) solid var(--loidolt-border-soft);
|
|
94
|
+
color: var(--loidolt-text);
|
|
95
|
+
background: var(--loidolt-surface-sunken);
|
|
96
|
+
font-size: 0.875em;
|
|
97
|
+
}
|
|
98
|
+
:where(.ldt-prose kbd):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
99
|
+
padding: 0.05em 0.4em;
|
|
100
|
+
border: var(--loidolt-border-width) solid var(--loidolt-border-strong);
|
|
101
|
+
border-bottom-width: 2px;
|
|
102
|
+
background: var(--loidolt-surface);
|
|
103
|
+
font-size: 0.85em;
|
|
104
|
+
}
|
|
105
|
+
:where(.ldt-prose mark):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
106
|
+
color: var(--loidolt-text);
|
|
107
|
+
background: color-mix(in srgb, var(--loidolt-accent) 22%, transparent);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* --- Lists --------------------------------------------------------------------------------- */
|
|
111
|
+
|
|
112
|
+
:where(.ldt-prose :is(ul, ol)):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
113
|
+
padding-inline-start: 1.5em;
|
|
114
|
+
}
|
|
115
|
+
:where(.ldt-prose li):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
116
|
+
margin-block: 0.3em;
|
|
117
|
+
}
|
|
118
|
+
:where(.ldt-prose li)::marker {
|
|
119
|
+
color: var(--loidolt-text-muted);
|
|
120
|
+
}
|
|
121
|
+
:where(.ldt-prose li > :is(ul, ol)):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
122
|
+
margin-block: 0.3em 0;
|
|
123
|
+
}
|
|
124
|
+
/* GFM task lists: the checkbox is the marker. */
|
|
125
|
+
:where(.ldt-prose li:has(> input[type='checkbox'])):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
126
|
+
list-style: none;
|
|
127
|
+
}
|
|
128
|
+
:where(.ldt-prose li > input[type='checkbox']):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
129
|
+
margin: 0 0.5em 0 -1.4em;
|
|
130
|
+
vertical-align: -0.1em;
|
|
131
|
+
accent-color: var(--loidolt-accent);
|
|
132
|
+
}
|
|
133
|
+
:where(.ldt-prose dt):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
134
|
+
font-weight: 700;
|
|
135
|
+
}
|
|
136
|
+
:where(.ldt-prose dd):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
137
|
+
margin: 0 0 0.6em 1.5em;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* --- Blocks -------------------------------------------------------------------------------- */
|
|
141
|
+
|
|
142
|
+
:where(.ldt-prose blockquote):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
143
|
+
margin-inline: 0;
|
|
144
|
+
padding: 0.7em 1em;
|
|
145
|
+
border-inline-start: 3px solid var(--loidolt-accent);
|
|
146
|
+
color: var(--loidolt-text);
|
|
147
|
+
background: var(--loidolt-surface-alt);
|
|
148
|
+
}
|
|
149
|
+
:where(.ldt-prose blockquote > :last-child):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
150
|
+
margin-block-end: 0;
|
|
151
|
+
}
|
|
152
|
+
:where(.ldt-prose hr):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
153
|
+
margin-block: 2em;
|
|
154
|
+
border: 0;
|
|
155
|
+
border-top: var(--loidolt-border-width) solid var(--loidolt-border);
|
|
156
|
+
}
|
|
157
|
+
:where(.ldt-prose :is(img, video)):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
158
|
+
height: auto;
|
|
159
|
+
}
|
|
160
|
+
:where(.ldt-prose figcaption):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
161
|
+
margin-block-start: 0.5em;
|
|
162
|
+
color: var(--loidolt-text-muted);
|
|
163
|
+
font-size: 0.875em;
|
|
164
|
+
}
|
|
165
|
+
/*
|
|
166
|
+
* Code blocks. The background is set without `!important`: syntax highlighters that write an
|
|
167
|
+
* inline background (Shiki, Prism themes) keep their own, and plain `<pre>` gets the inverse
|
|
168
|
+
* surface so it reads as code in both colour schemes.
|
|
169
|
+
*/
|
|
170
|
+
:where(.ldt-prose pre):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
171
|
+
padding: 0.9em 1.1em;
|
|
172
|
+
overflow-x: auto;
|
|
173
|
+
border: var(--loidolt-border-width) solid var(--loidolt-border);
|
|
174
|
+
color: var(--loidolt-text-inverse);
|
|
175
|
+
background: var(--loidolt-surface-inverse);
|
|
176
|
+
font-size: 0.85em;
|
|
177
|
+
line-height: var(--loidolt-font-line-height-normal);
|
|
178
|
+
tab-size: 2;
|
|
179
|
+
}
|
|
180
|
+
:where(.ldt-prose pre code):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
181
|
+
padding: 0;
|
|
182
|
+
border: 0;
|
|
183
|
+
color: inherit;
|
|
184
|
+
background: transparent;
|
|
185
|
+
font-size: inherit;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* --- Tables -------------------------------------------------------------------------------- */
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
* `display: block` + `overflow-x: auto` lets a wide Markdown table scroll on its own instead of
|
|
192
|
+
* widening the page; there is no wrapper element to hang the overflow on.
|
|
193
|
+
*/
|
|
194
|
+
:where(.ldt-prose table):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
195
|
+
display: block;
|
|
196
|
+
max-width: 100%;
|
|
197
|
+
overflow-x: auto;
|
|
198
|
+
border-collapse: collapse;
|
|
199
|
+
font-size: 0.9em;
|
|
200
|
+
}
|
|
201
|
+
:where(.ldt-prose :is(th, td)):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
202
|
+
padding: 0.5em 0.8em;
|
|
203
|
+
border: var(--loidolt-border-width) solid var(--loidolt-border);
|
|
204
|
+
text-align: start;
|
|
205
|
+
vertical-align: top;
|
|
206
|
+
}
|
|
207
|
+
:where(.ldt-prose th):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
208
|
+
background: var(--loidolt-surface-alt);
|
|
209
|
+
font-weight: 700;
|
|
210
|
+
}
|
|
211
|
+
:where(.ldt-prose td):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
212
|
+
background: var(--loidolt-surface);
|
|
213
|
+
}
|
|
214
|
+
:where(.ldt-prose :is(th, td)[align='center']):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
215
|
+
text-align: center;
|
|
216
|
+
}
|
|
217
|
+
:where(.ldt-prose :is(th, td)[align='right']):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
218
|
+
text-align: end;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* --- Disclosure ---------------------------------------------------------------------------- */
|
|
222
|
+
|
|
223
|
+
:where(.ldt-prose details):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
224
|
+
padding: 0.5em 0.9em;
|
|
225
|
+
border: var(--loidolt-border-width) solid var(--loidolt-border);
|
|
226
|
+
background: var(--loidolt-surface);
|
|
227
|
+
}
|
|
228
|
+
:where(.ldt-prose summary):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
229
|
+
font-weight: 700;
|
|
230
|
+
}
|
|
231
|
+
:where(.ldt-prose details[open] > summary):not(:where(.ldt-not-prose, .ldt-not-prose *)) {
|
|
232
|
+
margin-block-end: 0.5em;
|
|
233
|
+
}
|
package/src/components.css
CHANGED