@pimolu/web-styles 0.1.0-beta.8 → 0.1.0-beta.9
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/README.fr.md +125 -125
- package/README.md +6 -6
- package/dist/api-table.css +6 -5
- package/dist/arc-carousel.css +248 -0
- package/dist/carousel.css +5 -1
- package/dist/coverflow-carousel.css +238 -0
- package/dist/layered.css +547 -6
- package/dist/modal.css +186 -0
- package/dist/multi-carousel.css +236 -0
- package/dist/peek-carousel.css +237 -0
- package/dist/pimolu.css +531 -6
- package/dist/pimolu.min.css +1 -1
- package/dist/stack-carousel.css +237 -0
- package/dist/themes.css +129 -0
- package/dist/thumbnail-carousel.css +231 -0
- package/dist/tokens.css +902 -0
- package/package.json +176 -171
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/* src/carousel-base.css */
|
|
2
|
+
.pimolu-carousel-root {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: grid;
|
|
5
|
+
gap: 12px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
color: var(--pimolu-foreground);
|
|
10
|
+
font-family: var(--pimolu-font-body, inherit);
|
|
11
|
+
--pimolu-carousel-gap: 16px;
|
|
12
|
+
--pimolu-carousel-per-view: 1;
|
|
13
|
+
}
|
|
14
|
+
.pimolu-carousel-root > .pimolu-carousel__viewport {
|
|
15
|
+
display: block;
|
|
16
|
+
overflow: visible;
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
scroll-snap-type: none;
|
|
19
|
+
}
|
|
20
|
+
.pimolu-carousel-root > .pimolu-carousel__viewport[data-scroll=false] {
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
23
|
+
.pimolu-carousel__viewport {
|
|
24
|
+
position: relative;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
.pimolu-carousel__viewport:focus-visible {
|
|
30
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
31
|
+
outline-offset: 3px;
|
|
32
|
+
}
|
|
33
|
+
.pimolu-carousel__viewport[data-scroll=true] {
|
|
34
|
+
display: flex;
|
|
35
|
+
gap: var(--pimolu-carousel-gap, 16px);
|
|
36
|
+
overflow-x: auto;
|
|
37
|
+
overflow-y: hidden;
|
|
38
|
+
overscroll-behavior-x: contain;
|
|
39
|
+
scroll-behavior: smooth;
|
|
40
|
+
scroll-snap-type: x mandatory;
|
|
41
|
+
scrollbar-width: none;
|
|
42
|
+
}
|
|
43
|
+
.pimolu-carousel__viewport[data-scroll=true]::-webkit-scrollbar {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
.pimolu-carousel__slide {
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 480ms ease;
|
|
50
|
+
}
|
|
51
|
+
.pimolu-carousel__viewport[data-scroll=true] .pimolu-carousel__slide {
|
|
52
|
+
flex: 1 0 calc((100% - (var(--pimolu-carousel-per-view, 1) - 1) * var(--pimolu-carousel-gap, 16px)) / var(--pimolu-carousel-per-view, 1));
|
|
53
|
+
scroll-snap-align: start;
|
|
54
|
+
}
|
|
55
|
+
.pimolu-carousel__viewport[data-effect=peek] .pimolu-carousel__slide {
|
|
56
|
+
flex: 0 0 min(440px, 68vw);
|
|
57
|
+
scroll-snap-align: center;
|
|
58
|
+
}
|
|
59
|
+
.pimolu-carousel__control {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 50%;
|
|
62
|
+
z-index: 20;
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
width: 2.5rem;
|
|
68
|
+
height: 2.5rem;
|
|
69
|
+
padding: 0;
|
|
70
|
+
border: 1px solid var(--pimolu-border, currentColor);
|
|
71
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
72
|
+
background: var(--pimolu-background, Canvas);
|
|
73
|
+
color: var(--pimolu-foreground);
|
|
74
|
+
box-shadow: var(--pimolu-shadow-raised, 0 2px 8px rgb(0 0 0 / 18%));
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transform: translateY(-50%);
|
|
77
|
+
transition: background-color 150ms, opacity 150ms;
|
|
78
|
+
}
|
|
79
|
+
.pimolu-carousel__control--previous {
|
|
80
|
+
inset-inline-start: var(--pimolu-spacing-2, 8px);
|
|
81
|
+
}
|
|
82
|
+
.pimolu-carousel__control--next {
|
|
83
|
+
inset-inline-end: var(--pimolu-spacing-2, 8px);
|
|
84
|
+
}
|
|
85
|
+
.pimolu-carousel__control:hover:not(:disabled) {
|
|
86
|
+
background: var(--pimolu-muted, var(--pimolu-background, Canvas));
|
|
87
|
+
}
|
|
88
|
+
.pimolu-carousel__control:disabled {
|
|
89
|
+
opacity: 0.35;
|
|
90
|
+
cursor: default;
|
|
91
|
+
}
|
|
92
|
+
.pimolu-carousel__control:focus-visible {
|
|
93
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
94
|
+
outline-offset: 2px;
|
|
95
|
+
}
|
|
96
|
+
.pimolu-carousel__control svg {
|
|
97
|
+
display: block;
|
|
98
|
+
width: 1.25rem;
|
|
99
|
+
height: 1.25rem;
|
|
100
|
+
}
|
|
101
|
+
.pimolu-carousel__dots {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
gap: 2px;
|
|
107
|
+
min-width: 0;
|
|
108
|
+
}
|
|
109
|
+
.pimolu-carousel__dot {
|
|
110
|
+
display: inline-grid;
|
|
111
|
+
place-items: center;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
width: 1.5rem;
|
|
114
|
+
height: 1.5rem;
|
|
115
|
+
padding: 0;
|
|
116
|
+
border: 0;
|
|
117
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
118
|
+
background: transparent;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
.pimolu-carousel__dot::before {
|
|
122
|
+
content: "";
|
|
123
|
+
display: block;
|
|
124
|
+
width: 0.5rem;
|
|
125
|
+
height: 0.5rem;
|
|
126
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
127
|
+
background: color-mix(in srgb, var(--pimolu-foreground, currentColor) 28%, transparent);
|
|
128
|
+
transition: width 150ms, background-color 150ms;
|
|
129
|
+
}
|
|
130
|
+
.pimolu-carousel__dot[data-active=true]::before {
|
|
131
|
+
width: 1.25rem;
|
|
132
|
+
background: var(--pimolu-primary, var(--pimolu-foreground, currentColor));
|
|
133
|
+
}
|
|
134
|
+
.pimolu-carousel__dot:focus-visible {
|
|
135
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
136
|
+
outline-offset: 2px;
|
|
137
|
+
}
|
|
138
|
+
.pimolu-carousel__thumbnails {
|
|
139
|
+
display: flex;
|
|
140
|
+
gap: 8px;
|
|
141
|
+
min-width: 0;
|
|
142
|
+
overflow-x: auto;
|
|
143
|
+
scrollbar-width: none;
|
|
144
|
+
}
|
|
145
|
+
.pimolu-carousel__thumbnails::-webkit-scrollbar {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
.pimolu-carousel__thumbnail {
|
|
149
|
+
flex: 0 0 auto;
|
|
150
|
+
box-sizing: border-box;
|
|
151
|
+
width: 72px;
|
|
152
|
+
padding: 2px;
|
|
153
|
+
border: 2px solid transparent;
|
|
154
|
+
border-radius: calc(var(--pimolu-radius-sm, 6px) + 4px);
|
|
155
|
+
background: transparent;
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
opacity: 0.6;
|
|
158
|
+
transition: opacity 150ms, border-color 150ms;
|
|
159
|
+
}
|
|
160
|
+
.pimolu-carousel__thumbnail img {
|
|
161
|
+
display: block;
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: auto;
|
|
164
|
+
border-radius: var(--pimolu-radius-sm, 6px);
|
|
165
|
+
object-fit: cover;
|
|
166
|
+
}
|
|
167
|
+
.pimolu-carousel__thumbnail[data-active=true] {
|
|
168
|
+
border-color: var(--pimolu-primary);
|
|
169
|
+
opacity: 1;
|
|
170
|
+
}
|
|
171
|
+
.pimolu-carousel__thumbnail:hover {
|
|
172
|
+
opacity: 1;
|
|
173
|
+
}
|
|
174
|
+
.pimolu-carousel__thumbnail:focus-visible {
|
|
175
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
176
|
+
outline-offset: 2px;
|
|
177
|
+
}
|
|
178
|
+
.pimolu-carousel__live {
|
|
179
|
+
position: absolute;
|
|
180
|
+
width: 1px;
|
|
181
|
+
height: 1px;
|
|
182
|
+
margin: -1px;
|
|
183
|
+
padding: 0;
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
clip: rect(0 0 0 0);
|
|
186
|
+
white-space: nowrap;
|
|
187
|
+
border: 0;
|
|
188
|
+
}
|
|
189
|
+
@media (prefers-reduced-motion: reduce) {
|
|
190
|
+
.pimolu-carousel__viewport[data-scroll=true] {
|
|
191
|
+
scroll-behavior: auto;
|
|
192
|
+
}
|
|
193
|
+
.pimolu-carousel__slide,
|
|
194
|
+
.pimolu-carousel__control,
|
|
195
|
+
.pimolu-carousel__dot::before,
|
|
196
|
+
.pimolu-carousel__thumbnail {
|
|
197
|
+
transition: none;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
@media (forced-colors: active) {
|
|
201
|
+
.pimolu-carousel__control {
|
|
202
|
+
border-color: CanvasText;
|
|
203
|
+
background: Canvas;
|
|
204
|
+
color: CanvasText;
|
|
205
|
+
box-shadow: none;
|
|
206
|
+
}
|
|
207
|
+
.pimolu-carousel__dot::before {
|
|
208
|
+
background: CanvasText;
|
|
209
|
+
}
|
|
210
|
+
.pimolu-carousel__dot[data-active=true]::before {
|
|
211
|
+
background: Highlight;
|
|
212
|
+
}
|
|
213
|
+
.pimolu-carousel__thumbnail {
|
|
214
|
+
border-color: CanvasText;
|
|
215
|
+
}
|
|
216
|
+
.pimolu-carousel__thumbnail[data-active=true] {
|
|
217
|
+
border-color: Highlight;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* src/stack-carousel.css */
|
|
222
|
+
.pimolu-stack-carousel .pimolu-carousel__viewport {
|
|
223
|
+
height: clamp(260px, 44vw, 400px);
|
|
224
|
+
}
|
|
225
|
+
.pimolu-stack-carousel .pimolu-carousel__slide {
|
|
226
|
+
position: absolute;
|
|
227
|
+
inset-block-start: 0;
|
|
228
|
+
inset-inline-start: 50%;
|
|
229
|
+
width: min(70%, 460px);
|
|
230
|
+
height: 100%;
|
|
231
|
+
margin-inline-start: calc(min(70%, 460px) / -2);
|
|
232
|
+
border-radius: calc(var(--pimolu-radius-lg, 14px) + 4px);
|
|
233
|
+
border: 1px solid var(--pimolu-border);
|
|
234
|
+
background: var(--pimolu-surface);
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
transform-origin: center top;
|
|
237
|
+
}
|
package/dist/themes.css
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/* ../themes/dist/styles.css */
|
|
2
|
+
:root {
|
|
3
|
+
--pimolu-color-white: #FFFFFF;
|
|
4
|
+
--pimolu-color-black: #000000;
|
|
5
|
+
--pimolu-color-ink-25: #FAF8F5;
|
|
6
|
+
--pimolu-color-ink-50: #F6F2EF;
|
|
7
|
+
--pimolu-color-ink-100: #F4F0EC;
|
|
8
|
+
--pimolu-color-ink-200: #E7E0D9;
|
|
9
|
+
--pimolu-color-ink-400: #B8B0BD;
|
|
10
|
+
--pimolu-color-ink-500: #8E8490;
|
|
11
|
+
--pimolu-color-ink-550: #857D90;
|
|
12
|
+
--pimolu-color-ink-600: #706B73;
|
|
13
|
+
--pimolu-color-ink-700: #39343E;
|
|
14
|
+
--pimolu-color-ink-800: #26232D;
|
|
15
|
+
--pimolu-color-ink-900: #24212A;
|
|
16
|
+
--pimolu-color-ink-950: #18161D;
|
|
17
|
+
--pimolu-color-iris-50: #F0EBF9;
|
|
18
|
+
--pimolu-color-iris-300: #B9A5FA;
|
|
19
|
+
--pimolu-color-iris-400: #A48BEF;
|
|
20
|
+
--pimolu-color-iris-600: #6746C7;
|
|
21
|
+
--pimolu-color-iris-700: #5637B0;
|
|
22
|
+
--pimolu-color-iris-900: #30283E;
|
|
23
|
+
--pimolu-color-iris-950: #21172D;
|
|
24
|
+
--pimolu-color-indigo-400: #818CF8;
|
|
25
|
+
--pimolu-color-indigo-500: #6366F1;
|
|
26
|
+
--pimolu-color-indigo-600: #4F46E5;
|
|
27
|
+
--pimolu-color-indigo-700: #4338CA;
|
|
28
|
+
--pimolu-color-slate-50: #F8FAFC;
|
|
29
|
+
--pimolu-color-slate-100: #F1F5F9;
|
|
30
|
+
--pimolu-color-slate-200: #E2E8F0;
|
|
31
|
+
--pimolu-color-slate-400: #94A3B8;
|
|
32
|
+
--pimolu-color-slate-500: #64748B;
|
|
33
|
+
--pimolu-color-slate-550: #607087;
|
|
34
|
+
--pimolu-color-slate-800: #1E293B;
|
|
35
|
+
--pimolu-color-slate-900: #0F172A;
|
|
36
|
+
--pimolu-color-slate-950: #020617;
|
|
37
|
+
--pimolu-color-red-400: #F87171;
|
|
38
|
+
--pimolu-color-red-500: #EF4444;
|
|
39
|
+
--pimolu-color-red-600: #DC2626;
|
|
40
|
+
--pimolu-color-red-700: #B91C1C;
|
|
41
|
+
--pimolu-color-green-500: #22C55E;
|
|
42
|
+
--pimolu-color-green-600: #16A34A;
|
|
43
|
+
--pimolu-color-green-700: #15803D;
|
|
44
|
+
--pimolu-color-green-800: #166534;
|
|
45
|
+
--pimolu-color-amber-500: #F59E0B;
|
|
46
|
+
--pimolu-color-amber-600: #D97706;
|
|
47
|
+
--pimolu-spacing-0: 0px;
|
|
48
|
+
--pimolu-spacing-1: 4px;
|
|
49
|
+
--pimolu-spacing-2: 8px;
|
|
50
|
+
--pimolu-spacing-3: 12px;
|
|
51
|
+
--pimolu-spacing-4: 16px;
|
|
52
|
+
--pimolu-spacing-5: 20px;
|
|
53
|
+
--pimolu-spacing-6: 24px;
|
|
54
|
+
--pimolu-spacing-8: 32px;
|
|
55
|
+
--pimolu-spacing-10: 40px;
|
|
56
|
+
--pimolu-spacing-12: 48px;
|
|
57
|
+
--pimolu-radius-none: 0px;
|
|
58
|
+
--pimolu-radius-sm: 6px;
|
|
59
|
+
--pimolu-radius-md: 10px;
|
|
60
|
+
--pimolu-radius-lg: 14px;
|
|
61
|
+
--pimolu-radius-xl: 18px;
|
|
62
|
+
--pimolu-radius-full: 9999px;
|
|
63
|
+
--pimolu-font-size-xs: 12px;
|
|
64
|
+
--pimolu-font-size-sm: 14px;
|
|
65
|
+
--pimolu-font-size-md: 16px;
|
|
66
|
+
--pimolu-font-size-lg: 18px;
|
|
67
|
+
--pimolu-font-size-xl: 20px;
|
|
68
|
+
--pimolu-font-size-2xl: 24px;
|
|
69
|
+
--pimolu-font-size-3xl: 30px;
|
|
70
|
+
--pimolu-font-family-sans:
|
|
71
|
+
Inter,
|
|
72
|
+
system-ui,
|
|
73
|
+
sans-serif;
|
|
74
|
+
}
|
|
75
|
+
:root,
|
|
76
|
+
[data-pimolu-theme=light] {
|
|
77
|
+
color-scheme: light;
|
|
78
|
+
--pimolu-background: var(--pimolu-color-white);
|
|
79
|
+
--pimolu-foreground: var(--pimolu-color-slate-950);
|
|
80
|
+
--pimolu-surface: var(--pimolu-color-slate-50);
|
|
81
|
+
--pimolu-surface-foreground: var(--pimolu-color-slate-900);
|
|
82
|
+
--pimolu-muted: var(--pimolu-color-slate-100);
|
|
83
|
+
--pimolu-muted-foreground: var(--pimolu-color-slate-550);
|
|
84
|
+
--pimolu-border: var(--pimolu-color-slate-200);
|
|
85
|
+
--pimolu-primary: var(--pimolu-color-indigo-600);
|
|
86
|
+
--pimolu-primary-hover: var(--pimolu-color-indigo-700);
|
|
87
|
+
--pimolu-primary-foreground: var(--pimolu-color-white);
|
|
88
|
+
--pimolu-focus-ring: var(--pimolu-color-indigo-500);
|
|
89
|
+
--pimolu-success: var(--pimolu-color-green-700);
|
|
90
|
+
--pimolu-success-hover: var(--pimolu-color-green-800);
|
|
91
|
+
--pimolu-success-foreground: var(--pimolu-color-white);
|
|
92
|
+
--pimolu-warning: var(--pimolu-color-amber-500);
|
|
93
|
+
--pimolu-warning-hover: var(--pimolu-color-amber-600);
|
|
94
|
+
--pimolu-warning-foreground: var(--pimolu-color-slate-950);
|
|
95
|
+
--pimolu-danger: var(--pimolu-color-red-600);
|
|
96
|
+
--pimolu-danger-hover: var(--pimolu-color-red-700);
|
|
97
|
+
--pimolu-danger-foreground: var(--pimolu-color-white);
|
|
98
|
+
--pimolu-control-border: var(--pimolu-color-slate-500);
|
|
99
|
+
--pimolu-primary-soft: var(--pimolu-color-slate-100);
|
|
100
|
+
--pimolu-primary-soft-foreground: var(--pimolu-color-indigo-600);
|
|
101
|
+
}
|
|
102
|
+
[data-pimolu-theme=dark] {
|
|
103
|
+
color-scheme: dark;
|
|
104
|
+
--pimolu-background: var(--pimolu-color-slate-950);
|
|
105
|
+
--pimolu-foreground: var(--pimolu-color-slate-50);
|
|
106
|
+
--pimolu-surface: var(--pimolu-color-slate-900);
|
|
107
|
+
--pimolu-surface-foreground: var(--pimolu-color-slate-50);
|
|
108
|
+
--pimolu-muted: var(--pimolu-color-slate-800);
|
|
109
|
+
--pimolu-muted-foreground: var(--pimolu-color-slate-400);
|
|
110
|
+
--pimolu-border: var(--pimolu-color-slate-800);
|
|
111
|
+
--pimolu-primary: var(--pimolu-color-indigo-400);
|
|
112
|
+
--pimolu-primary-hover: var(--pimolu-color-indigo-500);
|
|
113
|
+
--pimolu-primary-foreground: var(--pimolu-color-slate-950);
|
|
114
|
+
--pimolu-focus-ring: var(--pimolu-color-indigo-400);
|
|
115
|
+
--pimolu-success: var(--pimolu-color-green-500);
|
|
116
|
+
--pimolu-success-hover: var(--pimolu-color-green-600);
|
|
117
|
+
--pimolu-success-foreground: var(--pimolu-color-slate-950);
|
|
118
|
+
--pimolu-warning: var(--pimolu-color-amber-500);
|
|
119
|
+
--pimolu-warning-hover: var(--pimolu-color-amber-600);
|
|
120
|
+
--pimolu-warning-foreground: var(--pimolu-color-slate-950);
|
|
121
|
+
--pimolu-danger: var(--pimolu-color-red-400);
|
|
122
|
+
--pimolu-danger-hover: var(--pimolu-color-red-500);
|
|
123
|
+
--pimolu-danger-foreground: var(--pimolu-color-slate-950);
|
|
124
|
+
--pimolu-control-border: var(--pimolu-color-slate-500);
|
|
125
|
+
--pimolu-primary-soft: var(--pimolu-color-slate-800);
|
|
126
|
+
--pimolu-primary-soft-foreground: var(--pimolu-color-indigo-400);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* src/themes.css */
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/* src/carousel-base.css */
|
|
2
|
+
.pimolu-carousel-root {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: grid;
|
|
5
|
+
gap: 12px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
color: var(--pimolu-foreground);
|
|
10
|
+
font-family: var(--pimolu-font-body, inherit);
|
|
11
|
+
--pimolu-carousel-gap: 16px;
|
|
12
|
+
--pimolu-carousel-per-view: 1;
|
|
13
|
+
}
|
|
14
|
+
.pimolu-carousel-root > .pimolu-carousel__viewport {
|
|
15
|
+
display: block;
|
|
16
|
+
overflow: visible;
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
scroll-snap-type: none;
|
|
19
|
+
}
|
|
20
|
+
.pimolu-carousel-root > .pimolu-carousel__viewport[data-scroll=false] {
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
23
|
+
.pimolu-carousel__viewport {
|
|
24
|
+
position: relative;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
.pimolu-carousel__viewport:focus-visible {
|
|
30
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
31
|
+
outline-offset: 3px;
|
|
32
|
+
}
|
|
33
|
+
.pimolu-carousel__viewport[data-scroll=true] {
|
|
34
|
+
display: flex;
|
|
35
|
+
gap: var(--pimolu-carousel-gap, 16px);
|
|
36
|
+
overflow-x: auto;
|
|
37
|
+
overflow-y: hidden;
|
|
38
|
+
overscroll-behavior-x: contain;
|
|
39
|
+
scroll-behavior: smooth;
|
|
40
|
+
scroll-snap-type: x mandatory;
|
|
41
|
+
scrollbar-width: none;
|
|
42
|
+
}
|
|
43
|
+
.pimolu-carousel__viewport[data-scroll=true]::-webkit-scrollbar {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
.pimolu-carousel__slide {
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 480ms ease;
|
|
50
|
+
}
|
|
51
|
+
.pimolu-carousel__viewport[data-scroll=true] .pimolu-carousel__slide {
|
|
52
|
+
flex: 1 0 calc((100% - (var(--pimolu-carousel-per-view, 1) - 1) * var(--pimolu-carousel-gap, 16px)) / var(--pimolu-carousel-per-view, 1));
|
|
53
|
+
scroll-snap-align: start;
|
|
54
|
+
}
|
|
55
|
+
.pimolu-carousel__viewport[data-effect=peek] .pimolu-carousel__slide {
|
|
56
|
+
flex: 0 0 min(440px, 68vw);
|
|
57
|
+
scroll-snap-align: center;
|
|
58
|
+
}
|
|
59
|
+
.pimolu-carousel__control {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 50%;
|
|
62
|
+
z-index: 20;
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
width: 2.5rem;
|
|
68
|
+
height: 2.5rem;
|
|
69
|
+
padding: 0;
|
|
70
|
+
border: 1px solid var(--pimolu-border, currentColor);
|
|
71
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
72
|
+
background: var(--pimolu-background, Canvas);
|
|
73
|
+
color: var(--pimolu-foreground);
|
|
74
|
+
box-shadow: var(--pimolu-shadow-raised, 0 2px 8px rgb(0 0 0 / 18%));
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transform: translateY(-50%);
|
|
77
|
+
transition: background-color 150ms, opacity 150ms;
|
|
78
|
+
}
|
|
79
|
+
.pimolu-carousel__control--previous {
|
|
80
|
+
inset-inline-start: var(--pimolu-spacing-2, 8px);
|
|
81
|
+
}
|
|
82
|
+
.pimolu-carousel__control--next {
|
|
83
|
+
inset-inline-end: var(--pimolu-spacing-2, 8px);
|
|
84
|
+
}
|
|
85
|
+
.pimolu-carousel__control:hover:not(:disabled) {
|
|
86
|
+
background: var(--pimolu-muted, var(--pimolu-background, Canvas));
|
|
87
|
+
}
|
|
88
|
+
.pimolu-carousel__control:disabled {
|
|
89
|
+
opacity: 0.35;
|
|
90
|
+
cursor: default;
|
|
91
|
+
}
|
|
92
|
+
.pimolu-carousel__control:focus-visible {
|
|
93
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
94
|
+
outline-offset: 2px;
|
|
95
|
+
}
|
|
96
|
+
.pimolu-carousel__control svg {
|
|
97
|
+
display: block;
|
|
98
|
+
width: 1.25rem;
|
|
99
|
+
height: 1.25rem;
|
|
100
|
+
}
|
|
101
|
+
.pimolu-carousel__dots {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
gap: 2px;
|
|
107
|
+
min-width: 0;
|
|
108
|
+
}
|
|
109
|
+
.pimolu-carousel__dot {
|
|
110
|
+
display: inline-grid;
|
|
111
|
+
place-items: center;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
width: 1.5rem;
|
|
114
|
+
height: 1.5rem;
|
|
115
|
+
padding: 0;
|
|
116
|
+
border: 0;
|
|
117
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
118
|
+
background: transparent;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
.pimolu-carousel__dot::before {
|
|
122
|
+
content: "";
|
|
123
|
+
display: block;
|
|
124
|
+
width: 0.5rem;
|
|
125
|
+
height: 0.5rem;
|
|
126
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
127
|
+
background: color-mix(in srgb, var(--pimolu-foreground, currentColor) 28%, transparent);
|
|
128
|
+
transition: width 150ms, background-color 150ms;
|
|
129
|
+
}
|
|
130
|
+
.pimolu-carousel__dot[data-active=true]::before {
|
|
131
|
+
width: 1.25rem;
|
|
132
|
+
background: var(--pimolu-primary, var(--pimolu-foreground, currentColor));
|
|
133
|
+
}
|
|
134
|
+
.pimolu-carousel__dot:focus-visible {
|
|
135
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
136
|
+
outline-offset: 2px;
|
|
137
|
+
}
|
|
138
|
+
.pimolu-carousel__thumbnails {
|
|
139
|
+
display: flex;
|
|
140
|
+
gap: 8px;
|
|
141
|
+
min-width: 0;
|
|
142
|
+
overflow-x: auto;
|
|
143
|
+
scrollbar-width: none;
|
|
144
|
+
}
|
|
145
|
+
.pimolu-carousel__thumbnails::-webkit-scrollbar {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
.pimolu-carousel__thumbnail {
|
|
149
|
+
flex: 0 0 auto;
|
|
150
|
+
box-sizing: border-box;
|
|
151
|
+
width: 72px;
|
|
152
|
+
padding: 2px;
|
|
153
|
+
border: 2px solid transparent;
|
|
154
|
+
border-radius: calc(var(--pimolu-radius-sm, 6px) + 4px);
|
|
155
|
+
background: transparent;
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
opacity: 0.6;
|
|
158
|
+
transition: opacity 150ms, border-color 150ms;
|
|
159
|
+
}
|
|
160
|
+
.pimolu-carousel__thumbnail img {
|
|
161
|
+
display: block;
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: auto;
|
|
164
|
+
border-radius: var(--pimolu-radius-sm, 6px);
|
|
165
|
+
object-fit: cover;
|
|
166
|
+
}
|
|
167
|
+
.pimolu-carousel__thumbnail[data-active=true] {
|
|
168
|
+
border-color: var(--pimolu-primary);
|
|
169
|
+
opacity: 1;
|
|
170
|
+
}
|
|
171
|
+
.pimolu-carousel__thumbnail:hover {
|
|
172
|
+
opacity: 1;
|
|
173
|
+
}
|
|
174
|
+
.pimolu-carousel__thumbnail:focus-visible {
|
|
175
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
176
|
+
outline-offset: 2px;
|
|
177
|
+
}
|
|
178
|
+
.pimolu-carousel__live {
|
|
179
|
+
position: absolute;
|
|
180
|
+
width: 1px;
|
|
181
|
+
height: 1px;
|
|
182
|
+
margin: -1px;
|
|
183
|
+
padding: 0;
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
clip: rect(0 0 0 0);
|
|
186
|
+
white-space: nowrap;
|
|
187
|
+
border: 0;
|
|
188
|
+
}
|
|
189
|
+
@media (prefers-reduced-motion: reduce) {
|
|
190
|
+
.pimolu-carousel__viewport[data-scroll=true] {
|
|
191
|
+
scroll-behavior: auto;
|
|
192
|
+
}
|
|
193
|
+
.pimolu-carousel__slide,
|
|
194
|
+
.pimolu-carousel__control,
|
|
195
|
+
.pimolu-carousel__dot::before,
|
|
196
|
+
.pimolu-carousel__thumbnail {
|
|
197
|
+
transition: none;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
@media (forced-colors: active) {
|
|
201
|
+
.pimolu-carousel__control {
|
|
202
|
+
border-color: CanvasText;
|
|
203
|
+
background: Canvas;
|
|
204
|
+
color: CanvasText;
|
|
205
|
+
box-shadow: none;
|
|
206
|
+
}
|
|
207
|
+
.pimolu-carousel__dot::before {
|
|
208
|
+
background: CanvasText;
|
|
209
|
+
}
|
|
210
|
+
.pimolu-carousel__dot[data-active=true]::before {
|
|
211
|
+
background: Highlight;
|
|
212
|
+
}
|
|
213
|
+
.pimolu-carousel__thumbnail {
|
|
214
|
+
border-color: CanvasText;
|
|
215
|
+
}
|
|
216
|
+
.pimolu-carousel__thumbnail[data-active=true] {
|
|
217
|
+
border-color: Highlight;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* src/thumbnail-carousel.css */
|
|
222
|
+
.pimolu-thumbnail-carousel .pimolu-carousel__viewport {
|
|
223
|
+
border-radius: calc(var(--pimolu-radius-lg, 14px) + 2px);
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
}
|
|
226
|
+
.pimolu-thumbnail-carousel .pimolu-carousel__slide img {
|
|
227
|
+
display: block;
|
|
228
|
+
width: 100%;
|
|
229
|
+
height: auto;
|
|
230
|
+
object-fit: cover;
|
|
231
|
+
}
|