@pimolu/web-styles 0.1.0-beta.3.1 → 0.1.0-beta.5

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,34 @@
1
+ /* src/motion.css */
2
+ :root {
3
+ --pimolu-interaction-duration: 150ms;
4
+ --pimolu-interaction-easing: ease-out;
5
+ }
6
+ :where(.pimolu-card, .pimolu-badge, .pimolu-avatar, .pimolu-table__row, .pimolu-command__item, .pimolu-toolbar__button, .pimolu-toolbar__link, .pimolu-navbar__item, .pimolu-navbar__toggle, .pimolu-accordion__trigger) {
7
+ transition:
8
+ background-color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
9
+ border-color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
10
+ color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
11
+ box-shadow var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out);
12
+ }
13
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *),
14
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *)::before,
15
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *)::after {
16
+ animation: none !important;
17
+ transition: none !important;
18
+ scroll-behavior: auto !important;
19
+ }
20
+ :where([data-pimolu-motion=off]) .pimolu-accordion__content[hidden] {
21
+ display: none !important;
22
+ }
23
+ @media (prefers-reduced-motion: reduce) {
24
+ :where([class^=pimolu-], [class*=" pimolu-"]),
25
+ :where([class^=pimolu-], [class*=" pimolu-"])::before,
26
+ :where([class^=pimolu-], [class*=" pimolu-"])::after {
27
+ animation: none !important;
28
+ transition: none !important;
29
+ scroll-behavior: auto !important;
30
+ }
31
+ .pimolu-accordion__content[hidden] {
32
+ display: none !important;
33
+ }
34
+ }
package/dist/navbar.css CHANGED
@@ -1,3 +1,258 @@
1
+ /* src/drawer.css */
2
+ .pimolu-drawer {
3
+ position: fixed;
4
+ inset: 0;
5
+ z-index: 50;
6
+ box-sizing: border-box;
7
+ overflow: hidden;
8
+ }
9
+ .pimolu-drawer__overlay {
10
+ position: absolute;
11
+ inset: 0;
12
+ background: rgba(15, 23, 42, 0.55);
13
+ }
14
+ .pimolu-drawer__content {
15
+ --pimolu-drawer-size: 24rem;
16
+ --pimolu-drawer-shift-x: 100%;
17
+ --pimolu-drawer-shift-y: 0%;
18
+ position: absolute;
19
+ z-index: 1;
20
+ box-sizing: border-box;
21
+ max-width: 100%;
22
+ max-height: 100%;
23
+ padding: var(--pimolu-spacing-6, 24px);
24
+ overflow-y: auto;
25
+ overscroll-behavior: contain;
26
+ background: var( --pimolu-surface, var(--pimolu-background) );
27
+ color: var( --pimolu-surface-foreground, var(--pimolu-foreground) );
28
+ border: var(--pimolu-control-border-width, 1px) solid var(--pimolu-border);
29
+ box-shadow: var(--pimolu-shadow-raised, none);
30
+ -webkit-backdrop-filter: blur(var(--pimolu-glass-blur, 18px));
31
+ backdrop-filter: blur(var(--pimolu-glass-blur, 18px));
32
+ font-family: var(--pimolu-font-body, inherit);
33
+ font-size: 0.875rem;
34
+ line-height: 1.5;
35
+ outline: none;
36
+ }
37
+ .pimolu-drawer__content--right {
38
+ top: 0;
39
+ right: 0;
40
+ bottom: 0;
41
+ width: min(100%, var(--pimolu-drawer-size));
42
+ border-top-left-radius: var( --pimolu-radius-lg, 12px );
43
+ border-bottom-left-radius: var( --pimolu-radius-lg, 12px );
44
+ --pimolu-drawer-shift-x: 100%;
45
+ --pimolu-drawer-shift-y: 0%;
46
+ }
47
+ .pimolu-drawer__content--left {
48
+ top: 0;
49
+ left: 0;
50
+ bottom: 0;
51
+ width: min(100%, var(--pimolu-drawer-size));
52
+ border-top-right-radius: var( --pimolu-radius-lg, 12px );
53
+ border-bottom-right-radius: var( --pimolu-radius-lg, 12px );
54
+ --pimolu-drawer-shift-x: -100%;
55
+ --pimolu-drawer-shift-y: 0%;
56
+ }
57
+ .pimolu-drawer__content--top {
58
+ top: 0;
59
+ right: 0;
60
+ left: 0;
61
+ height: min(100%, var(--pimolu-drawer-size));
62
+ border-bottom-right-radius: var( --pimolu-radius-lg, 12px );
63
+ border-bottom-left-radius: var( --pimolu-radius-lg, 12px );
64
+ --pimolu-drawer-shift-x: 0%;
65
+ --pimolu-drawer-shift-y: -100%;
66
+ }
67
+ .pimolu-drawer__content--bottom {
68
+ right: 0;
69
+ bottom: 0;
70
+ left: 0;
71
+ height: min(100%, var(--pimolu-drawer-size));
72
+ border-top-left-radius: var( --pimolu-radius-lg, 12px );
73
+ border-top-right-radius: var( --pimolu-radius-lg, 12px );
74
+ --pimolu-drawer-shift-x: 0%;
75
+ --pimolu-drawer-shift-y: 100%;
76
+ }
77
+ .pimolu-drawer__content--sm {
78
+ --pimolu-drawer-size: 20rem;
79
+ }
80
+ .pimolu-drawer__content--md {
81
+ --pimolu-drawer-size: 24rem;
82
+ }
83
+ .pimolu-drawer__content--lg {
84
+ --pimolu-drawer-size: 32rem;
85
+ }
86
+ .pimolu-drawer__header {
87
+ display: grid;
88
+ gap: 6px;
89
+ min-width: 0;
90
+ margin-block-end: var( --pimolu-spacing-4, 16px );
91
+ }
92
+ .pimolu-drawer__content[data-close-button=true] .pimolu-drawer__header {
93
+ padding-inline-end: var( --pimolu-spacing-8, 32px );
94
+ }
95
+ .pimolu-drawer__title {
96
+ margin: 0;
97
+ color: inherit;
98
+ font-family: var( --pimolu-font-heading, inherit );
99
+ font-size: 1.25rem;
100
+ font-weight: 600;
101
+ line-height: 1.3;
102
+ overflow-wrap: anywhere;
103
+ }
104
+ .pimolu-drawer__description {
105
+ margin: 0;
106
+ color: var(--pimolu-muted-foreground);
107
+ font-size: 0.875rem;
108
+ line-height: 1.5;
109
+ overflow-wrap: anywhere;
110
+ }
111
+ .pimolu-drawer__footer {
112
+ display: flex;
113
+ align-items: center;
114
+ justify-content: flex-end;
115
+ flex-wrap: wrap;
116
+ gap: var(--pimolu-spacing-3, 12px);
117
+ margin-block-start: var( --pimolu-spacing-6, 24px );
118
+ }
119
+ .pimolu-drawer__close {
120
+ position: absolute;
121
+ inset-block-start: 12px;
122
+ inset-inline-end: 12px;
123
+ display: inline-grid;
124
+ place-items: center;
125
+ box-sizing: border-box;
126
+ width: 32px;
127
+ height: 32px;
128
+ padding: 0;
129
+ border: 0;
130
+ border-radius: var(--pimolu-radius-sm, 4px);
131
+ background: transparent;
132
+ color: var(--pimolu-muted-foreground);
133
+ line-height: 0;
134
+ cursor: pointer;
135
+ }
136
+ .pimolu-drawer__close:hover {
137
+ background: var(--pimolu-muted);
138
+ color: var(--pimolu-foreground);
139
+ }
140
+ .pimolu-drawer__close:focus-visible {
141
+ outline: 2px solid var(--pimolu-focus-ring, currentColor);
142
+ outline-offset: 2px;
143
+ }
144
+ .pimolu-drawer[data-state=open] .pimolu-drawer__overlay {
145
+ animation: pimolu-drawer-overlay-in 180ms ease-out;
146
+ }
147
+ .pimolu-drawer[data-state=closing] .pimolu-drawer__overlay {
148
+ animation: pimolu-drawer-overlay-out 180ms ease-in forwards;
149
+ }
150
+ .pimolu-drawer[data-state=open] .pimolu-drawer__content {
151
+ animation: pimolu-drawer-content-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
152
+ }
153
+ .pimolu-drawer[data-state=closing] .pimolu-drawer__content {
154
+ animation: pimolu-drawer-content-out 180ms ease-in forwards;
155
+ }
156
+ @keyframes pimolu-drawer-overlay-in {
157
+ from {
158
+ opacity: 0;
159
+ }
160
+ to {
161
+ opacity: 1;
162
+ }
163
+ }
164
+ @keyframes pimolu-drawer-overlay-out {
165
+ from {
166
+ opacity: 1;
167
+ }
168
+ to {
169
+ opacity: 0;
170
+ }
171
+ }
172
+ @keyframes pimolu-drawer-content-in {
173
+ from {
174
+ opacity: 0;
175
+ transform: translate(var(--pimolu-drawer-shift-x), var(--pimolu-drawer-shift-y));
176
+ }
177
+ to {
178
+ opacity: 1;
179
+ transform: translate(0, 0);
180
+ }
181
+ }
182
+ @keyframes pimolu-drawer-content-out {
183
+ from {
184
+ opacity: 1;
185
+ transform: translate(0, 0);
186
+ }
187
+ to {
188
+ opacity: 0;
189
+ transform: translate(var(--pimolu-drawer-shift-x), var(--pimolu-drawer-shift-y));
190
+ }
191
+ }
192
+ @media (max-width: 600px) {
193
+ .pimolu-drawer__content {
194
+ padding: var(--pimolu-spacing-4, 16px);
195
+ }
196
+ }
197
+ @media (prefers-reduced-motion: reduce) {
198
+ .pimolu-drawer[data-state=open] .pimolu-drawer__overlay,
199
+ .pimolu-drawer[data-state=closing] .pimolu-drawer__overlay,
200
+ .pimolu-drawer[data-state=open] .pimolu-drawer__content,
201
+ .pimolu-drawer[data-state=closing] .pimolu-drawer__content {
202
+ animation: none;
203
+ }
204
+ }
205
+ @media (forced-colors: active) {
206
+ .pimolu-drawer__overlay {
207
+ background: CanvasText;
208
+ opacity: 0.5;
209
+ }
210
+ .pimolu-drawer__content {
211
+ border: 1px solid CanvasText;
212
+ background: Canvas;
213
+ color: CanvasText;
214
+ box-shadow: none;
215
+ }
216
+ .pimolu-drawer__close:focus-visible {
217
+ outline-color: Highlight;
218
+ }
219
+ }
220
+
221
+ /* src/motion.css */
222
+ :root {
223
+ --pimolu-interaction-duration: 150ms;
224
+ --pimolu-interaction-easing: ease-out;
225
+ }
226
+ :where(.pimolu-card, .pimolu-badge, .pimolu-avatar, .pimolu-table__row, .pimolu-command__item, .pimolu-toolbar__button, .pimolu-toolbar__link, .pimolu-navbar__item, .pimolu-navbar__toggle, .pimolu-accordion__trigger) {
227
+ transition:
228
+ background-color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
229
+ border-color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
230
+ color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
231
+ box-shadow var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out);
232
+ }
233
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *),
234
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *)::before,
235
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *)::after {
236
+ animation: none !important;
237
+ transition: none !important;
238
+ scroll-behavior: auto !important;
239
+ }
240
+ :where([data-pimolu-motion=off]) .pimolu-accordion__content[hidden] {
241
+ display: none !important;
242
+ }
243
+ @media (prefers-reduced-motion: reduce) {
244
+ :where([class^=pimolu-], [class*=" pimolu-"]),
245
+ :where([class^=pimolu-], [class*=" pimolu-"])::before,
246
+ :where([class^=pimolu-], [class*=" pimolu-"])::after {
247
+ animation: none !important;
248
+ transition: none !important;
249
+ scroll-behavior: auto !important;
250
+ }
251
+ .pimolu-accordion__content[hidden] {
252
+ display: none !important;
253
+ }
254
+ }
255
+
1
256
  /* src/navbar.css */
2
257
  .pimolu-navbar {
3
258
  box-sizing: border-box;
@@ -235,6 +490,76 @@
235
490
  .pimolu-navbar--transparent {
236
491
  background: transparent;
237
492
  }
493
+ .pimolu-navbar__menu {
494
+ display: contents;
495
+ }
496
+ @container pimolu-navbar (max-width: 700px) {
497
+ .pimolu-navbar[data-collapsible=true][data-open=true] .pimolu-navbar__content,
498
+ .pimolu-navbar[data-collapsible=true][data-open=true] .pimolu-navbar__actions {
499
+ animation: pimolu-navbar-reveal 180ms cubic-bezier(0.16, 1, 0.3, 1);
500
+ }
501
+ }
502
+ @keyframes pimolu-navbar-reveal {
503
+ from {
504
+ opacity: 0;
505
+ transform: translateY(-4px);
506
+ }
507
+ to {
508
+ opacity: 1;
509
+ transform: translateY(0);
510
+ }
511
+ }
512
+ .pimolu-navbar__menu-panel {
513
+ display: flex;
514
+ flex-direction: column;
515
+ gap: var(--pimolu-spacing-4, 16px);
516
+ padding-top: max(var(--pimolu-spacing-6, 24px), env(safe-area-inset-top));
517
+ padding-bottom: max(var(--pimolu-spacing-6, 24px), env(safe-area-inset-bottom));
518
+ }
519
+ .pimolu-navbar__menu-panel .pimolu-navbar__content {
520
+ display: flex;
521
+ flex-direction: column;
522
+ align-items: stretch;
523
+ gap: var(--pimolu-spacing-1, 4px);
524
+ width: 100%;
525
+ order: initial;
526
+ overflow: visible;
527
+ }
528
+ .pimolu-navbar__menu-panel .pimolu-navbar__item {
529
+ width: 100%;
530
+ min-height: 44px;
531
+ white-space: normal;
532
+ }
533
+ .pimolu-navbar__menu-panel .pimolu-navbar__actions {
534
+ display: flex;
535
+ width: 100%;
536
+ margin-inline-start: 0;
537
+ padding-block-start: var(--pimolu-spacing-4, 16px);
538
+ border-block-start: 1px solid var(--pimolu-border);
539
+ }
540
+ .pimolu-navbar__menu-panel .pimolu-drawer__header {
541
+ padding-inline-end: 48px;
542
+ }
543
+ .pimolu-navbar__menu-panel .pimolu-drawer__close {
544
+ z-index: 2;
545
+ width: 44px;
546
+ height: 44px;
547
+ color: var(--pimolu-foreground);
548
+ border: 1px solid var(--pimolu-border);
549
+ background: var(--pimolu-muted);
550
+ }
551
+ .pimolu-drawer__content.pimolu-navbar__menu-panel--full {
552
+ inset: 0;
553
+ width: 100%;
554
+ height: 100%;
555
+ border-radius: 0;
556
+ }
557
+ .pimolu-navbar__menu-layer--instant,
558
+ .pimolu-navbar__menu-layer--instant .pimolu-drawer__overlay,
559
+ .pimolu-navbar__menu-layer--instant.pimolu-drawer__content {
560
+ animation: none !important;
561
+ transition: none !important;
562
+ }
238
563
  .pimolu-navbar--floating {
239
564
  border: var(--pimolu-control-border-width, 1px) solid var(--pimolu-border);
240
565
  border-radius: var(--pimolu-radius-lg);
@@ -63,6 +63,11 @@
63
63
  color: var(--pimolu-muted-foreground);
64
64
  opacity: 1;
65
65
  }
66
+ .pimolu-input__control:is(:autofill, :-webkit-autofill) {
67
+ -webkit-background-clip: text;
68
+ background-clip: text;
69
+ -webkit-text-fill-color: var(--pimolu-foreground);
70
+ }
66
71
  .pimolu-input__control::-webkit-search-cancel-button,
67
72
  .pimolu-input__control::-webkit-search-decoration {
68
73
  -webkit-appearance: none;
@@ -251,6 +256,11 @@
251
256
  }
252
257
  }
253
258
  @media (forced-colors: active) {
259
+ .pimolu-input__control:is(:autofill, :-webkit-autofill) {
260
+ -webkit-background-clip: border-box;
261
+ background-clip: border-box;
262
+ -webkit-text-fill-color: CanvasText;
263
+ }
254
264
  .pimolu-input__wrapper:focus-within {
255
265
  outline: 2px solid Highlight;
256
266
  outline-offset: 2px;