@anyblades/blades 3.1.0-alpha.1 → 3.1.0-beta.2

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 (108) hide show
  1. package/README.md +78 -3
  2. package/css/blades.css +371 -978
  3. package/css/blades.min.css +74 -37
  4. package/css/blades.ninja.css +4057 -0
  5. package/css/blades.ninja.min.css +190 -0
  6. package/css/float-label.css +207 -0
  7. package/css/float-label.min.css +55 -0
  8. package/css/{pico.layered.css → layered/blades.layered.css} +654 -397
  9. package/css/layered/blades.layered.min.css +184 -0
  10. package/css/layered/compact.css +54 -0
  11. package/css/layered/components/accordion.css +85 -0
  12. package/css/layered/components/card.css +48 -0
  13. package/css/layered/components/dropdown.css +191 -0
  14. package/css/layered/components/group.css +208 -0
  15. package/css/layered/components/loading.css +43 -0
  16. package/css/layered/components/modal.css +158 -0
  17. package/css/layered/components/nav.css +117 -0
  18. package/css/layered/components/progress.css +76 -0
  19. package/css/layered/components/tooltip.css +176 -0
  20. package/css/layered/components.css +1082 -0
  21. package/css/layered/content/button.css +208 -0
  22. package/css/layered/content/code.css +64 -0
  23. package/css/layered/content/embedded-content.css +41 -0
  24. package/css/layered/content/figure.css +15 -0
  25. package/css/layered/content/link.css +84 -0
  26. package/css/layered/content/misc.css +22 -0
  27. package/css/layered/content/table.css +33 -0
  28. package/css/layered/content/typography.css +159 -0
  29. package/css/layered/content.css +611 -0
  30. package/css/layered/forms/basics.css +338 -0
  31. package/css/layered/forms/checkbox-radio-switch.css +164 -0
  32. package/css/layered/forms/input-color.css +20 -0
  33. package/css/layered/forms/input-datetime.css +57 -0
  34. package/css/layered/forms/input-file.css +29 -0
  35. package/css/layered/forms/input-range.css +121 -0
  36. package/css/layered/forms/input-search.css +66 -0
  37. package/css/layered/forms.css +778 -0
  38. package/css/layered/layout/container.css +42 -0
  39. package/css/layered/layout/document.css +48 -0
  40. package/css/layered/layout/grid.css +22 -0
  41. package/css/layered/layout/landmarks.css +12 -0
  42. package/css/layered/layout/overflow-auto.css +9 -0
  43. package/css/layered/layout/section.css +9 -0
  44. package/css/layered/layout.css +119 -0
  45. package/css/layered/utilities.css +35 -0
  46. package/css/layered/variables.css +365 -0
  47. package/css/pico.conditional.css +229 -396
  48. package/css/pico.conditional.min.css +42 -31
  49. package/css/pico.css +229 -396
  50. package/css/pico.min.css +42 -31
  51. package/package.json +24 -11
  52. package/src/_compact.css +51 -0
  53. package/src/blades/_index.css +23 -0
  54. package/src/blades/float-label/_index.css +2 -0
  55. package/src/{standalone/forms/_float-label.theme.css → blades/float-label/_theme.css} +5 -1
  56. package/src/blades.css +3 -2
  57. package/src/blades.ninja.css +3 -0
  58. package/src/float-label.css +1 -0
  59. package/src/ninja/_index.css +19 -0
  60. package/src/{standalone → ninja}/_theme.css +0 -2
  61. package/src/{ninja.css → ninja/_utilities.css} +55 -6
  62. package/src/pico/_variables.css +77 -386
  63. package/src/pico/components/_accordion.css +8 -0
  64. package/src/pico/components/_card.css +14 -0
  65. package/src/pico/components/_dropdown.css +9 -0
  66. package/src/pico/components/_group.css +38 -0
  67. package/src/pico/components/_loading.css +9 -0
  68. package/src/pico/components/_modal.css +13 -0
  69. package/src/pico/components/_nav.css +6 -0
  70. package/src/pico/components/_progress.css +6 -0
  71. package/src/pico/components/_tooltip.css +6 -0
  72. package/src/pico/content/_button.css +1 -1
  73. package/src/pico/forms/_checkbox-radio-switch.css +13 -0
  74. package/src/pico/forms/_input-datetime.css +6 -0
  75. package/src/pico/forms/_input-range.css +9 -0
  76. package/src/pico/forms/_input-search.css +5 -0
  77. package/src/pico/layout/_document.css +9 -0
  78. package/src/pico/layout/_index.css +0 -1
  79. package/src/pico/layout/_landmarks.css +1 -9
  80. package/src/pico.css +1 -0
  81. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -25
  82. package/.github/ISSUE_TEMPLATE/config.yml +0 -8
  83. package/.prettierignore +0 -3
  84. package/CODE_OF_CONDUCT.md +0 -92
  85. package/context7.json +0 -4
  86. package/css/blades.standalone.css +0 -860
  87. package/css/blades.standalone.min.css +0 -37
  88. package/css/ninja.css +0 -83
  89. package/css/ninja.min.css +0 -5
  90. package/css/pico.layered.min.css +0 -107
  91. package/css/postcss.config.js +0 -23
  92. package/index.html +0 -63
  93. package/src/blades.standalone.css +0 -2
  94. package/src/standalone/_core.css +0 -32
  95. package/src/standalone/_utilities.css +0 -55
  96. package/src/standalone/forms/_float-label.css +0 -2
  97. /package/src/{standalone/content → blades}/_code.css +0 -0
  98. /package/src/{standalone/layout → blades}/_columns.css +0 -0
  99. /package/src/{standalone/components/_icon-helper.css → blades/_icon.css} +0 -0
  100. /package/src/{standalone/components → blades}/_timeline.css +0 -0
  101. /package/src/{standalone → blades}/_variables.css +0 -0
  102. /package/src/{standalone/forms/_float-label.core.css → blades/float-label/_core.css} +0 -0
  103. /package/src/{standalone/layout/_breakout.css → ninja/_container-breakout.css} +0 -0
  104. /package/src/{standalone/content/_typography.css → ninja/_heading-anchor.css} +0 -0
  105. /package/src/{standalone/content/_list.css → ninja/_list-helpers.css} +0 -0
  106. /package/src/{standalone/layout/_scroller.css → ninja/_page-anchors.css} +0 -0
  107. /package/src/{standalone/content/_table.css → ninja/_table-helpers.css} +0 -0
  108. /package/src/{standalone/content → ninja}/_table-responsive.css +0 -0
package/css/blades.css CHANGED
@@ -37,24 +37,10 @@
37
37
  --pico-grid-row-gap: var(--pico-spacing);
38
38
  --pico-form-element-spacing-vertical: 0.75rem;
39
39
  --pico-form-element-spacing-horizontal: 1rem;
40
- --pico-group-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
41
- --pico-group-box-shadow-focus-with-button: 0 0 0 var(--pico-outline-width)
42
- var(--pico-primary-focus);
43
- --pico-group-box-shadow-focus-with-input: 0 0 0 0.0625rem var(--pico-form-element-border-color);
44
- --pico-modal-overlay-backdrop-filter: blur(0.375rem);
45
40
  --pico-nav-element-spacing-vertical: 1rem;
46
- --pico-nav-element-spacing-horizontal: 0.5rem;
47
41
  --pico-nav-link-spacing-vertical: 0.5rem;
48
42
  --pico-nav-link-spacing-horizontal: 0.5rem;
49
- --pico-nav-breadcrumb-divider: ">";
50
- --pico-icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
51
- --pico-icon-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
52
43
  --pico-icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
53
- --pico-icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
54
- --pico-icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
55
- --pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
56
- --pico-icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
57
- --pico-icon-loading: url("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgb(136, 145, 164)' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E");
58
44
  }
59
45
  @media (min-width: 576px) {
60
46
  :scope,
@@ -200,36 +186,6 @@ nav details.dropdown summary:focus-visible {
200
186
  --pico-border-radius: 5rem;
201
187
  }
202
188
 
203
- [role="search"]:has(
204
- button.secondary:focus,
205
- [type="submit"].secondary:focus,
206
- [type="button"].secondary:focus,
207
- [role="button"].secondary:focus
208
- ),
209
- [role="group"]:has(
210
- button.secondary:focus,
211
- [type="submit"].secondary:focus,
212
- [type="button"].secondary:focus,
213
- [role="button"].secondary:focus
214
- ) {
215
- --pico-group-box-shadow-focus-with-button: 0 0 0 var(--pico-outline-width)
216
- var(--pico-secondary-focus);
217
- }
218
- [role="search"]:has(
219
- button.contrast:focus,
220
- [type="submit"].contrast:focus,
221
- [type="button"].contrast:focus,
222
- [role="button"].contrast:focus
223
- ),
224
- [role="group"]:has(
225
- button.contrast:focus,
226
- [type="submit"].contrast:focus,
227
- [type="button"].contrast:focus,
228
- [role="button"].contrast:focus
229
- ) {
230
- --pico-group-box-shadow-focus-with-button: 0 0 0 var(--pico-outline-width)
231
- var(--pico-contrast-focus);
232
- }
233
189
  [role="search"] button,
234
190
  [role="search"] [type="submit"],
235
191
  [role="search"] [type="button"],
@@ -257,273 +213,122 @@ details summary[role="button"]:not(.outline)::after {
257
213
 
258
214
  /**
259
215
  * Color schemes
216
+ * One palette for both schemes: light-dark() picks the value from the used color-scheme,
217
+ * so the dark scheme only has to switch color-scheme (same selectors as before).
260
218
  */
219
+ :scope,
220
+ :host,
261
221
  [data-theme="light"],
262
- :scope:not([data-theme="dark"]),
263
- :host(:not([data-theme="dark"])) {
222
+ [data-theme="dark"] {
264
223
  color-scheme: light;
265
- --pico-background-color: #fff;
266
- --pico-color: #373c44;
267
- --pico-text-selection-color: rgba(2, 154, 232, 0.25);
268
- --pico-muted-color: #646b79;
269
- --pico-muted-border-color: rgb(231, 234, 239.5);
270
- --pico-primary: #0172ad;
224
+ --pico-background-color: light-dark(#fff, rgb(19, 22.5, 30.5));
225
+ --pico-color: light-dark(#373c44, #c2c7d0);
226
+ --pico-text-selection-color: light-dark(rgba(2, 154, 232, 0.25), rgba(1, 170, 255, 0.1875));
227
+ --pico-muted-color: light-dark(#646b79, #7b8495);
228
+ --pico-muted-border-color: light-dark(rgb(231, 234, 239.5), #202632);
229
+ --pico-primary: light-dark(#0172ad, #01aaff);
271
230
  --pico-primary-background: #0172ad;
272
231
  --pico-primary-border: var(--pico-primary-background);
273
- --pico-primary-underline: rgba(1, 114, 173, 0.5);
274
- --pico-primary-hover: #015887;
275
- --pico-primary-hover-background: #02659a;
232
+ --pico-primary-underline: light-dark(rgba(1, 114, 173, 0.5), rgba(1, 170, 255, 0.5));
233
+ --pico-primary-hover: light-dark(#015887, #79c0ff);
234
+ --pico-primary-hover-background: light-dark(#02659a, #017fc0);
276
235
  --pico-primary-hover-border: var(--pico-primary-hover-background);
277
236
  --pico-primary-hover-underline: var(--pico-primary-hover);
278
- --pico-primary-focus: rgba(2, 154, 232, 0.5);
237
+ /* Focus rings are opaque: at 25–50% alpha they composite below 3:1 (SC 1.4.11), see #167 */
238
+ --pico-primary-focus: light-dark(rgb(2, 138, 212), rgb(1, 170, 255));
279
239
  --pico-primary-inverse: #fff;
280
- --pico-secondary: #5d6b89;
240
+ --pico-secondary: light-dark(#5d6b89, #969eaf);
281
241
  --pico-secondary-background: #525f7a;
282
242
  --pico-secondary-border: var(--pico-secondary-background);
283
- --pico-secondary-underline: rgba(93, 107, 137, 0.5);
284
- --pico-secondary-hover: #48536b;
285
- --pico-secondary-hover-background: #48536b;
243
+ --pico-secondary-underline: light-dark(rgba(93, 107, 137, 0.5), rgba(150, 158, 175, 0.5));
244
+ --pico-secondary-hover: light-dark(#48536b, #b3b9c5);
245
+ --pico-secondary-hover-background: light-dark(#48536b, #5d6b89);
286
246
  --pico-secondary-hover-border: var(--pico-secondary-hover-background);
287
247
  --pico-secondary-hover-underline: var(--pico-secondary-hover);
288
- --pico-secondary-focus: rgba(93, 107, 137, 0.25);
248
+ --pico-secondary-focus: light-dark(rgb(93, 107, 137), rgb(144, 158, 190));
289
249
  --pico-secondary-inverse: #fff;
290
- --pico-contrast: #181c25;
291
- --pico-contrast-background: #181c25;
250
+ --pico-contrast: light-dark(#181c25, #dfe3eb);
251
+ --pico-contrast-background: light-dark(#181c25, #eff1f4);
292
252
  --pico-contrast-border: var(--pico-contrast-background);
293
- --pico-contrast-underline: rgba(24, 28, 37, 0.5);
294
- --pico-contrast-hover: #000;
295
- --pico-contrast-hover-background: #000;
253
+ --pico-contrast-underline: light-dark(rgba(24, 28, 37, 0.5), rgba(223, 227, 235, 0.5));
254
+ --pico-contrast-hover: light-dark(#000, #fff);
255
+ --pico-contrast-hover-background: light-dark(#000, #fff);
296
256
  --pico-contrast-hover-border: var(--pico-contrast-hover-background);
297
- --pico-contrast-hover-underline: var(--pico-secondary-hover);
298
- --pico-contrast-focus: rgba(93, 107, 137, 0.25);
299
- --pico-contrast-inverse: #fff;
300
- --pico-box-shadow: 0 0.5rem 2.5rem rgba(129, 145, 181, 0.2);
301
- --pico-h1-color: #2d3138;
302
- --pico-h2-color: #373c44;
303
- --pico-h3-color: #424751;
304
- --pico-h4-color: #4d535e;
305
- --pico-h5-color: #5c6370;
306
- --pico-h6-color: #646b79;
307
- --pico-mark-background-color: rgb(252.5, 230.5, 191.5);
308
- --pico-mark-color: #0f1114;
309
- --pico-ins-color: rgb(28.5, 105.5, 84);
310
- --pico-del-color: rgb(136, 56.5, 53);
257
+ --pico-contrast-hover-underline: light-dark(
258
+ var(--pico-secondary-hover),
259
+ var(--pico-contrast-hover)
260
+ );
261
+ --pico-contrast-focus: light-dark(rgb(93, 107, 137), rgb(207, 213, 226));
262
+ --pico-contrast-inverse: light-dark(#fff, #000);
263
+ --pico-box-shadow: 0 0.5rem 2.5rem light-dark(rgba(129, 145, 181, 0.2), rgba(7, 8.5, 12, 0.2));
264
+ --pico-h1-color: light-dark(#2d3138, #f0f1f3);
265
+ --pico-h2-color: light-dark(#373c44, #e0e3e7);
266
+ --pico-h3-color: light-dark(#424751, #c2c7d0);
267
+ --pico-h4-color: light-dark(#4d535e, #b3b9c5);
268
+ --pico-h5-color: light-dark(#5c6370, #a4acba);
269
+ --pico-h6-color: light-dark(#646b79, #8891a4);
270
+ --pico-mark-background-color: light-dark(rgb(252.5, 230.5, 191.5), #014063);
271
+ --pico-mark-color: light-dark(#0f1114, #fff);
272
+ --pico-ins-color: light-dark(rgb(28.5, 105.5, 84), #62af9a);
273
+ --pico-del-color: light-dark(rgb(136, 56.5, 53), rgb(205.5, 126, 123));
311
274
  --pico-blockquote-border-color: var(--pico-muted-border-color);
312
275
  --pico-blockquote-footer-color: var(--pico-muted-color);
313
276
  --pico-button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
314
277
  --pico-button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
315
278
  --pico-table-border-color: var(--pico-muted-border-color);
316
279
  --pico-table-row-stripped-background-color: rgba(111, 120, 135, 0.0375);
317
- --pico-code-background-color: rgb(243, 244.5, 246.75);
318
- --pico-code-color: #646b79;
280
+ --pico-code-background-color: light-dark(rgb(243, 244.5, 246.75), rgb(26, 30.5, 40.25));
281
+ --pico-code-color: light-dark(#646b79, #8891a4);
319
282
  --pico-code-kbd-background-color: var(--pico-color);
320
283
  --pico-code-kbd-color: var(--pico-background-color);
321
- --pico-form-element-background-color: rgb(251, 251.5, 252.25);
322
- --pico-form-element-selected-background-color: #dfe3eb;
323
- --pico-form-element-border-color: #cfd5e2;
324
- --pico-form-element-color: #23262c;
325
- --pico-form-element-placeholder-color: var(--pico-muted-color);
326
- --pico-form-element-active-background-color: #fff;
284
+ --pico-form-element-background-color: light-dark(rgb(251, 251.5, 252.25), rgb(28, 33, 43.5));
285
+ --pico-form-element-selected-background-color: light-dark(#dfe3eb, #2a3140);
286
+ --pico-form-element-border-color: light-dark(#cfd5e2, #2a3140);
287
+ --pico-form-element-color: light-dark(#23262c, #e0e3e7);
288
+ --pico-form-element-placeholder-color: light-dark(var(--pico-muted-color), #8891a4);
289
+ --pico-form-element-active-background-color: light-dark(#fff, rgb(26, 30.5, 40.25));
327
290
  --pico-form-element-active-border-color: var(--pico-primary-border);
328
291
  --pico-form-element-focus-color: var(--pico-primary-border);
329
292
  --pico-form-element-disabled-opacity: 0.5;
330
- --pico-form-element-invalid-border-color: rgb(183.5, 105.5, 106.5);
331
- --pico-form-element-invalid-active-border-color: rgb(200.25, 79.25, 72.25);
293
+ --pico-form-element-invalid-border-color: light-dark(
294
+ rgb(183.5, 105.5, 106.5),
295
+ rgb(200.25, 79.25, 72.25)
296
+ );
297
+ --pico-form-element-invalid-active-border-color: light-dark(
298
+ rgb(200.25, 79.25, 72.25),
299
+ rgb(214, 92, 86)
300
+ );
332
301
  --pico-form-element-invalid-focus-color: var(--pico-form-element-invalid-active-border-color);
333
- --pico-form-element-valid-border-color: rgb(76, 154.5, 137.5);
334
- --pico-form-element-valid-active-border-color: rgb(39, 152.75, 118.75);
302
+ --pico-form-element-valid-border-color: light-dark(rgb(76, 154.5, 137.5), #2a7b6f);
303
+ --pico-form-element-valid-active-border-color: light-dark(
304
+ rgb(39, 152.75, 118.75),
305
+ rgb(22, 137, 105.5)
306
+ );
335
307
  --pico-form-element-valid-focus-color: var(--pico-form-element-valid-active-border-color);
336
- --pico-switch-background-color: #bfc7d9;
337
- --pico-switch-checked-background-color: var(--pico-primary-background);
338
- --pico-switch-color: #fff;
339
- --pico-switch-thumb-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
340
- --pico-range-border-color: #dfe3eb;
341
- --pico-range-active-border-color: #bfc7d9;
342
- --pico-range-thumb-border-color: var(--pico-background-color);
343
- --pico-range-thumb-color: var(--pico-secondary-background);
344
- --pico-range-thumb-active-color: var(--pico-primary-background);
345
- --pico-accordion-border-color: var(--pico-muted-border-color);
346
- --pico-accordion-active-summary-color: var(--pico-primary-hover);
347
- --pico-accordion-close-summary-color: var(--pico-color);
348
- --pico-accordion-open-summary-color: var(--pico-muted-color);
349
- --pico-card-background-color: var(--pico-background-color);
350
- --pico-card-border-color: var(--pico-muted-border-color);
351
- --pico-card-box-shadow: var(--pico-box-shadow);
352
- --pico-card-sectioning-background-color: rgb(251, 251.5, 252.25);
353
- --pico-dropdown-background-color: #fff;
354
- --pico-dropdown-border-color: #eff1f4;
355
- --pico-dropdown-box-shadow: var(--pico-box-shadow);
356
- --pico-dropdown-color: var(--pico-color);
357
- --pico-dropdown-hover-background-color: #eff1f4;
358
- --pico-loading-spinner-opacity: 0.5;
359
- --pico-modal-overlay-background-color: rgba(232, 234, 237, 0.75);
360
- --pico-progress-background-color: #dfe3eb;
361
- --pico-progress-color: var(--pico-primary-background);
362
- --pico-tooltip-background-color: var(--pico-contrast-background);
363
- --pico-tooltip-color: var(--pico-contrast-inverse);
308
+ /* One stroke color for both schemes, at least 3:1 on light and dark form backgrounds */
364
309
  --pico-icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(76, 154.5, 137.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
365
310
  --pico-icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(200.25, 79.25, 72.25)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
366
311
  }
367
- [data-theme="light"]
368
- input:is(
369
- [type="submit"],
370
- [type="button"],
371
- [type="reset"],
372
- [type="checkbox"],
373
- [type="radio"],
374
- [type="file"]
375
- ),
376
- :scope:not([data-theme="dark"])
377
- input:is(
378
- [type="submit"],
379
- [type="button"],
380
- [type="reset"],
381
- [type="checkbox"],
382
- [type="radio"],
383
- [type="file"]
384
- ),
385
- :host(:not([data-theme="dark"]))
386
- input:is(
387
- [type="submit"],
388
- [type="button"],
389
- [type="reset"],
390
- [type="checkbox"],
391
- [type="radio"],
392
- [type="file"]
393
- ) {
312
+
313
+ input:is(
314
+ [type="submit"],
315
+ [type="button"],
316
+ [type="reset"],
317
+ [type="checkbox"],
318
+ [type="radio"],
319
+ [type="file"]
320
+ ) {
394
321
  --pico-form-element-focus-color: var(--pico-primary-focus);
395
322
  }
396
323
 
324
+ /* Dark scheme: switch color-scheme, plus filters that light-dark() can't pick */
397
325
  @media only screen and (prefers-color-scheme: dark) {
398
326
  :scope:not([data-theme]),
399
327
  :host(:not([data-theme])) {
400
328
  color-scheme: dark;
401
- --pico-background-color: rgb(19, 22.5, 30.5);
402
- --pico-color: #c2c7d0;
403
- --pico-text-selection-color: rgba(1, 170, 255, 0.1875);
404
- --pico-muted-color: #7b8495;
405
- --pico-muted-border-color: #202632;
406
- --pico-primary: #01aaff;
407
- --pico-primary-background: #0172ad;
408
- --pico-primary-border: var(--pico-primary-background);
409
- --pico-primary-underline: rgba(1, 170, 255, 0.5);
410
- --pico-primary-hover: #79c0ff;
411
- --pico-primary-hover-background: #017fc0;
412
- --pico-primary-hover-border: var(--pico-primary-hover-background);
413
- --pico-primary-hover-underline: var(--pico-primary-hover);
414
- --pico-primary-focus: rgba(1, 170, 255, 0.375);
415
- --pico-primary-inverse: #fff;
416
- --pico-secondary: #969eaf;
417
- --pico-secondary-background: #525f7a;
418
- --pico-secondary-border: var(--pico-secondary-background);
419
- --pico-secondary-underline: rgba(150, 158, 175, 0.5);
420
- --pico-secondary-hover: #b3b9c5;
421
- --pico-secondary-hover-background: #5d6b89;
422
- --pico-secondary-hover-border: var(--pico-secondary-hover-background);
423
- --pico-secondary-hover-underline: var(--pico-secondary-hover);
424
- --pico-secondary-focus: rgba(144, 158, 190, 0.25);
425
- --pico-secondary-inverse: #fff;
426
- --pico-contrast: #dfe3eb;
427
- --pico-contrast-background: #eff1f4;
428
- --pico-contrast-border: var(--pico-contrast-background);
429
- --pico-contrast-underline: rgba(223, 227, 235, 0.5);
430
- --pico-contrast-hover: #fff;
431
- --pico-contrast-hover-background: #fff;
432
- --pico-contrast-hover-border: var(--pico-contrast-hover-background);
433
- --pico-contrast-hover-underline: var(--pico-contrast-hover);
434
- --pico-contrast-focus: rgba(207, 213, 226, 0.25);
435
- --pico-contrast-inverse: #000;
436
- --pico-box-shadow: 0 0.5rem 2.5rem rgba(7, 8.5, 12, 0.2);
437
- --pico-h1-color: #f0f1f3;
438
- --pico-h2-color: #e0e3e7;
439
- --pico-h3-color: #c2c7d0;
440
- --pico-h4-color: #b3b9c5;
441
- --pico-h5-color: #a4acba;
442
- --pico-h6-color: #8891a4;
443
- --pico-mark-background-color: #014063;
444
- --pico-mark-color: #fff;
445
- --pico-ins-color: #62af9a;
446
- --pico-del-color: rgb(205.5, 126, 123);
447
- --pico-blockquote-border-color: var(--pico-muted-border-color);
448
- --pico-blockquote-footer-color: var(--pico-muted-color);
449
- --pico-button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
450
- --pico-button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
451
- --pico-table-border-color: var(--pico-muted-border-color);
452
- --pico-table-row-stripped-background-color: rgba(111, 120, 135, 0.0375);
453
- --pico-code-background-color: rgb(26, 30.5, 40.25);
454
- --pico-code-color: #8891a4;
455
- --pico-code-kbd-background-color: var(--pico-color);
456
- --pico-code-kbd-color: var(--pico-background-color);
457
- --pico-form-element-background-color: rgb(28, 33, 43.5);
458
- --pico-form-element-selected-background-color: #2a3140;
459
- --pico-form-element-border-color: #2a3140;
460
- --pico-form-element-color: #e0e3e7;
461
- --pico-form-element-placeholder-color: #8891a4;
462
- --pico-form-element-active-background-color: rgb(26, 30.5, 40.25);
463
- --pico-form-element-active-border-color: var(--pico-primary-border);
464
- --pico-form-element-focus-color: var(--pico-primary-border);
465
- --pico-form-element-disabled-opacity: 0.5;
466
- --pico-form-element-invalid-border-color: rgb(149.5, 74, 80);
467
- --pico-form-element-invalid-active-border-color: rgb(183.25, 63.5, 59);
468
- --pico-form-element-invalid-focus-color: var(--pico-form-element-invalid-active-border-color);
469
- --pico-form-element-valid-border-color: #2a7b6f;
470
- --pico-form-element-valid-active-border-color: rgb(22, 137, 105.5);
471
- --pico-form-element-valid-focus-color: var(--pico-form-element-valid-active-border-color);
472
- --pico-switch-background-color: #333c4e;
473
- --pico-switch-checked-background-color: var(--pico-primary-background);
474
- --pico-switch-color: #fff;
475
- --pico-switch-thumb-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
476
- --pico-range-border-color: #202632;
477
- --pico-range-active-border-color: #2a3140;
478
- --pico-range-thumb-border-color: var(--pico-background-color);
479
- --pico-range-thumb-color: var(--pico-secondary-background);
480
- --pico-range-thumb-active-color: var(--pico-primary-background);
481
- --pico-accordion-border-color: var(--pico-muted-border-color);
482
- --pico-accordion-active-summary-color: var(--pico-primary-hover);
483
- --pico-accordion-close-summary-color: var(--pico-color);
484
- --pico-accordion-open-summary-color: var(--pico-muted-color);
485
- --pico-card-background-color: #181c25;
486
- --pico-card-border-color: var(--pico-card-background-color);
487
- --pico-card-box-shadow: var(--pico-box-shadow);
488
- --pico-card-sectioning-background-color: rgb(26, 30.5, 40.25);
489
- --pico-dropdown-background-color: #181c25;
490
- --pico-dropdown-border-color: #202632;
491
- --pico-dropdown-box-shadow: var(--pico-box-shadow);
492
- --pico-dropdown-color: var(--pico-color);
493
- --pico-dropdown-hover-background-color: #202632;
494
- --pico-loading-spinner-opacity: 0.5;
495
- --pico-modal-overlay-background-color: rgba(7.5, 8.5, 10, 0.75);
496
- --pico-progress-background-color: #202632;
497
- --pico-progress-color: var(--pico-primary-background);
498
- --pico-tooltip-background-color: var(--pico-contrast-background);
499
- --pico-tooltip-color: var(--pico-contrast-inverse);
500
- --pico-icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
501
- --pico-icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(149.5, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
502
- }
503
- :scope:not([data-theme])
504
- input:is(
505
- [type="submit"],
506
- [type="button"],
507
- [type="reset"],
508
- [type="checkbox"],
509
- [type="radio"],
510
- [type="file"]
511
- ),
512
- :host(:not([data-theme]))
513
- input:is(
514
- [type="submit"],
515
- [type="button"],
516
- [type="reset"],
517
- [type="checkbox"],
518
- [type="radio"],
519
- [type="file"]
520
- ) {
521
- --pico-form-element-focus-color: var(--pico-primary-focus);
522
329
  }
523
330
  :scope:not([data-theme]) details summary[role="button"].contrast:not(.outline)::after,
524
- :host(:not([data-theme])) details summary[role="button"].contrast:not(.outline)::after {
525
- filter: brightness(0);
526
- }
331
+ :host(:not([data-theme])) details summary[role="button"].contrast:not(.outline)::after,
527
332
  :scope:not([data-theme])
528
333
  [aria-busy="true"]:not(input, select, textarea).contrast:is(
529
334
  button,
@@ -545,122 +350,8 @@ details summary[role="button"]:not(.outline)::after {
545
350
  }
546
351
  [data-theme="dark"] {
547
352
  color-scheme: dark;
548
- --pico-background-color: rgb(19, 22.5, 30.5);
549
- --pico-color: #c2c7d0;
550
- --pico-text-selection-color: rgba(1, 170, 255, 0.1875);
551
- --pico-muted-color: #7b8495;
552
- --pico-muted-border-color: #202632;
553
- --pico-primary: #01aaff;
554
- --pico-primary-background: #0172ad;
555
- --pico-primary-border: var(--pico-primary-background);
556
- --pico-primary-underline: rgba(1, 170, 255, 0.5);
557
- --pico-primary-hover: #79c0ff;
558
- --pico-primary-hover-background: #017fc0;
559
- --pico-primary-hover-border: var(--pico-primary-hover-background);
560
- --pico-primary-hover-underline: var(--pico-primary-hover);
561
- --pico-primary-focus: rgba(1, 170, 255, 0.375);
562
- --pico-primary-inverse: #fff;
563
- --pico-secondary: #969eaf;
564
- --pico-secondary-background: #525f7a;
565
- --pico-secondary-border: var(--pico-secondary-background);
566
- --pico-secondary-underline: rgba(150, 158, 175, 0.5);
567
- --pico-secondary-hover: #b3b9c5;
568
- --pico-secondary-hover-background: #5d6b89;
569
- --pico-secondary-hover-border: var(--pico-secondary-hover-background);
570
- --pico-secondary-hover-underline: var(--pico-secondary-hover);
571
- --pico-secondary-focus: rgba(144, 158, 190, 0.25);
572
- --pico-secondary-inverse: #fff;
573
- --pico-contrast: #dfe3eb;
574
- --pico-contrast-background: #eff1f4;
575
- --pico-contrast-border: var(--pico-contrast-background);
576
- --pico-contrast-underline: rgba(223, 227, 235, 0.5);
577
- --pico-contrast-hover: #fff;
578
- --pico-contrast-hover-background: #fff;
579
- --pico-contrast-hover-border: var(--pico-contrast-hover-background);
580
- --pico-contrast-hover-underline: var(--pico-contrast-hover);
581
- --pico-contrast-focus: rgba(207, 213, 226, 0.25);
582
- --pico-contrast-inverse: #000;
583
- --pico-box-shadow: 0 0.5rem 2.5rem rgba(7, 8.5, 12, 0.2);
584
- --pico-h1-color: #f0f1f3;
585
- --pico-h2-color: #e0e3e7;
586
- --pico-h3-color: #c2c7d0;
587
- --pico-h4-color: #b3b9c5;
588
- --pico-h5-color: #a4acba;
589
- --pico-h6-color: #8891a4;
590
- --pico-mark-background-color: #014063;
591
- --pico-mark-color: #fff;
592
- --pico-ins-color: #62af9a;
593
- --pico-del-color: rgb(205.5, 126, 123);
594
- --pico-blockquote-border-color: var(--pico-muted-border-color);
595
- --pico-blockquote-footer-color: var(--pico-muted-color);
596
- --pico-button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
597
- --pico-button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
598
- --pico-table-border-color: var(--pico-muted-border-color);
599
- --pico-table-row-stripped-background-color: rgba(111, 120, 135, 0.0375);
600
- --pico-code-background-color: rgb(26, 30.5, 40.25);
601
- --pico-code-color: #8891a4;
602
- --pico-code-kbd-background-color: var(--pico-color);
603
- --pico-code-kbd-color: var(--pico-background-color);
604
- --pico-form-element-background-color: rgb(28, 33, 43.5);
605
- --pico-form-element-selected-background-color: #2a3140;
606
- --pico-form-element-border-color: #2a3140;
607
- --pico-form-element-color: #e0e3e7;
608
- --pico-form-element-placeholder-color: #8891a4;
609
- --pico-form-element-active-background-color: rgb(26, 30.5, 40.25);
610
- --pico-form-element-active-border-color: var(--pico-primary-border);
611
- --pico-form-element-focus-color: var(--pico-primary-border);
612
- --pico-form-element-disabled-opacity: 0.5;
613
- --pico-form-element-invalid-border-color: rgb(149.5, 74, 80);
614
- --pico-form-element-invalid-active-border-color: rgb(183.25, 63.5, 59);
615
- --pico-form-element-invalid-focus-color: var(--pico-form-element-invalid-active-border-color);
616
- --pico-form-element-valid-border-color: #2a7b6f;
617
- --pico-form-element-valid-active-border-color: rgb(22, 137, 105.5);
618
- --pico-form-element-valid-focus-color: var(--pico-form-element-valid-active-border-color);
619
- --pico-switch-background-color: #333c4e;
620
- --pico-switch-checked-background-color: var(--pico-primary-background);
621
- --pico-switch-color: #fff;
622
- --pico-switch-thumb-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
623
- --pico-range-border-color: #202632;
624
- --pico-range-active-border-color: #2a3140;
625
- --pico-range-thumb-border-color: var(--pico-background-color);
626
- --pico-range-thumb-color: var(--pico-secondary-background);
627
- --pico-range-thumb-active-color: var(--pico-primary-background);
628
- --pico-accordion-border-color: var(--pico-muted-border-color);
629
- --pico-accordion-active-summary-color: var(--pico-primary-hover);
630
- --pico-accordion-close-summary-color: var(--pico-color);
631
- --pico-accordion-open-summary-color: var(--pico-muted-color);
632
- --pico-card-background-color: #181c25;
633
- --pico-card-border-color: var(--pico-card-background-color);
634
- --pico-card-box-shadow: var(--pico-box-shadow);
635
- --pico-card-sectioning-background-color: rgb(26, 30.5, 40.25);
636
- --pico-dropdown-background-color: #181c25;
637
- --pico-dropdown-border-color: #202632;
638
- --pico-dropdown-box-shadow: var(--pico-box-shadow);
639
- --pico-dropdown-color: var(--pico-color);
640
- --pico-dropdown-hover-background-color: #202632;
641
- --pico-loading-spinner-opacity: 0.5;
642
- --pico-modal-overlay-background-color: rgba(7.5, 8.5, 10, 0.75);
643
- --pico-progress-background-color: #202632;
644
- --pico-progress-color: var(--pico-primary-background);
645
- --pico-tooltip-background-color: var(--pico-contrast-background);
646
- --pico-tooltip-color: var(--pico-contrast-inverse);
647
- --pico-icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
648
- --pico-icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(149.5, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
649
- }
650
- [data-theme="dark"]
651
- input:is(
652
- [type="submit"],
653
- [type="button"],
654
- [type="reset"],
655
- [type="checkbox"],
656
- [type="radio"],
657
- [type="file"]
658
- ) {
659
- --pico-form-element-focus-color: var(--pico-primary-focus);
660
- }
661
- [data-theme="dark"] details summary[role="button"].contrast:not(.outline)::after {
662
- filter: brightness(0);
663
353
  }
354
+ [data-theme="dark"] details summary[role="button"].contrast:not(.outline)::after,
664
355
  [data-theme="dark"]
665
356
  [aria-busy="true"]:not(input, select, textarea).contrast:is(
666
357
  button,
@@ -716,9 +407,6 @@ progress,
716
407
  tab-size: 4;
717
408
  }
718
409
 
719
- /**
720
- * Landmarks
721
- */
722
410
  body {
723
411
  width: 100%;
724
412
  margin: 0;
@@ -728,12 +416,6 @@ main {
728
416
  display: block;
729
417
  }
730
418
 
731
- body > header,
732
- body > main,
733
- body > footer {
734
- padding-block: var(--pico-block-spacing-vertical);
735
- }
736
-
737
419
  /**
738
420
  * Section
739
421
  */
@@ -1077,7 +759,7 @@ button,
1077
759
  background-color: var(--pico-background-color);
1078
760
  box-shadow: var(--pico-box-shadow);
1079
761
  color: var(--pico-color);
1080
- font-weight: var(--pico-font-weight);
762
+ font-weight: var(--pico-button-font-weight, var(--pico-font-weight));
1081
763
  font-size: 1rem;
1082
764
  line-height: var(--pico-line-height);
1083
765
  text-align: center;
@@ -1752,6 +1434,19 @@ label > :where(input, select, textarea) {
1752
1434
  /**
1753
1435
  * Checkboxes, Radios and Switches
1754
1436
  */
1437
+ :where(:scope),
1438
+ :host {
1439
+ --pico-icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
1440
+ --pico-icon-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
1441
+ }
1442
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
1443
+ :host {
1444
+ --pico-switch-background-color: light-dark(#bfc7d9, #333c4e);
1445
+ --pico-switch-checked-background-color: var(--pico-primary-background);
1446
+ --pico-switch-color: #fff;
1447
+ --pico-switch-thumb-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
1448
+ }
1449
+
1755
1450
  label:has([type="checkbox"], [type="radio"]) {
1756
1451
  width: -moz-fit-content;
1757
1452
  width: fit-content;
@@ -1917,6 +1612,12 @@ label:has([type="checkbox"], [type="radio"]) {
1917
1612
  /**
1918
1613
  * Input type datetime
1919
1614
  */
1615
+ :where(:scope),
1616
+ :host {
1617
+ --pico-icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
1618
+ --pico-icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
1619
+ }
1620
+
1920
1621
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]):is(
1921
1622
  [type="date"],
1922
1623
  [type="datetime-local"],
@@ -1991,6 +1692,15 @@ input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"])[type
1991
1692
  /**
1992
1693
  * Input type range
1993
1694
  */
1695
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
1696
+ :host {
1697
+ --pico-range-border-color: light-dark(#dfe3eb, #202632);
1698
+ --pico-range-active-border-color: light-dark(#bfc7d9, #2a3140);
1699
+ --pico-range-thumb-border-color: var(--pico-background-color);
1700
+ --pico-range-thumb-color: var(--pico-secondary-background);
1701
+ --pico-range-thumb-active-color: var(--pico-primary-background);
1702
+ }
1703
+
1994
1704
  [type="range"] {
1995
1705
  -webkit-appearance: none;
1996
1706
  -moz-appearance: none;
@@ -2100,6 +1810,11 @@ input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"])[type
2100
1810
  /**
2101
1811
  * Input type search
2102
1812
  */
1813
+ :where(:scope),
1814
+ :host {
1815
+ --pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
1816
+ }
1817
+
2103
1818
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"])[type="search"] {
2104
1819
  padding-inline-start: calc(var(--pico-form-element-spacing-horizontal) + 1.75rem);
2105
1820
  background-image: var(--pico-icon-search);
@@ -2158,6 +1873,14 @@ input:not(
2158
1873
  /**
2159
1874
  * Accordion (<details>)
2160
1875
  */
1876
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
1877
+ :host {
1878
+ --pico-accordion-border-color: var(--pico-muted-border-color);
1879
+ --pico-accordion-active-summary-color: var(--pico-primary-hover);
1880
+ --pico-accordion-close-summary-color: var(--pico-color);
1881
+ --pico-accordion-open-summary-color: var(--pico-muted-color);
1882
+ }
1883
+
2161
1884
  details {
2162
1885
  display: block;
2163
1886
  margin-bottom: var(--pico-spacing);
@@ -2232,6 +1955,20 @@ details[open] > summary::after {
2232
1955
  /**
2233
1956
  * Card (<article>)
2234
1957
  */
1958
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
1959
+ :host {
1960
+ --pico-card-background-color: light-dark(var(--pico-background-color), #181c25);
1961
+ --pico-card-border-color: light-dark(
1962
+ var(--pico-muted-border-color),
1963
+ var(--pico-card-background-color)
1964
+ );
1965
+ --pico-card-box-shadow: var(--pico-box-shadow);
1966
+ --pico-card-sectioning-background-color: light-dark(
1967
+ rgb(251, 251.5, 252.25),
1968
+ rgb(26, 30.5, 40.25)
1969
+ );
1970
+ }
1971
+
2235
1972
  article {
2236
1973
  margin-bottom: var(--pico-block-spacing-vertical);
2237
1974
  padding: var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);
@@ -2263,6 +2000,15 @@ article > footer {
2263
2000
  /**
2264
2001
  * Dropdown (details.dropdown)
2265
2002
  */
2003
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
2004
+ :host {
2005
+ --pico-dropdown-background-color: light-dark(#fff, #181c25);
2006
+ --pico-dropdown-border-color: light-dark(#eff1f4, #202632);
2007
+ --pico-dropdown-box-shadow: var(--pico-box-shadow);
2008
+ --pico-dropdown-color: var(--pico-color);
2009
+ --pico-dropdown-hover-background-color: light-dark(#eff1f4, #202632);
2010
+ }
2011
+
2266
2012
  details.dropdown {
2267
2013
  position: relative;
2268
2014
  border-bottom: none;
@@ -2443,6 +2189,44 @@ label > details.dropdown {
2443
2189
  /**
2444
2190
  * Group ([role="group"], [role="search"])
2445
2191
  */
2192
+ :where(:scope),
2193
+ :host {
2194
+ --pico-group-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
2195
+ --pico-group-box-shadow-focus-with-button: 0 0 0 var(--pico-outline-width)
2196
+ var(--pico-primary-focus);
2197
+ --pico-group-box-shadow-focus-with-input: 0 0 0 0.0625rem var(--pico-form-element-border-color);
2198
+ }
2199
+ [role="search"]:has(
2200
+ button.secondary:focus,
2201
+ [type="submit"].secondary:focus,
2202
+ [type="button"].secondary:focus,
2203
+ [role="button"].secondary:focus
2204
+ ),
2205
+ [role="group"]:has(
2206
+ button.secondary:focus,
2207
+ [type="submit"].secondary:focus,
2208
+ [type="button"].secondary:focus,
2209
+ [role="button"].secondary:focus
2210
+ ) {
2211
+ --pico-group-box-shadow-focus-with-button: 0 0 0 var(--pico-outline-width)
2212
+ var(--pico-secondary-focus);
2213
+ }
2214
+ [role="search"]:has(
2215
+ button.contrast:focus,
2216
+ [type="submit"].contrast:focus,
2217
+ [type="button"].contrast:focus,
2218
+ [role="button"].contrast:focus
2219
+ ),
2220
+ [role="group"]:has(
2221
+ button.contrast:focus,
2222
+ [type="submit"].contrast:focus,
2223
+ [type="button"].contrast:focus,
2224
+ [role="button"].contrast:focus
2225
+ ) {
2226
+ --pico-group-box-shadow-focus-with-button: 0 0 0 var(--pico-outline-width)
2227
+ var(--pico-contrast-focus);
2228
+ }
2229
+
2446
2230
  [role="search"],
2447
2231
  [role="group"] {
2448
2232
  display: inline-flex;
@@ -2610,8 +2394,17 @@ label > details.dropdown {
2610
2394
  /**
2611
2395
  * Loading ([aria-busy=true])
2612
2396
  */
2613
- [aria-busy="true"]:not(input, select, textarea, html, form) {
2614
- white-space: nowrap;
2397
+ :where(:scope),
2398
+ :host {
2399
+ --pico-icon-loading: url("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgb(136, 145, 164)' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E");
2400
+ }
2401
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
2402
+ :host {
2403
+ --pico-loading-spinner-opacity: 0.5;
2404
+ }
2405
+
2406
+ [aria-busy="true"]:not(input, select, textarea, html, form) {
2407
+ white-space: nowrap;
2615
2408
  }
2616
2409
  [aria-busy="true"]:not(input, select, textarea, html, form)::before {
2617
2410
  display: inline-block;
@@ -2642,6 +2435,19 @@ a[aria-busy="true"] {
2642
2435
  /**
2643
2436
  * Modal (<dialog>)
2644
2437
  */
2438
+ :where(:scope),
2439
+ :host {
2440
+ --pico-modal-overlay-backdrop-filter: blur(0.375rem);
2441
+ --pico-icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
2442
+ }
2443
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
2444
+ :host {
2445
+ --pico-modal-overlay-background-color: light-dark(
2446
+ rgba(232, 234, 237, 0.75),
2447
+ rgba(7.5, 8.5, 10, 0.75)
2448
+ );
2449
+ }
2450
+
2645
2451
  :scope,
2646
2452
  :host {
2647
2453
  --pico-scrollbar-width: 0px;
@@ -2784,6 +2590,12 @@ dialog[open="false"] {
2784
2590
  /**
2785
2591
  * Nav
2786
2592
  */
2593
+ :where(:scope),
2594
+ :host {
2595
+ --pico-nav-element-spacing-horizontal: 0.5rem;
2596
+ --pico-nav-breadcrumb-divider: ">";
2597
+ }
2598
+
2787
2599
  :where(nav li)::before {
2788
2600
  float: left;
2789
2601
  content: "​";
@@ -2893,6 +2705,12 @@ aside li [role="button"] {
2893
2705
  /**
2894
2706
  * Progress
2895
2707
  */
2708
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
2709
+ :host {
2710
+ --pico-progress-background-color: light-dark(#dfe3eb, #202632);
2711
+ --pico-progress-color: var(--pico-primary-background);
2712
+ }
2713
+
2896
2714
  progress {
2897
2715
  display: inline-block;
2898
2716
  vertical-align: baseline;
@@ -2961,6 +2779,12 @@ progress::-moz-progress-bar {
2961
2779
  /**
2962
2780
  * Tooltip ([data-tooltip])
2963
2781
  */
2782
+ :where(:scope, [data-theme="light"], [data-theme="dark"]),
2783
+ :host {
2784
+ --pico-tooltip-background-color: var(--pico-contrast-background);
2785
+ --pico-tooltip-color: var(--pico-contrast-inverse);
2786
+ }
2787
+
2964
2788
  [data-tooltip] {
2965
2789
  position: relative;
2966
2790
  }
@@ -3189,135 +3013,6 @@ progress::-moz-progress-bar {
3189
3013
 
3190
3014
  /* Layout */
3191
3015
 
3192
- /*
3193
- \3c !--section:code-->
3194
- ```css */
3195
- .breakout,
3196
- .breakout-all {
3197
- max-width: calc(10% + 65ch + 10%);
3198
- /* Prepare the container for breakout elements */
3199
- padding-inline: 10%;
3200
- }
3201
- @media (width < 768px) {
3202
- .breakout,
3203
- .breakout-all {
3204
- max-width: calc(1rem + 65ch + 1rem);
3205
- padding-inline: 1rem
3206
- }
3207
- }
3208
- /* Breakout direct children only */
3209
- .breakout > *:is(
3210
- table,
3211
- pre,
3212
- figure, video, iframe, canvas,
3213
- img, picture,
3214
-
3215
- .breakout-item,
3216
- .breakout-item-max
3217
- ),
3218
- .breakout-all > *:is(
3219
- table,
3220
- pre,
3221
- figure, video, iframe, canvas,
3222
- img, picture,
3223
-
3224
- .breakout-item,
3225
- .breakout-item-max
3226
- ) {
3227
- width: -moz-fit-content;
3228
- width: fit-content;
3229
- min-width: 100%;
3230
- max-width: min(125%, 100dvw);
3231
- margin-left: 50%;
3232
- transform: translateX(-50%);
3233
- }
3234
- /* Respect img/picture min-width */
3235
- .breakout > *:is(img, picture):not(.does-not-exist), .breakout-all > *:is(img, picture):not(.does-not-exist) /* soft win specificity over .breakout-item above */ {
3236
- min-width: auto;
3237
- }
3238
- /* Max out the width of the element */
3239
- .breakout > *.breakout-item-max, .breakout-all > *.breakout-item-max {
3240
- width: min(125%, 100dvw) !important;
3241
- /* !important is for cases like figure.breakout-item-max @TODO */
3242
- }
3243
-
3244
- .breakout-all > *:is(h2, h3, h4, h5, h6, hr):not([class]) {
3245
- position: relative;
3246
- }
3247
-
3248
- .breakout-all > *:is(h2, h3, h4, h5, h6, hr):not([class])::before {
3249
- display: block;
3250
- position: absolute;
3251
- background: gray;
3252
- content: "";
3253
- opacity: 12.5%;
3254
- }
3255
-
3256
- .breakout-all > *:is(h2, h3, h4, h5, h6):not([class])::before {
3257
- top: 50%;
3258
- right: 100%;
3259
- width: 10em;
3260
- height: 0.25em;
3261
- margin-right: 0.8ch;
3262
- transform: translateY(-50%);
3263
- background: linear-gradient(to left, gray, transparent);
3264
- }
3265
-
3266
- /* @TODO: add to tricks-wiki why `*` works here, but `&` fails */
3267
-
3268
- .breakout-all > *:is(h2, h3, h4, h5, h6):not([class]):where(hr:not([class]) + *)::before {
3269
- display: none !important;
3270
- }
3271
-
3272
- .breakout-all > *:is(hr):not([class]) {
3273
- height: 0.5rem;
3274
- overflow: visible;
3275
- border: none;
3276
- }
3277
-
3278
- .breakout-all > *:is(hr):not([class])::before {
3279
- left: 50%;
3280
- width: 100dvw;
3281
- height: 100%;
3282
- transform: translateX(-50%);
3283
- }
3284
- /*```
3285
- \3c !--section:docs-->
3286
-
3287
- The `.breakout` layout allows images, tables, and other figures to automatically extend or bleed beyond their parent container’s width.
3288
-
3289
- Break out a wide image from the text flow:
3290
-
3291
- <div>\3c !-- Dummy div to avoid p tag in Markdown --></div><img
3292
- src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='3000' height='300'><rect width='100%' height='100%' fill='gray'/></svg>">
3293
-
3294
- Or table:
3295
-
3296
- | Imagine<hr> | a<hr> | really<hr> | wide<hr> | table<hr> | here<hr> |
3297
- | ----------- | ----- | ---------- | -------- | --------- | -------- |
3298
- | ... |
3299
-
3300
- Or code block:
3301
-
3302
- ```html
3303
- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod.</p>
3304
- ```
3305
-
3306
- Or anything else:
3307
-
3308
- <article class="breakout-item-max" data-theme="dark">
3309
-
3310
- Using `.breakout-item` and `.breakout-item-max` helpers {style=margin:0}
3311
- </article>
3312
-
3313
- <div><hr></div>
3314
-
3315
- `.breakout-all` also visually breaks out headings and horizontal rules:
3316
-
3317
- <h2>Heading 2</h2><h3>Heading 3</h3><h4>Heading 4</h4><h5>Heading 5</h5><h6>Heading 6</h6>
3318
- <hr>
3319
-
3320
- \3c !--section--> */
3321
3016
  /*\3c !--section:docs-->
3322
3017
 
3323
3018
  `.columns` automatically creates columns with at least 30 characters each:
@@ -3345,250 +3040,9 @@ Useful for tables of contents and long lists.
3345
3040
  -moz-column-break-inside: avoid;
3346
3041
  break-inside: avoid;
3347
3042
  }
3348
- /*```\3c !--section:docs-->
3349
-
3350
- `<a href="#top">` is automatically fixed to the bottom-right corner with extra top padding for easier clicking:
3351
- ```css */
3352
- [href="#top"] {
3353
- position: fixed;
3354
- right: 0;
3355
- bottom: 0;
3356
- padding-top: 50vh;
3357
- }
3358
3043
  /* Content */
3359
3044
  /*\3c !--section:docs-->
3360
3045
 
3361
- ## Heading anchors
3362
-
3363
- Links with `href="#..."` inside headings are automatically displayed as anchors:
3364
-
3365
- <article>
3366
- <h2 style="margin: 0 0 0 1.5rem">Heading with anchor <a aria-hidden="true" style="visibility: visible">#</a></h2>
3367
- </article>
3368
-
3369
- How it works:
3370
- ```css */
3371
- h1,
3372
- h2,
3373
- h3,
3374
- h4,
3375
- h5,
3376
- h6 {
3377
- position: relative;
3378
- }
3379
- h1 a[aria-hidden="true"], h2 a[aria-hidden="true"], h3 a[aria-hidden="true"], h4 a[aria-hidden="true"], h5 a[aria-hidden="true"], h6 a[aria-hidden="true"] {
3380
- visibility: hidden;
3381
- position: absolute;
3382
- top: 50%;
3383
- right: 100%;
3384
- padding-right: 0.2ch;
3385
- transform: translateY(-50%);
3386
- color: silver;
3387
- text-decoration: none;
3388
- }
3389
- @media /* to avoid double-tap on touch devices */ (hover: hover) {
3390
- h1:hover a[aria-hidden="true"], h2:hover a[aria-hidden="true"], h3:hover a[aria-hidden="true"], h4:hover a[aria-hidden="true"], h5:hover a[aria-hidden="true"], h6:hover a[aria-hidden="true"] {
3391
- visibility: visible;
3392
- }
3393
- }
3394
- /*\3c !--section:docs-->
3395
-
3396
- ## Custom markers
3397
-
3398
- Customize markers using inline `style="--list-marker:..."` on `<ul>/<ol>` or even individual `<li>`:
3399
-
3400
- <article>
3401
-
3402
- - you
3403
- - can
3404
- - make
3405
- - really
3406
- - cool markers {style="--list-marker:'🧊 '"}
3407
- - with
3408
- - *Bl*ades {style="--list-marker:'🥷 '"}
3409
-
3410
- {style="--list-marker:'→ '"}
3411
- </article>
3412
-
3413
- How it works:
3414
- ```css */
3415
- ul[style*="--list-marker:"], ol[style*="--list-marker:"] {
3416
- list-style-type: var(--list-marker);
3417
- }
3418
- ul[style*="--list-marker:"] > li, ol[style*="--list-marker:"] > li {
3419
- list-style-type: inherit;
3420
- }
3421
- ul li[style*="--list-marker:"], ol li[style*="--list-marker:"] {
3422
- list-style-type: var(--list-marker);
3423
- }
3424
- ul li[data-marker]::marker, ol li[data-marker]::marker {
3425
- content: attr(data-marker) " "; /* ⚠️ Chrome and Firefox only */
3426
- }
3427
- /*```
3428
-
3429
- ## Markerless
3430
-
3431
- `.markerless` removes markers and reduces padding:
3432
-
3433
- <article>
3434
-
3435
- - 1️⃣ so you can use
3436
- - 2️⃣ emojis or images
3437
- - 3️⃣ instead of bullets
3438
-
3439
- {.markerless}
3440
- </article>
3441
-
3442
- How it works:
3443
- ```css */
3444
- ul.markerless, ol.markerless {
3445
- padding-inline-start: 1.25rem;
3446
- }
3447
- ul.markerless li, ol.markerless li {
3448
- list-style: none;
3449
- }
3450
- /*```
3451
-
3452
- ## Unlist
3453
-
3454
- `.unlist` removes list styling at all:
3455
-
3456
- <article>
3457
-
3458
- - One: <article>1</article>
3459
- - Two: <article>2</article>
3460
- - Three: <article>3</article>
3461
-
3462
- {.unlist .grid style=margin:0}
3463
- </article>
3464
-
3465
- `.unlist-all` removes styling from all nested lists too.
3466
-
3467
- How it works:
3468
- ```css */
3469
- ul.unlist,
3470
- ul.unlist-all,
3471
- .unlist-all ul,
3472
- ol.unlist,
3473
- ol.unlist-all,
3474
- .unlist-all ol {
3475
- padding-inline-start: 0;
3476
- }
3477
- ul.unlist > li, ul.unlist-all > li, .unlist-all ul > li, ol.unlist > li, ol.unlist-all > li, .unlist-all ol > li {
3478
- list-style: none;
3479
- }
3480
- /*\3c !--section:docs-->
3481
-
3482
- ## Column expanders
3483
-
3484
- Place `<hr>` element inside `<th>` column to expand it horizontally:
3485
-
3486
- <article>
3487
-
3488
- | Column with `<hr>`<hr> | Same column without `<hr>` | ... {style=width:100%} |
3489
- | --- | --- | --- |
3490
- | (012) 345-6789 | (012) 345-6789 |
3491
- </article>
3492
-
3493
- Living examples of big tables with `<hr>`-expanders: \3c !--A-Z-->
3494
- - https://blades.ninja/ai/ide/
3495
- - https://blades.ninja/build-awesome-11ty/starters/
3496
- - https://blades.ninja/css/frameworks/
3497
- - https://blades.ninja/ssg/
3498
-
3499
- How it works:
3500
- ```css */
3501
- th hr {
3502
- visibility: hidden;
3503
- width: 12ch; /* min ~65/12 = ~5 cols */
3504
- height: 0;
3505
- margin: 0;
3506
- }
3507
- th hr.lg {
3508
- width: 18ch;
3509
- }
3510
- th hr.x2 {
3511
- width: 24ch;
3512
- }
3513
- /*```
3514
-
3515
- ## Borderless table
3516
-
3517
- `.borderless` removes all default borders:
3518
-
3519
- <article>
3520
-
3521
- | Less | borders |
3522
- | ---- | ------- |
3523
- | More | fun |
3524
-
3525
- {.borderless}
3526
- </article>
3527
-
3528
- \3c !--section-->*/
3529
- table.borderless th,
3530
- table.borderless td {
3531
- border: none;
3532
- }
3533
- /*
3534
- \3c !--section:code-->
3535
- ```css */
3536
- table.responsive,
3537
- .breakout > table:not(.does-not-exist),
3538
- .breakout-all > table:not(.does-not-exist) {
3539
-
3540
- /* Let them scroll */
3541
- display: block;
3542
-
3543
- /* Let them full-bleed */
3544
- width: -moz-max-content;
3545
- width: max-content;
3546
- min-width: auto;
3547
- max-width: 100dvw;
3548
- /* Center horizontally */
3549
- margin-left: 50%;
3550
- padding-inline: 7.5%;
3551
- overflow-x: auto;
3552
- transform: translateX(-50%);
3553
- -webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
3554
- }
3555
- table.responsive th,
3556
- table.responsive td,
3557
- .breakout > table:not(.does-not-exist) th,
3558
- .breakout > table:not(.does-not-exist) td,
3559
- .breakout-all > table:not(.does-not-exist) th,
3560
- .breakout-all > table:not(.does-not-exist) td {
3561
- padding-inline-start: 0;
3562
- }
3563
- /*```
3564
- `table:not(.does-not-exist)` trick (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
3565
-
3566
- \3c !--section:summary-->
3567
-
3568
- `.responsive` makes a table full-bleed and scroll on mobile, without a need for a redundant wrapper (finally).
3569
- Tables inside https://blades.ninja/css/breakout/ are responsive by default.
3570
-
3571
- \3c !--section:docs-->
3572
-
3573
- ### Demo table
3574
-
3575
- | Term | Description <hr class="x2"> | Link |
3576
- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
3577
- | Responsive design | Approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfaction. | https://en.wikipedia.org/wiki/Responsive_web_design |
3578
-
3579
- {.responsive}
3580
-
3581
- ---
3582
-
3583
- Living examples: \3c !--A-Z-->
3584
- - https://blades.ninja/ai/ide/
3585
- - https://blades.ninja/build-awesome-11ty/starters/
3586
- - https://blades.ninja/css/frameworks/
3587
- - https://blades.ninja/ssg/
3588
-
3589
- \3c !--section--> */
3590
- /*\3c !--section:docs-->
3591
-
3592
3046
  The `<pre><code>` blocks are Prism-compatible and support captions via `data-caption="..."` attribute:
3593
3047
 
3594
3048
  ```treeview {data-caption="Blades CSS ships:"}
@@ -3719,6 +3173,113 @@ The `:has(*:placeholder-shown:not(:focus))` trick allows this input state inform
3719
3173
  Historically, this was not possible: the float label had to be placed after the input field to be targeted using the `input:focus + label` selector.
3720
3174
 
3721
3175
  */
3176
+ label:has(> span):has(
3177
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3178
+ textarea,
3179
+ select
3180
+ ),
3181
+ .has-float-label {
3182
+
3183
+ /* Enlarged state */
3184
+ }
3185
+ /* Default/fallback state */
3186
+ label:has(> span):has(
3187
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3188
+ textarea,
3189
+ select
3190
+ ) > span,
3191
+ label:has(> span):has(
3192
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3193
+ textarea,
3194
+ select
3195
+ ) label,
3196
+ .has-float-label > span,
3197
+ .has-float-label label {
3198
+ padding-inline-start: calc(1rem + 1px); /* match Pico's padding + border */
3199
+ padding-block-start: 0.25rem;
3200
+ opacity: 75%;
3201
+ transition: all 0.25s;
3202
+ }
3203
+ label:has(> span):has(
3204
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3205
+ textarea,
3206
+ select
3207
+ ) input,
3208
+ label:has(> span):has(
3209
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3210
+ textarea,
3211
+ select
3212
+ ) textarea,
3213
+ label:has(> span):has(
3214
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3215
+ textarea,
3216
+ select
3217
+ ) select,
3218
+ .has-float-label input,
3219
+ .has-float-label textarea,
3220
+ .has-float-label select {
3221
+ margin-block-start: 0; /* reset Pico */
3222
+ padding-inline-start: 1rem; /* match Pico */
3223
+ padding-block: 1.125rem 0.375rem; /* match Pico's total: 2 x 0.75rem = 1.5rem */
3224
+ }
3225
+ label:has(> span):has(
3226
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3227
+ textarea,
3228
+ select
3229
+ ) input::-moz-placeholder, label:has(> span):has(
3230
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3231
+ textarea,
3232
+ select
3233
+ ) textarea::-moz-placeholder, label:has(> span):has(
3234
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3235
+ textarea,
3236
+ select
3237
+ ) select::-moz-placeholder, .has-float-label input::-moz-placeholder, .has-float-label textarea::-moz-placeholder, .has-float-label select::-moz-placeholder {
3238
+ opacity: 100%;
3239
+ -moz-transition: all 0.25s;
3240
+ transition: all 0.25s;
3241
+ }
3242
+ label:has(> span):has(
3243
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3244
+ textarea,
3245
+ select
3246
+ ) input::placeholder, label:has(> span):has(
3247
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3248
+ textarea,
3249
+ select
3250
+ ) textarea::placeholder, label:has(> span):has(
3251
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3252
+ textarea,
3253
+ select
3254
+ ) select::placeholder, .has-float-label input::placeholder, .has-float-label textarea::placeholder, .has-float-label select::placeholder {
3255
+ opacity: 100%;
3256
+ transition: all 0.25s;
3257
+ }
3258
+ label:has(> span):has(
3259
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3260
+ textarea,
3261
+ select
3262
+ ):has(*:-moz-placeholder:not(:focus)) > span, label:has(> span):has(
3263
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3264
+ textarea,
3265
+ select
3266
+ ):has(*:-moz-placeholder:not(:focus)) label, .has-float-label:has(*:-moz-placeholder:not(:focus)) > span, .has-float-label:has(*:-moz-placeholder:not(:focus)) label {
3267
+ padding-block: 0.75rem; /* match Pico */
3268
+ }
3269
+ label:has(> span):has(
3270
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3271
+ textarea,
3272
+ select
3273
+ ):has(*:placeholder-shown:not(:focus)) > span,
3274
+ label:has(> span):has(
3275
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
3276
+ textarea,
3277
+ select
3278
+ ):has(*:placeholder-shown:not(:focus)) label,
3279
+ .has-float-label:has(*:placeholder-shown:not(:focus)) > span,
3280
+ .has-float-label:has(*:placeholder-shown:not(:focus)) label {
3281
+ padding-block: 0.75rem; /* match Pico */
3282
+ }
3722
3283
  /* Components */
3723
3284
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
3724
3285
  \3c !--section:code-->
@@ -3798,222 +3359,54 @@ dl.timeline dd, .has-timeline > dl dd {
3798
3359
  padding: 0.25rem 0 0.75rem 1rem;
3799
3360
  border-inline-start: 0.25rem solid var(--blades-timeline-border-color);
3800
3361
  }
3801
- /* Utilities */
3802
- /*\3c !--section:docs-->
3803
-
3804
- ## Dark auto
3805
-
3806
- `.dark-auto` automatically creates a simple dark version of any element:
3807
-
3808
- <article data-theme="dark">
3809
- <p>Look how cool <big class="dark-auto">🔥🕷️🐦‍⬛🐄🦓</big> can look in the dark!</p>
3810
- </article>
3811
-
3812
- How it works:
3813
- ```css */
3814
- /* Per https://picocss.com/docs/css-variables#css-variables-for-color-schemes */
3815
- :root {
3816
- --blades-dark-filter: invert(100%) hue-rotate(180deg);
3817
- }
3818
- .dark-auto {
3819
- /* Dark color scheme (Forced) */
3820
- }
3821
- /* Dark color scheme (Auto) */
3822
- @media (prefers-color-scheme: dark) {
3823
- .dark-auto {
3824
- filter: var(--blades-dark-filter)
3825
- }
3826
- }
3827
- .dark-auto[data-theme="dark"],
3828
- .dark-auto:where([data-theme="dark"] *) {
3829
- filter: var(--blades-dark-filter);
3830
- }
3831
- /*```
3832
-
3833
- ## Faded
3834
-
3835
- `.faded` reduces the opacity of an element:
3836
-
3837
- <article class="faded">
3838
- Hover to unfade me!
3839
- </article>
3840
-
3841
- How it works:
3842
- ```css */
3843
- .faded {
3844
- opacity: 50%;
3845
- }
3846
- .faded:hover {
3847
- opacity: 87.5%;
3848
- }
3849
- /*```
3850
- \3c !--section--> */
3851
-
3852
- /* Fix the scrollbar color when inverted by https://tailwindcss.com/docs/filter-invert */
3853
- .invert ::-webkit-scrollbar {
3854
- filter: invert(1) !important;
3855
- }
3856
- /*\3c !--section:code-->```css */
3857
- /* Default/fallback state */
3858
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) > span,
3859
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) label,
3860
- .has-float-label > span,
3861
- .has-float-label label {
3862
- padding-inline-start: calc(1rem + 1px); /* match Pico's padding + border */
3863
- padding-block-start: 0.25rem;
3864
- opacity: 75%;
3865
- transition: all 0.25s;
3866
- }
3867
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) input,
3868
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) textarea,
3869
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) select,
3870
- .has-float-label input,
3871
- .has-float-label textarea,
3872
- .has-float-label select {
3873
- margin-block-start: 0; /* reset Pico */
3874
- padding-inline-start: 1rem; /* match Pico */
3875
- padding-block: 1.125rem 0.375rem; /* match Pico's total: 2 x 0.75rem = 1.5rem */
3876
- }
3877
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) input::-moz-placeholder, label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) textarea::-moz-placeholder, label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) select::-moz-placeholder, .has-float-label input::-moz-placeholder, .has-float-label textarea::-moz-placeholder, .has-float-label select::-moz-placeholder {
3878
- opacity: 100%;
3879
- -moz-transition: all 0.25s;
3880
- transition: all 0.25s;
3881
- }
3882
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) input::placeholder, label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) textarea::placeholder, label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) select::placeholder, .has-float-label input::placeholder, .has-float-label textarea::placeholder, .has-float-label select::placeholder {
3883
- opacity: 100%;
3884
- transition: all 0.25s;
3885
- }
3886
- /* Enlarged state */
3887
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:-moz-placeholder:not(:focus)) > span, label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:-moz-placeholder:not(:focus)) label, .has-float-label:has(*:-moz-placeholder:not(:focus)) > span, .has-float-label:has(*:-moz-placeholder:not(:focus)) label {
3888
- padding-block: 0.75rem; /* match Pico */
3889
- }
3890
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:placeholder-shown:not(:focus)) > span,
3891
- label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:placeholder-shown:not(:focus)) label,
3892
- .has-float-label:has(*:placeholder-shown:not(:focus)) > span,
3893
- .has-float-label:has(*:placeholder-shown:not(:focus)) label {
3894
- padding-block: 0.75rem; /* match Pico */
3895
- }
3896
- html {
3897
- /* Prevent horizontal overflow and scrolling, modern way. */
3898
- overflow-x: clip;
3899
-
3900
- /* Enable font smoothing */
3901
- -webkit-font-smoothing: antialiased;
3902
- -moz-osx-font-smoothing: grayscale;
3903
- }
3904
-
3905
- body {
3906
-
3907
- /* Make the `body` a flex container with column layout, and `main` to automatically fill available space. This is useful for creating sticky footers and full-height layouts. */
3908
- display: flex;
3909
- flex-direction: column;
3910
- /* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
3911
- min-height: 100dvh;
3912
-
3913
- /* Evaluates the last ~4 lines of text blocks to prevent a single word from sitting on the final line. */
3914
-
3915
- /* Enable global hyphenation */
3916
- /* ... except for links and tables which are better (safer) without hyphenation */
3362
+ /*
3363
+ * Compact: opt-in denser sizing and a more current look, applied under `data-compact` on
3364
+ * <html> (whole page) or on any element such as a single <form>. Without the attribute it
3365
+ * changes nothing. Part of blades.css (and blades.layered.css); with per-part imports, import it
3366
+ * last (in the same layer as the other parts).
3367
+ *
3368
+ * The extra selectors keep the values winning where Pico re-declares them at the same
3369
+ * specificity: nested [data-theme] sections, the `.pico` root when combined with the conditional build,
3370
+ * and a shadow host.
3371
+ */
3372
+ [data-compact],
3373
+ [data-compact] :is([data-theme], .pico),
3374
+ .pico[data-compact],
3375
+ :host([data-compact]),
3376
+ :host([data-compact]) [data-theme] {
3377
+ --pico-border-radius: 0.5rem;
3378
+ --pico-outline-width: 0.1875rem;
3379
+ --pico-block-spacing-vertical: 1.5rem;
3380
+ --pico-block-spacing-horizontal: 1.5rem;
3381
+ --pico-form-element-spacing-vertical: 0.375rem;
3382
+ --pico-form-element-spacing-horizontal: 0.75rem;
3383
+ --pico-form-label-font-weight: 500;
3384
+ --pico-button-font-weight: 500;
3385
+ --pico-form-element-background-color: light-dark(#fff, rgb(28, 33, 43.5));
3386
+ --pico-card-border-color: var(--pico-muted-border-color);
3387
+ --pico-card-box-shadow:
3388
+ 0 0 0 var(--pico-border-width) var(--pico-card-border-color), 0 1px 2px rgba(0, 0, 0, 0.05);
3389
+ --pico-card-sectioning-background-color: var(--pico-card-background-color);
3917
3390
  }
3918
3391
 
3919
- body > main {
3920
- flex-grow: 1;
3921
- }
3922
-
3923
- body {
3924
- hyphens: auto;
3925
- text-wrap: pretty;
3392
+ /* Search fields keep their pill shape */
3393
+ [data-compact]:is([role="search"], [type="search"]) {
3394
+ --pico-border-radius: 5rem;
3926
3395
  }
3927
3396
 
3928
- body a,
3929
- body table {
3930
- hyphens: none;
3931
- }
3932
-
3933
- a:not([href^="#"]) {
3934
- text-decoration-thickness: 1px;
3935
- }
3936
-
3937
- a:not([href^="#"]):hover {
3938
- text-decoration-thickness: 2px;
3939
- }
3940
-
3941
- h1,
3942
- h2,
3943
- h3,
3944
- h4,
3945
- h5,
3946
- h6 {
3947
- text-wrap: balance;
3948
- }
3949
- h1 {
3950
- margin-bottom: 1rem; /* for tw-typography */
3951
- font-size: 2.5em; /* for pico.css & tw-typography */
3397
+ /* Page-level only: everything is sized in rem, so the root size can't change per element */
3398
+ :root[data-compact],
3399
+ :host([data-compact]) {
3400
+ --pico-font-size: 100%;
3952
3401
  }
3953
3402
 
3954
- hr {
3955
- margin-block: 2em; /* for pico.css & tw-typography */
3403
+ [data-compact] :is(h1, h2, h3, h4, h5, h6),
3404
+ :host([data-compact]) :is(h1, h2, h3, h4, h5, h6) {
3405
+ --pico-font-weight: 600;
3956
3406
  }
3957
3407
 
3958
- ul ul {
3959
- font-size: 87.5%;
3960
- }
3961
-
3962
- dl dt {
3963
- margin-block: 0.25rem;
3964
- font-weight: 500;
3965
- }
3966
-
3967
- dl dd {
3968
- margin-block-end: 1rem;
3969
- }
3970
-
3971
- pre small {
3972
- font-weight: lighter;
3973
- opacity: 75%;
3974
- }
3975
-
3976
- pre:has(code) {
3977
- background: #181c25 !important;
3978
- }
3979
-
3980
- table th {
3981
- font-weight: bold;
3982
- vertical-align: bottom;
3983
- }
3984
-
3985
- table td {
3986
- vertical-align: top;
3987
- }
3988
-
3989
- table pre {
3990
- margin-bottom: 0.25rem;
3991
- }
3992
-
3993
- [href="#top"] {
3994
- opacity: 25%;
3408
+ /* Keep helper text at the normal weight under the 500-weight labels */
3409
+ [data-compact] :where(input, select, textarea, fieldset, .grid) + small,
3410
+ :host([data-compact]) :where(input, select, textarea, fieldset, .grid) + small {
3411
+ font-weight: var(--pico-font-weight);
3995
3412
  }
3996
-
3997
- [href="#top"]:hover {
3998
- opacity: 75%;
3999
- }
4000
-
4001
- [href="#top"] > i {
4002
- display: inline-block;
4003
- margin: 0.5rem;
4004
- padding: 0.25rem 0.375rem;
4005
- border-color: black;
4006
- color: black;
4007
- font-size: 0.75rem;
4008
- }
4009
-
4010
- .breakout > img,
4011
- .breakout > figure,
4012
- .breakout-all > img,
4013
- .breakout-all > figure {
4014
- margin-bottom: 1rem;
4015
- }
4016
-
4017
- .faded a {
4018
- text-decoration-style: dotted;
4019
- }