@hagicode/hagilight-docusaurus 0.0.0-stage → 0.8.1-dev.92.1.85649f3

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/promoto.css ADDED
@@ -0,0 +1,396 @@
1
+ /*
2
+ * Promote card on Infima tokens. Layout: content on top, one action row below.
3
+ * The call to action sits bottom-left; pager and pause share that row at the
4
+ * bottom-right. Dismiss is a corner mark. Portrait phones keep only a thumbnail
5
+ * beside the title; short landscape viewports drop the thumbnail for a thin strip.
6
+ */
7
+
8
+ .hagilight-promoto {
9
+ --hagilight-promoto-cta-text: var(--ifm-color-white);
10
+ --promoto-control-size: 1.75rem;
11
+ --promoto-cta-height: 2.25rem;
12
+ --promoto-pad: 0.875rem;
13
+ --promoto-pager-width: calc(3 * var(--promoto-control-size) + 2.25rem + 0.375rem);
14
+ --promoto-muted: var(--ifm-color-emphasis-700);
15
+ display: block;
16
+ }
17
+
18
+ .hagilight-promoto[hidden],
19
+ .hagilight-promoto__shell[hidden],
20
+ .hagilight-promoto__controls[hidden] {
21
+ display: none !important;
22
+ }
23
+
24
+ .hagilight-promoto__shell {
25
+ position: fixed;
26
+ z-index: 40;
27
+ inset-inline: 0;
28
+ bottom: max(1rem, env(safe-area-inset-bottom));
29
+ width: min(42rem, calc(100vw - 1rem - 2 * max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))));
30
+ margin-inline: auto;
31
+ overflow: hidden;
32
+ border: 1px solid color-mix(in srgb, var(--ifm-color-primary) 24%, var(--ifm-color-emphasis-300));
33
+ border-radius: 1rem;
34
+ background: color-mix(in srgb, var(--ifm-background-color) 96%, var(--ifm-color-primary) 4%);
35
+ box-shadow: 0 12px 32px color-mix(in srgb, #000 14%, transparent);
36
+ color: var(--ifm-font-color-base);
37
+ opacity: 1;
38
+ visibility: visible;
39
+ transition: opacity 0.24s ease, visibility 0s linear;
40
+ }
41
+
42
+ .hagilight-promoto[data-state='footer-hidden'] .hagilight-promoto__shell {
43
+ opacity: 0;
44
+ visibility: hidden;
45
+ pointer-events: none;
46
+ transition: opacity 0.24s ease, visibility 0s linear 0.24s;
47
+ }
48
+
49
+ .hagilight-promoto__viewport {
50
+ overflow: hidden;
51
+ }
52
+
53
+ .hagilight-promoto__track {
54
+ display: flex;
55
+ align-items: stretch;
56
+ width: 100%;
57
+ transition: transform 0.34s ease;
58
+ }
59
+
60
+ .hagilight-promoto__slide {
61
+ display: grid;
62
+ grid-template-columns: auto minmax(0, 1fr);
63
+ grid-template-areas:
64
+ 'media copy'
65
+ 'media cta';
66
+ align-items: start;
67
+ column-gap: 1rem;
68
+ row-gap: 0.75rem;
69
+ width: 100%;
70
+ min-width: 100%;
71
+ padding: var(--promoto-pad);
72
+ }
73
+
74
+ .hagilight-promoto__slide:not([data-has-image='true']) {
75
+ grid-template-columns: minmax(0, 1fr);
76
+ grid-template-areas:
77
+ 'copy'
78
+ 'cta';
79
+ padding-inline-start: 1.25rem;
80
+ }
81
+
82
+ .hagilight-promoto__slide[aria-hidden='true'] {
83
+ pointer-events: none;
84
+ }
85
+
86
+ .hagilight-promoto__copy {
87
+ grid-area: copy;
88
+ display: grid;
89
+ gap: 0.25rem;
90
+ min-width: 0;
91
+ }
92
+
93
+ .hagilight-promoto__title,
94
+ .hagilight-promoto__description {
95
+ display: -webkit-box;
96
+ overflow: hidden;
97
+ margin: 0;
98
+ -webkit-box-orient: vertical;
99
+ -webkit-line-clamp: 2;
100
+ }
101
+
102
+ .hagilight-promoto__title {
103
+ padding-inline-end: 2rem;
104
+ color: var(--ifm-heading-color);
105
+ font-size: 1rem;
106
+ font-weight: 700;
107
+ line-height: 1.3;
108
+ text-wrap: balance;
109
+ }
110
+
111
+ .hagilight-promoto__description {
112
+ color: var(--promoto-muted);
113
+ font-size: 0.875rem;
114
+ font-weight: 400;
115
+ line-height: 1.4;
116
+ }
117
+
118
+ .hagilight-promoto__media {
119
+ grid-area: media;
120
+ display: inline-flex;
121
+ align-items: center;
122
+ justify-content: center;
123
+ width: 4.5rem;
124
+ min-width: 4.5rem;
125
+ aspect-ratio: 1;
126
+ overflow: hidden;
127
+ border: 1px solid color-mix(in srgb, var(--ifm-color-primary-dark) 18%, var(--ifm-color-emphasis-300));
128
+ border-radius: 0.75rem;
129
+ background: var(--ifm-color-emphasis-100);
130
+ }
131
+
132
+ .hagilight-promoto__image {
133
+ display: block;
134
+ width: 100%;
135
+ height: 100%;
136
+ object-fit: cover;
137
+ }
138
+
139
+ .hagilight-promoto__media picture {
140
+ display: contents;
141
+ }
142
+
143
+ .hagilight-promoto__cta {
144
+ grid-area: cta;
145
+ display: inline-flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+ justify-self: start;
149
+ max-width: min(100%, 16rem);
150
+ min-height: var(--promoto-cta-height);
151
+ padding: 0.4rem 1rem;
152
+ border: 1px solid color-mix(in srgb, var(--ifm-color-primary-dark) 30%, transparent);
153
+ border-radius: 999px;
154
+ background: var(--ifm-color-primary);
155
+ color: var(--hagilight-promoto-cta-text);
156
+ font-size: 0.875rem;
157
+ font-weight: 600;
158
+ line-height: 1.2;
159
+ text-align: center;
160
+ text-decoration: none;
161
+ }
162
+
163
+ .hagilight-promoto[data-multiple] .hagilight-promoto__cta {
164
+ max-width: min(16rem, calc(100% - var(--promoto-pager-width)));
165
+ }
166
+
167
+ .hagilight-promoto__cta:hover,
168
+ .hagilight-promoto__cta:focus-visible {
169
+ background: var(--ifm-color-primary-dark);
170
+ }
171
+
172
+ /* Pager and pause sit on the call-to-action row, bottom-right. */
173
+ .hagilight-promoto__controls {
174
+ position: absolute;
175
+ inset-block-end: var(--promoto-pad);
176
+ inset-inline-end: 0.5rem;
177
+ display: flex;
178
+ align-items: center;
179
+ height: var(--promoto-cta-height);
180
+ gap: 0.125rem;
181
+ }
182
+
183
+ .hagilight-promoto__dismiss,
184
+ .hagilight-promoto__control {
185
+ position: relative;
186
+ display: inline-grid;
187
+ place-items: center;
188
+ flex: none;
189
+ width: var(--promoto-control-size);
190
+ height: var(--promoto-control-size);
191
+ padding: 0;
192
+ border: 0;
193
+ border-radius: 999px;
194
+ background: transparent;
195
+ color: var(--promoto-muted);
196
+ cursor: pointer;
197
+ transition: background-color 0.15s ease, color 0.15s ease;
198
+ }
199
+
200
+ /* Keep the tap target larger than the visible mark. */
201
+ .hagilight-promoto__dismiss::before,
202
+ .hagilight-promoto__control::before {
203
+ content: '';
204
+ position: absolute;
205
+ inset-block: -0.375rem;
206
+ inset-inline: 0;
207
+ }
208
+
209
+ .hagilight-promoto__dismiss {
210
+ position: absolute;
211
+ inset-block-start: 0.375rem;
212
+ inset-inline-end: 0.375rem;
213
+ }
214
+
215
+ .hagilight-promoto__dismiss::before {
216
+ inset-inline: -0.25rem;
217
+ }
218
+
219
+ .hagilight-promoto__icon {
220
+ width: 1rem;
221
+ height: 1rem;
222
+ fill: none;
223
+ stroke: currentColor;
224
+ stroke-width: 2;
225
+ stroke-linecap: round;
226
+ stroke-linejoin: round;
227
+ pointer-events: none;
228
+ }
229
+
230
+ .hagilight-promoto__icon--play {
231
+ display: none;
232
+ fill: currentColor;
233
+ }
234
+
235
+ .hagilight-promoto__control[aria-pressed='true'] .hagilight-promoto__icon--pause {
236
+ display: none;
237
+ }
238
+
239
+ .hagilight-promoto__control[aria-pressed='true'] .hagilight-promoto__icon--play {
240
+ display: block;
241
+ }
242
+
243
+ .hagilight-promoto__count {
244
+ min-width: 2.25rem;
245
+ color: var(--promoto-muted);
246
+ font-size: 0.75rem;
247
+ font-variant-numeric: tabular-nums;
248
+ line-height: 1;
249
+ text-align: center;
250
+ white-space: nowrap;
251
+ }
252
+
253
+ .hagilight-promoto__control:disabled {
254
+ cursor: default;
255
+ opacity: 0.45;
256
+ }
257
+
258
+ .hagilight-promoto__status {
259
+ position: absolute;
260
+ width: 1px;
261
+ height: 1px;
262
+ overflow: hidden;
263
+ clip: rect(0, 0, 0, 0);
264
+ white-space: nowrap;
265
+ }
266
+
267
+ @media (hover: hover) {
268
+ .hagilight-promoto__dismiss:hover,
269
+ .hagilight-promoto__control:hover:not(:disabled) {
270
+ background: color-mix(in srgb, var(--ifm-color-primary) 12%, transparent);
271
+ color: var(--ifm-heading-color);
272
+ }
273
+ }
274
+
275
+ .hagilight-promoto__dismiss:focus-visible,
276
+ .hagilight-promoto__control:focus-visible,
277
+ .hagilight-promoto__cta:focus-visible {
278
+ outline: 2px solid var(--ifm-color-primary);
279
+ outline-offset: 2px;
280
+ }
281
+
282
+ @media (pointer: coarse) {
283
+ .hagilight-promoto {
284
+ --promoto-control-size: 2rem;
285
+ }
286
+ }
287
+
288
+ /* Portrait phones: thumbnail beside the title only; description and action row take the full width. */
289
+ @media (max-width: 36rem) and (min-height: 30rem) {
290
+ .hagilight-promoto {
291
+ --promoto-control-size: 2rem;
292
+ --promoto-pad: 0.75rem;
293
+ }
294
+
295
+ .hagilight-promoto__shell {
296
+ bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
297
+ width: min(calc(100vw - 1rem - 2 * max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))), 28rem);
298
+ border-radius: 0.875rem;
299
+ }
300
+
301
+ .hagilight-promoto__slide[data-has-image] {
302
+ grid-template-columns: minmax(0, 1fr);
303
+ grid-template-areas: 'title' 'desc' 'cta';
304
+ gap: 0.375rem;
305
+ padding: var(--promoto-pad);
306
+ }
307
+
308
+ .hagilight-promoto__slide[data-has-image='true'] {
309
+ grid-template-columns: 3rem minmax(0, 1fr);
310
+ grid-template-areas: 'media title' 'desc desc' 'cta cta';
311
+ column-gap: 0.625rem;
312
+ }
313
+
314
+ /* Flatten copy so the thumbnail sits beside the title only. */
315
+ .hagilight-promoto__copy {
316
+ display: contents;
317
+ }
318
+
319
+ .hagilight-promoto__title {
320
+ grid-area: title;
321
+ align-self: center;
322
+ font-size: 0.95rem;
323
+ }
324
+
325
+ .hagilight-promoto__description {
326
+ grid-area: desc;
327
+ font-size: 0.85rem;
328
+ line-height: 1.35;
329
+ }
330
+
331
+ .hagilight-promoto__media {
332
+ width: 3rem;
333
+ min-width: 3rem;
334
+ border-radius: 0.625rem;
335
+ }
336
+
337
+ .hagilight-promoto__cta {
338
+ margin-block-start: 0.25rem;
339
+ padding-inline: 0.875rem;
340
+ }
341
+ }
342
+
343
+ @media (max-width: 22.5rem) and (min-height: 30rem) {
344
+ .hagilight-promoto {
345
+ --promoto-pager-width: 6rem;
346
+ }
347
+
348
+ .hagilight-promoto__count {
349
+ display: none;
350
+ }
351
+
352
+ .hagilight-promoto__cta {
353
+ padding-inline: 0.625rem;
354
+ }
355
+ }
356
+
357
+ /* Short landscape viewports: thin strip, no thumbnail, one-line description. */
358
+ @media (max-height: 30rem) {
359
+ .hagilight-promoto {
360
+ --promoto-cta-height: 2rem;
361
+ --promoto-pad: 0.5rem;
362
+ }
363
+
364
+ .hagilight-promoto__shell {
365
+ bottom: max(0.5rem, env(safe-area-inset-bottom));
366
+ }
367
+
368
+ .hagilight-promoto__media {
369
+ display: none;
370
+ }
371
+
372
+ .hagilight-promoto__slide[data-has-image] {
373
+ grid-template-columns: minmax(0, 1fr);
374
+ grid-template-areas: 'copy' 'cta';
375
+ row-gap: 0.375rem;
376
+ padding: 0.5rem 0.75rem 0.5rem 1rem;
377
+ }
378
+
379
+ .hagilight-promoto__description {
380
+ -webkit-line-clamp: 1;
381
+ }
382
+
383
+ .hagilight-promoto__dismiss {
384
+ inset-block-start: 0.25rem;
385
+ inset-inline-end: 0.25rem;
386
+ }
387
+ }
388
+
389
+ @media (prefers-reduced-motion: reduce) {
390
+ .hagilight-promoto__shell,
391
+ .hagilight-promoto__track,
392
+ .hagilight-promoto__dismiss,
393
+ .hagilight-promoto__control {
394
+ transition: none;
395
+ }
396
+ }
package/styles.css ADDED
@@ -0,0 +1,83 @@
1
+ .hagilight-footer {
2
+ --hagilight-footer-border: var(--ifm-color-emphasis-300);
3
+ --hagilight-footer-muted: var(--ifm-color-emphasis-700);
4
+ border-top: 1px solid var(--hagilight-footer-border);
5
+ color: var(--ifm-font-color-base);
6
+ padding: 1.5rem var(--ifm-spacing-horizontal, 1rem) 1rem;
7
+ }
8
+
9
+ .hagilight-footer__sections {
10
+ display: grid;
11
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
12
+ gap: 1.5rem;
13
+ margin: 0 auto 1.5rem;
14
+ max-width: 72rem;
15
+ }
16
+
17
+ .hagilight-footer section {
18
+ min-width: 0;
19
+ }
20
+
21
+ .hagilight-footer h2 {
22
+ margin: 0 0 0.75rem;
23
+ font-size: 0.95rem;
24
+ font-weight: 650;
25
+ }
26
+
27
+ .hagilight-footer ul {
28
+ display: grid;
29
+ gap: 0.5rem;
30
+ margin: 0;
31
+ padding: 0;
32
+ list-style: none;
33
+ }
34
+
35
+ .hagilight-footer a,
36
+ .hagilight-footer a:hover {
37
+ color: inherit;
38
+ text-decoration: none;
39
+ text-underline-offset: 0.2em;
40
+ }
41
+
42
+ .hagilight-footer a:hover {
43
+ text-decoration: underline;
44
+ }
45
+
46
+ .hagilight-footer a:focus-visible {
47
+ border-radius: 0.125rem;
48
+ outline: 2px solid currentColor;
49
+ outline-offset: 0.2rem;
50
+ }
51
+
52
+ .hagilight-footer__filings {
53
+ display: flex;
54
+ flex-wrap: wrap;
55
+ justify-content: center;
56
+ gap: 0.75rem 1.5rem;
57
+ border-top: 1px solid var(--hagilight-footer-border);
58
+ padding-top: 1rem;
59
+ text-align: center;
60
+ }
61
+
62
+ .hagilight-footer__copyright {
63
+ color: var(--hagilight-footer-muted);
64
+ font-size: 0.8rem;
65
+ margin: 1rem 0 0;
66
+ text-align: center;
67
+ }
68
+
69
+ .hagilight-footer__attribution {
70
+ overflow-wrap: anywhere;
71
+ }
72
+
73
+ @media (max-width: 40rem) {
74
+ .hagilight-footer__sections {
75
+ grid-template-columns: 1fr;
76
+ gap: 1.25rem;
77
+ }
78
+
79
+ .hagilight-footer__filings {
80
+ justify-content: flex-start;
81
+ gap: 0.75rem 1rem;
82
+ }
83
+ }