@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
@@ -0,0 +1,210 @@
1
+ @layer blades {
2
+ /*!
3
+ * Float Label CSS v2 by Blades CSS 🥷🏷️
4
+ * Copyright 2016–2026 (https://blades.ninja/css/float-label/)
5
+ * Licensed under MIT
6
+ */
7
+ /*\3c !--section:docs-->
8
+
9
+ First, we target either:
10
+ 1. `<label>` which `:has` inner form inputs (classless approach)
11
+ 2. or explicit `.has-float-label` class (explicit approach)
12
+
13
+ ```css */
14
+ label:has(> span):has(
15
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
16
+ textarea,
17
+ select
18
+ ),
19
+ .has-float-label {
20
+ display: block;
21
+ position: relative;
22
+ /*```
23
+ Finally, we detect if placeholder is shown, but not in focus. That means we can safely hide it, and enlarge the float label instead:
24
+ ```css */
25
+ }
26
+ /*```
27
+ Then, we define the default/fallback state (when the float label should be minimized):
28
+ ```css */
29
+ label:has(> span):has(
30
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
31
+ textarea,
32
+ select
33
+ ) > span,
34
+ label:has(> span):has(
35
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
36
+ textarea,
37
+ select
38
+ ) label,
39
+ .has-float-label > span,
40
+ .has-float-label label {
41
+ position: absolute;
42
+ top: 0;
43
+ left: 0;
44
+ font-size: 75%;
45
+ cursor: text;
46
+ }
47
+ label:has(> span):has(
48
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
49
+ textarea,
50
+ select
51
+ ) *:placeholder-shown:not(:focus)::-moz-placeholder, .has-float-label *:placeholder-shown:not(:focus)::-moz-placeholder {
52
+ opacity: 0;
53
+ }
54
+ label:has(> span):has(
55
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
56
+ textarea,
57
+ select
58
+ ) *:-moz-placeholder:not(:focus)::placeholder, .has-float-label *:-moz-placeholder:not(:focus)::placeholder {
59
+ opacity: 0;
60
+ }
61
+ label:has(> span):has(
62
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
63
+ textarea,
64
+ select
65
+ ) *:placeholder-shown:not(:focus)::placeholder, .has-float-label *:placeholder-shown:not(:focus)::placeholder {
66
+ opacity: 0;
67
+ }
68
+ label:has(> span):has(
69
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
70
+ textarea,
71
+ select
72
+ ):has(*:-moz-placeholder:not(:focus)) > span, label:has(> span):has(
73
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
74
+ textarea,
75
+ select
76
+ ):has(*:-moz-placeholder:not(:focus)) label, .has-float-label:has(*:-moz-placeholder:not(:focus)) > span, .has-float-label:has(*:-moz-placeholder:not(:focus)) label {
77
+ font-size: inherit;
78
+ opacity: 50%;
79
+ }
80
+ label:has(> span):has(
81
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
82
+ textarea,
83
+ select
84
+ ):has(*:placeholder-shown:not(:focus)) > span,
85
+ label:has(> span):has(
86
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
87
+ textarea,
88
+ select
89
+ ):has(*:placeholder-shown:not(:focus)) label,
90
+ .has-float-label:has(*:placeholder-shown:not(:focus)) > span,
91
+ .has-float-label:has(*:placeholder-shown:not(:focus)) label {
92
+ font-size: inherit;
93
+ opacity: 50%;
94
+ }
95
+ /*```
96
+
97
+ The `:has(*:placeholder-shown:not(:focus))` trick allows this input state information to *propagate* to the parent level. This enables modern CSS to target inner float label (`<span>` or `<label>`) regardless of its position relative to the input field.
98
+
99
+ 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.
100
+
101
+ */
102
+ label:has(> span):has(
103
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
104
+ textarea,
105
+ select
106
+ ),
107
+ .has-float-label {
108
+
109
+ /* Enlarged state */
110
+ }
111
+ /* Default/fallback state */
112
+ label:has(> span):has(
113
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
114
+ textarea,
115
+ select
116
+ ) > span,
117
+ label:has(> span):has(
118
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
119
+ textarea,
120
+ select
121
+ ) label,
122
+ .has-float-label > span,
123
+ .has-float-label label {
124
+ padding-inline-start: calc(1rem + 1px); /* match Pico's padding + border */
125
+ padding-block-start: 0.25rem;
126
+ opacity: 75%;
127
+ transition: all 0.25s;
128
+ }
129
+ label:has(> span):has(
130
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
131
+ textarea,
132
+ select
133
+ ) input,
134
+ label:has(> span):has(
135
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
136
+ textarea,
137
+ select
138
+ ) textarea,
139
+ label:has(> span):has(
140
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
141
+ textarea,
142
+ select
143
+ ) select,
144
+ .has-float-label input,
145
+ .has-float-label textarea,
146
+ .has-float-label select {
147
+ margin-block-start: 0; /* reset Pico */
148
+ padding-inline-start: 1rem; /* match Pico */
149
+ padding-block: 1.125rem 0.375rem; /* match Pico's total: 2 x 0.75rem = 1.5rem */
150
+ }
151
+ label:has(> span):has(
152
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
153
+ textarea,
154
+ select
155
+ ) input::-moz-placeholder, label:has(> span):has(
156
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
157
+ textarea,
158
+ select
159
+ ) textarea::-moz-placeholder, label:has(> span):has(
160
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
161
+ textarea,
162
+ select
163
+ ) select::-moz-placeholder, .has-float-label input::-moz-placeholder, .has-float-label textarea::-moz-placeholder, .has-float-label select::-moz-placeholder {
164
+ opacity: 100%;
165
+ -moz-transition: all 0.25s;
166
+ transition: all 0.25s;
167
+ }
168
+ label:has(> span):has(
169
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
170
+ textarea,
171
+ select
172
+ ) input::placeholder, label:has(> span):has(
173
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
174
+ textarea,
175
+ select
176
+ ) textarea::placeholder, label:has(> span):has(
177
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
178
+ textarea,
179
+ select
180
+ ) select::placeholder, .has-float-label input::placeholder, .has-float-label textarea::placeholder, .has-float-label select::placeholder {
181
+ opacity: 100%;
182
+ transition: all 0.25s;
183
+ }
184
+ label:has(> span):has(
185
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
186
+ textarea,
187
+ select
188
+ ):has(*:-moz-placeholder:not(:focus)) > span, label:has(> span):has(
189
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
190
+ textarea,
191
+ select
192
+ ):has(*:-moz-placeholder:not(:focus)) label, .has-float-label:has(*:-moz-placeholder:not(:focus)) > span, .has-float-label:has(*:-moz-placeholder:not(:focus)) label {
193
+ padding-block: 0.75rem; /* match Pico */
194
+ }
195
+ label:has(> span):has(
196
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
197
+ textarea,
198
+ select
199
+ ):has(*:placeholder-shown:not(:focus)) > span,
200
+ label:has(> span):has(
201
+ input:not([type="checkbox"], [type="radio"], [type="range"]),
202
+ textarea,
203
+ select
204
+ ):has(*:placeholder-shown:not(:focus)) label,
205
+ .has-float-label:has(*:placeholder-shown:not(:focus)) > span,
206
+ .has-float-label:has(*:placeholder-shown:not(:focus)) label {
207
+ padding-block: 0.75rem; /* match Pico */
208
+ }
209
+
210
+ }
@@ -0,0 +1,30 @@
1
+ @layer blades {
2
+ /*\3c !--section:docs-->
3
+
4
+ `.columns` automatically creates columns with at least 30 characters each:
5
+
6
+ <article class="columns">
7
+ <p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p>
8
+ </article>
9
+
10
+ The smaller the font size, the more columns will be created:
11
+
12
+ <article class="columns" style="font-size: 65%">
13
+ <p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7</p><p>8</p><p>9</p>
14
+ </article>
15
+
16
+ Useful for tables of contents and long lists.
17
+
18
+ \3c !--section:code-->
19
+ ```css */
20
+ .columns {
21
+ -moz-columns: 25ch auto;
22
+ columns: 25ch auto; /* common container 65ch / 25ch => 2 columns max, with a buffer for list paddings */
23
+ }
24
+ /* Avoid breaking inside elements, such as nested lists */
25
+ .columns > * {
26
+ -moz-column-break-inside: avoid;
27
+ break-inside: avoid;
28
+ }
29
+
30
+ }
@@ -0,0 +1,23 @@
1
+ @layer blades {
2
+ :scope,
3
+ :host {
4
+ /**
5
+ * Design Tokens !!! NAMING NOT FINALIZED YET !!!
6
+ * `--in-pico: *` props below are for reference only (not to be used)
7
+ */
8
+ --blades-token-primary: var(--pico-primary, dodgerblue);
9
+ --in-pico: #01aaff;
10
+ --blades-token-secondary: var(--pico-secondary, lightslategray);
11
+ --in-pico: #969eaf;
12
+
13
+ /**
14
+ * Inherited Variables
15
+ */
16
+ --blades-timeline-border-color: color-mix(
17
+ in srgb,
18
+ var(--blades-token-secondary) 50%,
19
+ transparent
20
+ );
21
+ }
22
+
23
+ }
@@ -2400,7 +2400,11 @@ label > details.dropdown {
2400
2400
  --pico-loading-spinner-opacity: 0.5;
2401
2401
  }
2402
2402
 
2403
- [aria-busy="true"]:not(input, select, textarea, html, form) {
2403
+ [aria-busy="true"]:not(input, select, textarea, html, form):not(
2404
+ :where(button, [type="submit"], [type="button"], [type="reset"], [role="button"])
2405
+ ) {
2406
+ /* :where() zeroes the specificity of the button list inside :not(), so this rule stays
2407
+ * low-specificity and doesn't override the more specific button rules below */
2404
2408
  white-space: nowrap;
2405
2409
  }
2406
2410
  [aria-busy="true"]:not(input, select, textarea, html, form)::before {
@@ -2429,6 +2433,19 @@ a[aria-busy="true"] {
2429
2433
  pointer-events: none;
2430
2434
  }
2431
2435
 
2436
+ /* Buttons keep their size: the label stays in place but hidden, the spinner sits on top */
2437
+ 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) {
2438
+ position: relative;
2439
+ color: transparent;
2440
+ }
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
+ opacity: 0;
2443
+ }
2444
+ 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 {
2445
+ position: absolute;
2446
+ margin: auto;
2447
+ inset: 0;
2448
+ }
2432
2449
  /**
2433
2450
  * Modal (<dialog>)
2434
2451
  */