@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.
@@ -0,0 +1,238 @@
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/coverflow-carousel.css */
222
+ .pimolu-coverflow-carousel .pimolu-carousel__viewport {
223
+ height: clamp(240px, 42vw, 380px);
224
+ perspective: 1200px;
225
+ transform-style: preserve-3d;
226
+ }
227
+ .pimolu-coverflow-carousel .pimolu-carousel__slide {
228
+ position: absolute;
229
+ inset-block: 0;
230
+ inset-inline-start: 50%;
231
+ width: min(62%, 520px);
232
+ margin-inline-start: calc(min(62%, 520px) / -2);
233
+ transform-origin: center center;
234
+ backface-visibility: hidden;
235
+ }
236
+ .pimolu-coverflow-carousel .pimolu-carousel__slide[data-active=true] {
237
+ z-index: 10;
238
+ }