@jrgermain/stylesheet 0.7.1 → 0.9.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.
Files changed (50) hide show
  1. package/README.md +2 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.css.map +1 -1
  4. package/package.json +5 -9
  5. package/src/styles/components/accordion.css +0 -136
  6. package/src/styles/components/alert.css +0 -12
  7. package/src/styles/components/app.css +0 -376
  8. package/src/styles/components/banner.css +0 -57
  9. package/src/styles/components/button.css +0 -357
  10. package/src/styles/components/card.css +0 -43
  11. package/src/styles/components/chip.css +0 -168
  12. package/src/styles/components/divider.css +0 -47
  13. package/src/styles/components/drawer.css +0 -107
  14. package/src/styles/components/field.css +0 -308
  15. package/src/styles/components/flex.css +0 -69
  16. package/src/styles/components/heading.css +0 -60
  17. package/src/styles/components/highlight.css +0 -39
  18. package/src/styles/components/link.css +0 -42
  19. package/src/styles/components/meter.css +0 -80
  20. package/src/styles/components/modal.css +0 -39
  21. package/src/styles/components/progress.css +0 -73
  22. package/src/styles/components/quote.css +0 -27
  23. package/src/styles/components/shared/base-alert.css +0 -96
  24. package/src/styles/components/shared/base-dialog.css +0 -142
  25. package/src/styles/components/shared/base-dismiss-button.css +0 -41
  26. package/src/styles/components/skeleton.css +0 -70
  27. package/src/styles/components/skip-link.css +0 -44
  28. package/src/styles/components/slider.css +0 -102
  29. package/src/styles/components/spinner.css +0 -79
  30. package/src/styles/components/switch.css +0 -90
  31. package/src/styles/components/table.css +0 -86
  32. package/src/styles/components/text.css +0 -132
  33. package/src/styles/components/visually-hidden.css +0 -13
  34. package/src/styles/index.css +0 -42
  35. package/src/styles/utils/reset.css +0 -29
  36. package/src/styles/utils/variables.css +0 -212
  37. package/src/svg/check-thick.svg +0 -4
  38. package/src/svg/check.svg +0 -4
  39. package/src/svg/dropdown-invert-thick.svg +0 -4
  40. package/src/svg/dropdown-invert.svg +0 -4
  41. package/src/svg/dropdown-thick.svg +0 -4
  42. package/src/svg/dropdown.svg +0 -4
  43. package/src/svg/external.svg +0 -4
  44. package/src/svg/info-thick.svg +0 -7
  45. package/src/svg/info.svg +0 -7
  46. package/src/svg/warning-thick.svg +0 -8
  47. package/src/svg/warning.svg +0 -8
  48. package/src/svg/x-circle.svg +0 -4
  49. package/src/svg/x-thick.svg +0 -4
  50. package/src/svg/x.svg +0 -4
@@ -1,376 +0,0 @@
1
- .app {
2
- /* The app is designed to take up the entire width of the page. However, we
3
- * set a global limit on the overall width of its content for UX and aesthetic
4
- * reasons. The wrapper elements of the page will always extend to the edge of
5
- * the screen, but all content within them will be kept within this limit and
6
- * centered.
7
- */
8
- --app-max-content-width: 110rem;
9
- --app-header-height: clamp(50px, 3.5rem, 70px);
10
- --app-sidebar-width: clamp(300px, 18rem, 400px);
11
-
12
- position: relative;
13
- width: 100%;
14
- min-height: 100svh;
15
- display: flex;
16
- flex-direction: column;
17
- font-family: var(--font-family-body);
18
- font-size: var(--font-size-m);
19
- }
20
-
21
- .app-header {
22
- height: var(--app-header-height);
23
- width: 100%;
24
- color: var(--color-brand-3);
25
- background-color: var(--color-body-alt);
26
- border-bottom: var(--border-l) solid var(--color-brand-transparent);
27
- box-shadow: var(--shadow-s);
28
- flex: none;
29
- position: sticky;
30
- left: 0;
31
- }
32
-
33
- .app-header-content {
34
- height: 100%;
35
- width: 100%;
36
- max-width: var(--app-max-content-width);
37
- margin-inline: auto;
38
- padding-inline: var(--space-body-x);
39
- display: flex;
40
- align-items: center;
41
- justify-content: space-between;
42
- gap: var(--space-s);
43
- }
44
-
45
- .app-header-section {
46
- margin: 0;
47
- height: 100%;
48
- display: flex;
49
- align-items: center;
50
-
51
- /* If header only has 1 section, center it */
52
- &:only-child {
53
- margin-inline: auto;
54
- }
55
-
56
- /* Otherwise, align the first to the left and the rest to the right */
57
- &:first-child {
58
- margin-inline-end: auto;
59
- }
60
-
61
- /*
62
- * The content of the first header item should be var(--space-body-x) from the
63
- * left edge of the app. Since there is var(--space-body-x) padding in the
64
- * header and var(--space-xs) padding in the header items, we just need to
65
- * move it back by var(--space-xs).
66
- */
67
- &:first-child .app-header-item:first-child {
68
- margin-inline-start: calc(-1 * var(--space-xs));
69
- }
70
-
71
- /*
72
- * The content of the last header item should be var(--space-body-x) from the
73
- * right edge of the app. Since there is var(--space-body-x) padding in the
74
- * header and var(--space-xs) padding in the header items, we just need to
75
- * move it forward by var(--space-xs).
76
- */
77
- &:last-child .app-header-item:last-child {
78
- margin-inline-end: calc(-1 * var(--space-xs));
79
- }
80
-
81
- /* Put a spacer between consecutive right-aligned sections (3rd onward) */
82
- &:nth-child(n + 3)::before {
83
- content: "";
84
- background-color: var(--color-outline);
85
- height: 2rem;
86
- width: var(--border-s);
87
- position: relative;
88
- right: calc(var(--space-s) / 2);
89
- }
90
- }
91
-
92
- .app-header-item {
93
- height: 100%;
94
- cursor: pointer;
95
- text-decoration: none;
96
- color: inherit;
97
- transition-property: color, background-color;
98
- transition-duration: var(--duration-short);
99
- transition-timing-function: var(--ease-default);
100
- display: flex;
101
- align-items: center;
102
- position: relative;
103
- font-weight: var(--font-weight-semibold);
104
- padding-inline: var(--space-xs);
105
- border-radius: var(--radius-m);
106
- border: var(--border-m) solid var(--color-body-alt);
107
-
108
- &:hover {
109
- background-color: var(--color-brand-extra-transparent);
110
- }
111
-
112
- &:active {
113
- background-color: var(--color-brand-transparent);
114
- }
115
-
116
- &:focus-visible {
117
- background-color: var(--color-brand-extra-transparent);
118
- outline-offset: calc(-1 * var(--border-m));
119
- }
120
-
121
- &:is([aria-current], .current) {
122
- font-weight: var(--font-weight-bold);
123
-
124
- &::after {
125
- opacity: 1;
126
- }
127
- }
128
-
129
- &::after {
130
- content: "";
131
- position: absolute;
132
- width: 100%;
133
- height: var(--border-l);
134
- bottom: calc(-1 * (var(--border-l) + var(--border-m)));
135
- left: 0;
136
- background-color: currentcolor;
137
- opacity: 0;
138
- border-radius: 1px;
139
- }
140
- }
141
-
142
- .app-body {
143
- position: relative;
144
- width: 100%;
145
- max-width: var(--app-max-content-width);
146
- margin-inline: auto;
147
- flex: none;
148
- display: flex;
149
- flex-direction: row;
150
- }
151
-
152
- .app-sidebar {
153
- transition-property: opacity, display;
154
- transition-duration: var(--duration-long);
155
- transition-timing-function: var(--ease-default);
156
- transition-behavior: allow-discrete;
157
- width: var(--app-sidebar-width);
158
- flex: none;
159
- opacity: 1;
160
- border-inline-end: var(--border-s) dashed var(--color-outline);
161
- }
162
-
163
- .app-sidebar-content {
164
- position: sticky;
165
- top: 0;
166
- overflow: auto;
167
- height: 100dvh;
168
- }
169
-
170
- .app-sidebar-section {
171
- &:first-of-type {
172
- margin-block-start: var(--space-body-y);
173
- }
174
-
175
- &:not(:last-of-type) {
176
- margin-block-end: var(--space-xs);
177
- }
178
-
179
- &:last-of-type {
180
- margin-block-end: var(--space-body-y);
181
- }
182
- }
183
-
184
- .app-sidebar-heading {
185
- font-size: 1.2rem;
186
- margin: 0 var(--space-body-x) var(--space-3xs);
187
- font-weight: var(--font-weight-semibold);
188
- }
189
-
190
- .app-sidebar-item {
191
- display: block;
192
- margin: 0 var(--space-2xs);
193
- padding: var(--space-2xs) calc(var(--space-body-x) - var(--space-2xs));
194
- border-radius: var(--radius-l);
195
- color: var(--color-body-text-alt);
196
- text-decoration: none;
197
- font-weight: var(--font-weight-normal);
198
- font-size: 1rem;
199
- user-select: none;
200
- transition-property: color, background-color, box-shadow;
201
- transition-duration: var(--duration-short);
202
- transition-timing-function: var(--ease-default);
203
-
204
- &:hover {
205
- background-color: var(--color-brand-extra-transparent);
206
- }
207
-
208
- &:active {
209
- color: var(--color-brand-1);
210
- }
211
-
212
- &:is([aria-current], .current) {
213
- color: var(--color-brand-4);
214
- font-weight: var(--font-weight-bold);
215
- }
216
-
217
- &:hover:active {
218
- background-color: var(--color-brand-transparent);
219
- }
220
-
221
- &:focus-visible {
222
- outline-offset: 0;
223
- background-color: var(--color-brand-extra-transparent);
224
- }
225
- }
226
-
227
- .app-sidebar-toggle {
228
- transition: background-color var(--duration-short) var(--ease-default);
229
- display: none;
230
- width: 2.75rem;
231
- margin-inline-start: 1rem;
232
-
233
- &:has(input:focus-visible) {
234
- background-color: var(--color-brand-extra-transparent);
235
- outline: var(--border-m) solid var(--color-brand-5);
236
- outline-offset: calc(-1 * var(--border-m));
237
- }
238
-
239
- /* Add vertical separator before button */
240
- &::before {
241
- content: "";
242
- position: absolute;
243
- top: 0;
244
- left: -0.5rem;
245
- height: 100%;
246
- width: var(--border-s);
247
- background-color: var(--color-outline);
248
- }
249
-
250
- /* Style the 3 lines inside the button */
251
- > div {
252
- transition-property: transform, opacity;
253
- transition-duration: var(--duration-medium);
254
- transition-timing-function: var(--ease-default);
255
- position: absolute;
256
- width: 1.75rem;
257
- height: 2px;
258
- border-radius: 2px;
259
- background-color: currentcolor;
260
- opacity: 1;
261
- top: 50%;
262
- left: 50%;
263
-
264
- &:nth-of-type(1) {
265
- transform: translateY(calc(-50% - 0.45rem)) translateX(-50%);
266
- }
267
-
268
- &:nth-of-type(2) {
269
- transform: translateY(-50%) translateX(-50%);
270
- }
271
-
272
- &:nth-of-type(3) {
273
- transform: translateY(calc(-50% + 0.45rem)) translateX(-50%);
274
- }
275
- }
276
-
277
- /* When the sidebar is visible, turn the 3 lines into an X */
278
- &:has(input:checked) > div {
279
- &:nth-of-type(1) {
280
- transform: translateY(-50%) translateX(-50%) rotate(45deg);
281
- }
282
-
283
- &:nth-of-type(2) {
284
- opacity: 0;
285
- transform: translateY(-50%) translateX(-50%) rotate3d(0, 1, 0, 90deg);
286
- }
287
-
288
- &:nth-of-type(3) {
289
- transform: translateY(-50%) translateX(-50%) rotate(-45deg);
290
- }
291
- }
292
- }
293
-
294
- .app-content {
295
- width: 100%;
296
- padding: var(--space-body-y) var(--space-body-x);
297
- position: relative;
298
- }
299
-
300
- /* If there's a sidebar, shrink the content area to accommodate it */
301
- .app-sidebar ~ .app-content {
302
- width: calc(100% - var(--app-sidebar-width));
303
- }
304
-
305
- @media (width < 55rem) {
306
- /*
307
- * If there's a sidebar, DON'T factor its width into the content width since
308
- * the sidebar now has `position: fixed`. This only applies to pages with a
309
- * sidebar; without one, app-content's width is already 100%.
310
- */
311
- .app-sidebar ~ .app-content {
312
- width: 100%;
313
- }
314
-
315
- .app-sidebar {
316
- position: fixed;
317
- top: var(--app-header-height);
318
- left: 0;
319
- width: 100vw;
320
- opacity: 1;
321
- background-color: light-dark(#fffc, #000a);
322
- backdrop-filter: blur(24px) saturate(120%);
323
- border-right: 0;
324
- z-index: 9;
325
-
326
- &::after {
327
- content: initial;
328
- }
329
- }
330
-
331
- .app-sidebar-toggle {
332
- display: initial;
333
- }
334
-
335
- .app-sidebar-content {
336
- height: calc(100dvh - var(--app-header-height));
337
- }
338
-
339
- .app:not(:has(.app-sidebar-toggle input:checked)) .app-sidebar {
340
- opacity: 0;
341
- display: none;
342
- }
343
-
344
- /* If sidebar is open, temporarily hide the overflow and any site-wide banners */
345
- .app:has(.app-sidebar-toggle input:checked) {
346
- overflow: hidden;
347
-
348
- > .banner {
349
- display: none;
350
- }
351
-
352
- .app-header {
353
- position: fixed;
354
- top: 0;
355
- z-index: 10;
356
- }
357
-
358
- .app-content {
359
- top: var(--app-header-height);
360
- }
361
- }
362
- }
363
-
364
- .app:has(dialog:modal) {
365
- /*
366
- * If modal is open, hide the overflow. This prevents the user from scrolling
367
- * the page down by dragging on the header, which they'd have no way to undo.
368
- */
369
- overflow: hidden;
370
- }
371
-
372
- @starting-style {
373
- .app > .sidebar {
374
- opacity: 0;
375
- }
376
- }
@@ -1,57 +0,0 @@
1
- .banner {
2
- border-inline-width: 0;
3
- width: 100%;
4
- padding: var(--space-xs) var(--space-body-x);
5
- padding-inline-start: calc(var(--space-body-x) + 2em);
6
-
7
- &:has(.button.dismiss) {
8
- padding-inline-end: calc(var(--space-body-x) + 2em);
9
- }
10
-
11
- &::before,
12
- &::after {
13
- inset-inline-start: calc(var(--space-body-x) * 0.5);
14
- }
15
-
16
- & + & {
17
- border-block-start-width: 0;
18
- }
19
-
20
- &.error {
21
- --banner-dismiss-icon-color: var(--color-red-4);
22
- --banner-dismiss-hover-bg: var(--color-red-extra-transparent);
23
- --banner-dismiss-focus-bg: var(--color-red-transparent);
24
- }
25
-
26
- &.warning {
27
- --banner-dismiss-icon-color: var(--color-yellow-4);
28
- --banner-dismiss-hover-bg: var(--color-yellow-extra-transparent);
29
- --banner-dismiss-focus-bg: var(--color-yellow-transparent);
30
- }
31
-
32
- &.success {
33
- --banner-dismiss-icon-color: var(--color-green-4);
34
- --banner-dismiss-hover-bg: var(--color-green-extra-transparent);
35
- --banner-dismiss-focus-bg: var(--color-green-transparent);
36
- }
37
-
38
- &.info {
39
- --banner-dismiss-icon-color: var(--color-sky-4);
40
- --banner-dismiss-hover-bg: var(--color-sky-extra-transparent);
41
- --banner-dismiss-focus-bg: var(--color-sky-transparent);
42
- }
43
-
44
- .button.dismiss {
45
- --button-fg-color: var(--banner-dismiss-icon-color);
46
- --button-hover-bg-color: var(--banner-dismiss-hover-bg);
47
-
48
- position: absolute;
49
- inset-block: 0;
50
- inset-inline-end: calc(var(--space-body-x) * 0.5);
51
- margin: auto;
52
-
53
- &:is(:focus-visible, .focus) {
54
- --button-bg-color: var(--banner-dismiss-focus-bg);
55
- }
56
- }
57
- }