@anyblades/blades 3.1.0-beta.2 → 3.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.
Files changed (47) hide show
  1. package/README.md +21 -18
  2. package/css/blades.css +148 -1
  3. package/css/blades.min.css +4 -174
  4. package/css/blades.ninja.css +148 -1
  5. package/css/blades.ninja.min.css +4 -182
  6. package/css/float-label.min.css +2 -51
  7. package/css/layered/blades.layered.css +148 -1
  8. package/css/layered/blades.layered.min.css +4 -174
  9. package/css/layered/components/dropdown-popover.css +107 -0
  10. package/css/layered/components/loading.css +19 -1
  11. package/css/layered/components/modal-modern.css +28 -0
  12. package/css/layered/components/timeline.css +24 -0
  13. package/css/layered/components.css +18 -1
  14. package/css/layered/content/code-block.css +32 -0
  15. package/css/layered/content/icon.css +60 -0
  16. package/css/layered/forms/float-label/core.css +103 -0
  17. package/css/layered/forms/float-label/theme.css +110 -0
  18. package/css/layered/forms/float-label.css +210 -0
  19. package/css/layered/layout/columns.css +30 -0
  20. package/css/layered/variables-blades.css +23 -0
  21. package/css/pico.conditional.css +18 -1
  22. package/css/pico.conditional.min.css +2 -111
  23. package/css/pico.css +18 -1
  24. package/css/pico.min.css +2 -111
  25. package/package.json +7 -7
  26. package/src/blades/_index.css +11 -6
  27. package/src/blades/components/_dropdown-popover.css +107 -0
  28. package/src/blades/components/_modal-modern.css +26 -0
  29. package/src/blades.css +0 -1
  30. package/src/float-label.css +1 -1
  31. package/src/ninja/LICENSE +22 -0
  32. package/src/ninja/README.md +1 -0
  33. package/src/ninja/_index.css +1 -1
  34. package/src/pico/components/_loading.css +27 -1
  35. package/_includes/blades/links.liquid +0 -21
  36. package/_includes/blades/links.njk +0 -9
  37. package/_includes/blades/links.twig +0 -18
  38. /package/src/{_compact.css → blades/_compact.css} +0 -0
  39. /package/src/blades/{_variables.css → _variables-blades.css} +0 -0
  40. /package/src/blades/{_timeline.css → components/_timeline.css} +0 -0
  41. /package/src/blades/{_code.css → content/_code-block.css} +0 -0
  42. /package/src/blades/{_icon.css → content/_icon.css} +0 -0
  43. /package/src/blades/{float-label → forms/float-label}/_core.css +0 -0
  44. /package/src/blades/{float-label → forms/float-label}/_index.css +0 -0
  45. /package/src/blades/{float-label → forms/float-label}/_theme.css +0 -0
  46. /package/src/blades/{_columns.css → layout/_columns.css} +0 -0
  47. /package/src/ninja/{_page-anchors.css → _scroll-to.css} +0 -0
@@ -2,54 +2,5 @@
2
2
  * Float Label CSS v2 by Blades CSS 🥷🏷️
3
3
  * Copyright 2016–2026 (https://blades.ninja/css/float-label/)
4
4
  * Licensed under MIT
5
- */.has-float-label,label:has(> span):has(
6
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
7
- ){display:block;position:relative}.has-float-label label,.has-float-label>span,label:has(> span):has(
8
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
9
- ) label,label:has(> span):has(
10
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
11
- )>span{position:absolute;top:0;left:0;font-size:75%;cursor:text}.has-float-label :placeholder-shown:not(:focus)::-moz-placeholder,label:has(> span):has(
12
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
13
- ) :placeholder-shown:not(:focus)::-moz-placeholder{opacity:0}.has-float-label :-moz-placeholder:not(:focus)::placeholder,label:has(> span):has(
14
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
15
- ) :-moz-placeholder:not(:focus)::placeholder{opacity:0}.has-float-label :placeholder-shown:not(:focus)::placeholder,label:has(> span):has(
16
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
17
- ) :placeholder-shown:not(:focus)::placeholder{opacity:0}.has-float-label:has(:-moz-placeholder:not(:focus)) label,.has-float-label:has(:-moz-placeholder:not(:focus))>span,label:has(> span):has(
18
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
19
- ):has(:-moz-placeholder:not(:focus)) label,label:has(> span):has(
20
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
21
- ):has(:-moz-placeholder:not(:focus))>span{font-size:inherit;opacity:50%}.has-float-label:has(:placeholder-shown:not(:focus)) label,.has-float-label:has(:placeholder-shown:not(:focus))>span,label:has(> span):has(
22
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
23
- ):has(:placeholder-shown:not(:focus)) label,label:has(> span):has(
24
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
25
- ):has(:placeholder-shown:not(:focus))>span{font-size:inherit;opacity:50%}.has-float-label label,.has-float-label>span,label:has(> span):has(
26
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
27
- ) label,label:has(> span):has(
28
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
29
- )>span{padding-inline-start:calc(1rem + 1px);padding-block-start:0.25rem;opacity:75%;transition:all .25s}.has-float-label input,.has-float-label select,.has-float-label textarea,label:has(> span):has(
30
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
31
- ) input,label:has(> span):has(
32
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
33
- ) select,label:has(> span):has(
34
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
35
- ) textarea{margin-block-start:0;padding-inline-start:1rem;padding-block:1.125rem 0.375rem}.has-float-label input::-moz-placeholder,.has-float-label select::-moz-placeholder,.has-float-label textarea::-moz-placeholder,label:has(> span):has(
36
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
37
- ) input::-moz-placeholder,label:has(> span):has(
38
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
39
- ) select::-moz-placeholder,label:has(> span):has(
40
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
41
- ) textarea::-moz-placeholder{opacity:100%;-moz-transition:all .25s;transition:all .25s}.has-float-label input::placeholder,.has-float-label select::placeholder,.has-float-label textarea::placeholder,label:has(> span):has(
42
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
43
- ) input::placeholder,label:has(> span):has(
44
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
45
- ) select::placeholder,label:has(> span):has(
46
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
47
- ) textarea::placeholder{opacity:100%;transition:all .25s}.has-float-label:has(:-moz-placeholder:not(:focus)) label,.has-float-label:has(:-moz-placeholder:not(:focus))>span,label:has(> span):has(
48
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
49
- ):has(:-moz-placeholder:not(:focus)) label,label:has(> span):has(
50
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
51
- ):has(:-moz-placeholder:not(:focus))>span{padding-block:0.75rem}.has-float-label:has(:placeholder-shown:not(:focus)) label,.has-float-label:has(:placeholder-shown:not(:focus))>span,label:has(> span):has(
52
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
53
- ):has(:placeholder-shown:not(:focus)) label,label:has(> span):has(
54
- input:not([type=checkbox],[type=radio],[type=range]),textarea,select
55
- ):has(:placeholder-shown:not(:focus))>span{padding-block:0.75rem}
5
+ */
6
+ label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select),.has-float-label{display:block;position:relative}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select)>span,label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) label,.has-float-label>span,.has-float-label label{cursor:text;font-size:75%;position:absolute;top:0;left:0}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) :placeholder-shown:not(:focus)::-moz-placeholder,.has-float-label :placeholder-shown:not(:focus)::-moz-placeholder{opacity:0}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) :-moz-placeholder-shown:not(:focus)::placeholder,.has-float-label :-moz-placeholder-shown:not(:focus)::placeholder{opacity:0}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) :placeholder-shown:not(:focus)::placeholder,.has-float-label :placeholder-shown:not(:focus)::placeholder{opacity:0}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select):has(:placeholder-shown:not(:focus))>span,label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select):has(:placeholder-shown:not(:focus)) label,.has-float-label:has(:placeholder-shown:not(:focus))>span,.has-float-label:has(:placeholder-shown:not(:focus)) label{font-size:inherit;opacity:.5}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select):has(:placeholder-shown:not(:focus))>span,label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select):has(:placeholder-shown:not(:focus)) label,.has-float-label:has(:placeholder-shown:not(:focus))>span,.has-float-label:has(:placeholder-shown:not(:focus)) label{font-size:inherit;opacity:.5}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select)>span,label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) label,.has-float-label>span,.has-float-label label{opacity:.75;padding-block-start:.25rem;padding-inline-start:calc(1rem + 1px);transition:all .25s}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) input,label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) textarea,label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) select,.has-float-label input,.has-float-label textarea,.has-float-label select{margin-block-start:0;padding-block:1.125rem .375rem;padding-inline-start:1rem}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{opacity:1;-moz-transition:all .25s;transition:all .25s}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{opacity:1;transition:all .25s}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select):has(:placeholder-shown:not(:focus))>span,label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select):has(:placeholder-shown:not(:focus)) label,.has-float-label:has(:placeholder-shown:not(:focus))>span,.has-float-label:has(:placeholder-shown:not(:focus)) label{padding-block:.75rem}label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select):has(:placeholder-shown:not(:focus))>span,label:has(>span):has(input:not([type=checkbox],[type=radio],[type=range]),textarea,select):has(:placeholder-shown:not(:focus)) label,.has-float-label:has(:placeholder-shown:not(:focus))>span,.has-float-label:has(:placeholder-shown:not(:focus)) label{padding-block:.75rem}
@@ -2404,7 +2404,11 @@ label > details.dropdown {
2404
2404
  --pico-loading-spinner-opacity: 0.5;
2405
2405
  }
2406
2406
 
2407
- [aria-busy="true"]:not(input, select, textarea, html, form) {
2407
+ [aria-busy="true"]:not(input, select, textarea, html, form):not(
2408
+ :where(button, [type="submit"], [type="button"], [type="reset"], [role="button"])
2409
+ ) {
2410
+ /* :where() zeroes the specificity of the button list inside :not(), so this rule stays
2411
+ * low-specificity and doesn't override the more specific button rules below */
2408
2412
  white-space: nowrap;
2409
2413
  }
2410
2414
  [aria-busy="true"]:not(input, select, textarea, html, form)::before {
@@ -2433,6 +2437,19 @@ a[aria-busy="true"] {
2433
2437
  pointer-events: none;
2434
2438
  }
2435
2439
 
2440
+ /* Buttons keep their size: the label stays in place but hidden, the spinner sits on top */
2441
+ button[aria-busy="true"]:not(:empty), [type="submit"][aria-busy="true"]:not(:empty), [type="button"][aria-busy="true"]:not(:empty), [type="reset"][aria-busy="true"]:not(:empty), [role="button"][aria-busy="true"]:not(:empty) {
2442
+ position: relative;
2443
+ color: transparent;
2444
+ }
2445
+ button[aria-busy="true"]:not(:empty) > *, [type="submit"][aria-busy="true"]:not(:empty) > *, [type="button"][aria-busy="true"]:not(:empty) > *, [type="reset"][aria-busy="true"]:not(:empty) > *, [role="button"][aria-busy="true"]:not(:empty) > * {
2446
+ opacity: 0;
2447
+ }
2448
+ button[aria-busy="true"]:not(:empty)::before, [type="submit"][aria-busy="true"]:not(:empty)::before, [type="button"][aria-busy="true"]:not(:empty)::before, [type="reset"][aria-busy="true"]:not(:empty)::before, [role="button"][aria-busy="true"]:not(:empty)::before {
2449
+ position: absolute;
2450
+ margin: auto;
2451
+ inset: 0;
2452
+ }
2436
2453
  /**
2437
2454
  * Modal (<dialog>)
2438
2455
  */
@@ -3282,6 +3299,31 @@ label:has(> span):has(
3282
3299
  padding-block: 0.75rem; /* match Pico */
3283
3300
  }
3284
3301
  /* Components */
3302
+ /*\3c !--section:docs-->
3303
+
3304
+ A `<dialog>` opened with `dialog.showModal()` fades in and its `<article>` zooms in, without JS classes.
3305
+ Pico's modal JS (`.modal-is-open`, `.modal-is-opening`, `.modal-is-closing`) still works on top of it.
3306
+
3307
+ - `dialog.close()` closes it at once, as before.
3308
+ - `<dialog open>` in markup and non-modal `dialog.show()` aren't animated.
3309
+ - Browsers without `@starting-style`, and reduced motion, open it at once.
3310
+
3311
+ \3c !--section:code-->```css */
3312
+ dialog:modal {
3313
+ transition: opacity var(--pico-transition);
3314
+ }
3315
+ dialog:modal > article {
3316
+ transition: transform var(--pico-transition);
3317
+ }
3318
+ @starting-style {
3319
+ dialog:modal {
3320
+ opacity: 0;
3321
+ }
3322
+
3323
+ dialog:modal > article {
3324
+ transform: scale(0.96);
3325
+ }
3326
+ }
3285
3327
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
3286
3328
  \3c !--section:code-->
3287
3329
  ```css */
@@ -3341,6 +3383,110 @@ How we made it: https://codepen.io/editor/anydigital/pen/019d2b94-5616-75dc-a23e
3341
3383
  \3c !--section--> */
3342
3384
  /*\3c !--section:docs-->
3343
3385
 
3386
+ A `<ul>` or `<menu>` with the `popover` attribute is styled like a dropdown and opens next to the button
3387
+ that toggles it, with no JS:
3388
+
3389
+ ```html
3390
+ <button popovertarget="actions">Actions</button>
3391
+ <ul id="actions" popover>
3392
+ <li><a href="#">Edit</a></li>
3393
+ <li><a href="#">Duplicate</a></li>
3394
+ </ul>
3395
+ ```
3396
+
3397
+ - Clicking outside or pressing Esc closes it, and it's drawn on top of everything (no `z-index`, no clipping by `overflow`).
3398
+ - It opens below the button (on the reading side, also in RTL) and flips when there's no room.
3399
+ Open it with `popovertarget`, `commandfor` or `showPopover({ source })`, so it knows its button.
3400
+ - Browsers without CSS anchor positioning show it in the middle of the screen instead, like a plain popover.
3401
+ - It uses the dropdown colours (`--pico-dropdown-*`, from `components/dropdown`).
3402
+
3403
+ \3c !--section:code-->```css */
3404
+ :is(ul, menu)[popover] {
3405
+ min-width: -moz-fit-content;
3406
+ min-width: fit-content;
3407
+ margin: auto;
3408
+ padding: 0;
3409
+ border: var(--pico-border-width) solid var(--pico-dropdown-border-color);
3410
+ border-radius: var(--pico-border-radius);
3411
+ background-color: var(--pico-dropdown-background-color);
3412
+ box-shadow: var(--pico-dropdown-box-shadow);
3413
+ color: var(--pico-dropdown-color);
3414
+ white-space: nowrap;
3415
+ opacity: 0;
3416
+ transition:
3417
+ opacity var(--pico-transition),
3418
+ overlay var(--pico-transition) allow-discrete,
3419
+ display var(--pico-transition) allow-discrete;
3420
+ }
3421
+ /* Beats `nav ul` / `aside ul`, which would otherwise show the closed menu */
3422
+ :is(ul, menu)[popover]:not(:popover-open) {
3423
+ display: none;
3424
+ }
3425
+ :is(ul, menu)[popover]:popover-open {
3426
+ display: block;
3427
+ opacity: 1;
3428
+ }
3429
+ :is(ul, menu)[popover] li {
3430
+ display: block;
3431
+ margin-bottom: 0;
3432
+ padding: calc(var(--pico-form-element-spacing-vertical) * 0.5)
3433
+ var(--pico-form-element-spacing-horizontal);
3434
+ list-style: none;
3435
+ }
3436
+ :is(ul, menu)[popover] li:first-of-type {
3437
+ margin-top: calc(var(--pico-form-element-spacing-vertical) * 0.5);
3438
+ }
3439
+ :is(ul, menu)[popover] li:last-of-type {
3440
+ margin-bottom: calc(var(--pico-form-element-spacing-vertical) * 0.5);
3441
+ }
3442
+ :is(ul, menu)[popover] li:has(label):hover {
3443
+ background-color: var(--pico-dropdown-hover-background-color);
3444
+ }
3445
+ :is(ul, menu)[popover] li a {
3446
+ display: block;
3447
+ margin: calc(var(--pico-form-element-spacing-vertical) * -0.5)
3448
+ calc(var(--pico-form-element-spacing-horizontal) * -1);
3449
+ padding: calc(var(--pico-form-element-spacing-vertical) * 0.5)
3450
+ var(--pico-form-element-spacing-horizontal);
3451
+ overflow: hidden;
3452
+ border-radius: 0;
3453
+ color: var(--pico-dropdown-color);
3454
+ text-decoration: none;
3455
+ text-overflow: ellipsis;
3456
+ }
3457
+ :is(ul, menu)[popover] li a:is(:hover, :focus, :active, :focus-visible, [aria-current]:not([aria-current="false"])) {
3458
+ background-color: var(--pico-dropdown-hover-background-color);
3459
+ }
3460
+ :is(ul, menu)[popover] li label {
3461
+ width: 100%;
3462
+ }
3463
+ /* Beats Pico's `nav ul:first-of-type` / `:last-of-type` margins whatever the load order (soft win via :not) */
3464
+ nav :is(ul, menu)[popover]:not(.does-not-exist) {
3465
+ margin: auto;
3466
+ }
3467
+ @starting-style {
3468
+ :is(ul, menu)[popover]:popover-open {
3469
+ opacity: 0;
3470
+ }
3471
+ }
3472
+
3473
+ /* Next to the button that opened it (its implicit anchor) */
3474
+ @supports (position-area: bottom) {
3475
+ :is(ul, menu)[popover],
3476
+ nav :is(ul, menu)[popover]:not(.does-not-exist) {
3477
+ position-area: bottom span-right;
3478
+ position-try-fallbacks: flip-block, flip-inline;
3479
+ margin: 0;
3480
+ margin-top: var(--pico-outline-width);
3481
+ inset: auto;
3482
+ }
3483
+
3484
+ :is(ul, menu)[popover]:dir(rtl), nav :is(ul, menu)[popover]:not(.does-not-exist):dir(rtl) {
3485
+ position-area: bottom span-left;
3486
+ }
3487
+ }
3488
+ /*\3c !--section:docs-->
3489
+
3344
3490
  Use `dl.timeline` or wrap a `<dl>` with `.has-timeline` to style it as a
3345
3491
  vertical timeline — each `<dd>` gets a left border strip acting as the track:
3346
3492
 
@@ -3360,6 +3506,7 @@ dl.timeline dd, .has-timeline > dl dd {
3360
3506
  padding: 0.25rem 0 0.75rem 1rem;
3361
3507
  border-inline-start: 0.25rem solid var(--blades-timeline-border-color);
3362
3508
  }
3509
+ /* Compact version (opt-in via `data-compact` attr anywhere) */
3363
3510
  /*
3364
3511
  * Compact: opt-in denser sizing and a more current look, applied under `data-compact` on
3365
3512
  * <html> (whole page) or on any element such as a single <form>. Without the attribute it