@anyblades/blades 3.1.0-alpha.2 → 3.1.0-beta.4
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.
- package/README.md +48 -23
- package/css/blades.css +301 -593
- package/css/blades.min.css +4 -148
- package/css/blades.ninja.css +4204 -0
- package/css/blades.ninja.min.css +12 -0
- package/css/float-label.css +207 -0
- package/css/float-label.min.css +6 -0
- package/css/{pico.layered.css → layered/blades.layered.css} +589 -17
- package/css/layered/blades.layered.min.css +14 -0
- package/css/layered/compact.css +54 -0
- package/css/layered/components/accordion.css +85 -0
- package/css/layered/components/card.css +48 -0
- package/css/layered/components/dropdown.css +191 -0
- package/css/layered/components/group.css +208 -0
- package/css/layered/components/loading.css +61 -0
- package/css/layered/components/modal.css +158 -0
- package/css/layered/components/nav.css +117 -0
- package/css/layered/components/progress.css +76 -0
- package/css/layered/components/tooltip.css +176 -0
- package/css/layered/components.css +1099 -0
- package/css/layered/content/button.css +208 -0
- package/css/layered/content/code.css +64 -0
- package/css/layered/content/embedded-content.css +41 -0
- package/css/layered/content/figure.css +15 -0
- package/css/layered/content/link.css +84 -0
- package/css/layered/content/misc.css +22 -0
- package/css/layered/content/table.css +33 -0
- package/css/layered/content/typography.css +159 -0
- package/css/layered/content.css +611 -0
- package/css/layered/forms/basics.css +338 -0
- package/css/layered/forms/checkbox-radio-switch.css +164 -0
- package/css/layered/forms/input-color.css +20 -0
- package/css/layered/forms/input-datetime.css +57 -0
- package/css/layered/forms/input-file.css +29 -0
- package/css/layered/forms/input-range.css +121 -0
- package/css/layered/forms/input-search.css +66 -0
- package/css/layered/forms.css +778 -0
- package/css/layered/layout/container.css +42 -0
- package/css/layered/layout/document.css +48 -0
- package/css/layered/layout/grid.css +22 -0
- package/css/layered/layout/landmarks.css +12 -0
- package/css/layered/layout/overflow-auto.css +9 -0
- package/css/layered/layout/section.css +9 -0
- package/css/layered/layout.css +119 -0
- package/css/layered/utilities.css +35 -0
- package/css/layered/variables.css +365 -0
- package/css/pico.conditional.css +34 -16
- package/css/pico.conditional.min.css +2 -111
- package/css/pico.css +34 -16
- package/css/pico.min.css +2 -111
- package/package.json +16 -12
- package/src/blades/_compact.css +51 -0
- package/src/blades/_dropdown-popover.css +107 -0
- package/src/blades/_index.css +28 -0
- package/src/blades/_modal.css +26 -0
- package/src/blades/float-label/_index.css +2 -0
- package/src/{standalone/forms/_float-label.theme.css → blades/float-label/_theme.css} +5 -1
- package/src/blades.css +2 -2
- package/src/blades.ninja.css +3 -0
- package/src/float-label.css +1 -0
- package/src/ninja/LICENSE +22 -0
- package/src/ninja/README.md +1 -0
- package/src/ninja/_index.css +19 -0
- package/src/{standalone → ninja}/_theme.css +0 -2
- package/src/{ninja.css → ninja/_utilities.css} +55 -6
- package/src/pico/_variables.css +6 -5
- package/src/pico/components/_loading.css +27 -1
- package/src/pico/content/_button.css +1 -1
- package/src/pico/layout/_document.css +9 -0
- package/src/pico/layout/_index.css +0 -1
- package/src/pico/layout/_landmarks.css +1 -9
- package/src/pico.css +1 -0
- package/css/blades.standalone.css +0 -860
- package/css/blades.standalone.min.css +0 -37
- package/css/ninja.css +0 -83
- package/css/ninja.min.css +0 -5
- package/css/pico.layered.min.css +0 -118
- package/src/blades.standalone.css +0 -2
- package/src/standalone/_core.css +0 -32
- package/src/standalone/_utilities.css +0 -55
- package/src/standalone/forms/_float-label.css +0 -2
- /package/src/{standalone/content → blades}/_code.css +0 -0
- /package/src/{standalone/layout → blades}/_columns.css +0 -0
- /package/src/{standalone/components/_icon-helper.css → blades/_icon.css} +0 -0
- /package/src/{standalone/components → blades}/_timeline.css +0 -0
- /package/src/{standalone → blades}/_variables.css +0 -0
- /package/src/{standalone/forms/_float-label.core.css → blades/float-label/_core.css} +0 -0
- /package/src/{standalone/layout/_breakout.css → ninja/_container-breakout.css} +0 -0
- /package/src/{standalone/content/_typography.css → ninja/_heading-anchor.css} +0 -0
- /package/src/{standalone/content/_list.css → ninja/_list-helpers.css} +0 -0
- /package/src/{standalone/layout/_scroller.css → ninja/_page-anchors.css} +0 -0
- /package/src/{standalone/content/_table.css → ninja/_table-helpers.css} +0 -0
- /package/src/{standalone/content → ninja}/_table-responsive.css +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
@layer
|
|
1
|
+
@layer blades {
|
|
2
2
|
/*!
|
|
3
|
+
* Blades CSS v3 with Pico CSS 🥷✨
|
|
4
|
+
* Copyright 2026 (https://blades.ninja/)
|
|
5
|
+
* Licensed under MIT
|
|
6
|
+
*//*!
|
|
3
7
|
* Blades CSS' Pico fork v2.5 🥷✨
|
|
4
8
|
* Copyright 2019-2025 (https://picocss.com)
|
|
5
9
|
* Copyright 2026 (https://blades.ninja/css/pico/)
|
|
@@ -231,7 +235,8 @@ details summary[role="button"]:not(.outline)::after {
|
|
|
231
235
|
--pico-primary-hover-background: light-dark(#02659a, #017fc0);
|
|
232
236
|
--pico-primary-hover-border: var(--pico-primary-hover-background);
|
|
233
237
|
--pico-primary-hover-underline: var(--pico-primary-hover);
|
|
234
|
-
|
|
238
|
+
/* Focus rings are opaque: at 25–50% alpha they composite below 3:1 (SC 1.4.11), see #167 */
|
|
239
|
+
--pico-primary-focus: light-dark(rgb(2, 138, 212), rgb(1, 170, 255));
|
|
235
240
|
--pico-primary-inverse: #fff;
|
|
236
241
|
--pico-secondary: light-dark(#5d6b89, #969eaf);
|
|
237
242
|
--pico-secondary-background: #525f7a;
|
|
@@ -241,7 +246,7 @@ details summary[role="button"]:not(.outline)::after {
|
|
|
241
246
|
--pico-secondary-hover-background: light-dark(#48536b, #5d6b89);
|
|
242
247
|
--pico-secondary-hover-border: var(--pico-secondary-hover-background);
|
|
243
248
|
--pico-secondary-hover-underline: var(--pico-secondary-hover);
|
|
244
|
-
--pico-secondary-focus: light-dark(
|
|
249
|
+
--pico-secondary-focus: light-dark(rgb(93, 107, 137), rgb(144, 158, 190));
|
|
245
250
|
--pico-secondary-inverse: #fff;
|
|
246
251
|
--pico-contrast: light-dark(#181c25, #dfe3eb);
|
|
247
252
|
--pico-contrast-background: light-dark(#181c25, #eff1f4);
|
|
@@ -254,7 +259,7 @@ details summary[role="button"]:not(.outline)::after {
|
|
|
254
259
|
var(--pico-secondary-hover),
|
|
255
260
|
var(--pico-contrast-hover)
|
|
256
261
|
);
|
|
257
|
-
--pico-contrast-focus: light-dark(
|
|
262
|
+
--pico-contrast-focus: light-dark(rgb(93, 107, 137), rgb(207, 213, 226));
|
|
258
263
|
--pico-contrast-inverse: light-dark(#fff, #000);
|
|
259
264
|
--pico-box-shadow: 0 0.5rem 2.5rem light-dark(rgba(129, 145, 181, 0.2), rgba(7, 8.5, 12, 0.2));
|
|
260
265
|
--pico-h1-color: light-dark(#2d3138, #f0f1f3);
|
|
@@ -288,11 +293,11 @@ details summary[role="button"]:not(.outline)::after {
|
|
|
288
293
|
--pico-form-element-disabled-opacity: 0.5;
|
|
289
294
|
--pico-form-element-invalid-border-color: light-dark(
|
|
290
295
|
rgb(183.5, 105.5, 106.5),
|
|
291
|
-
rgb(
|
|
296
|
+
rgb(200.25, 79.25, 72.25)
|
|
292
297
|
);
|
|
293
298
|
--pico-form-element-invalid-active-border-color: light-dark(
|
|
294
299
|
rgb(200.25, 79.25, 72.25),
|
|
295
|
-
rgb(
|
|
300
|
+
rgb(214, 92, 86)
|
|
296
301
|
);
|
|
297
302
|
--pico-form-element-invalid-focus-color: var(--pico-form-element-invalid-active-border-color);
|
|
298
303
|
--pico-form-element-valid-border-color: light-dark(rgb(76, 154.5, 137.5), #2a7b6f);
|
|
@@ -403,9 +408,6 @@ progress,
|
|
|
403
408
|
tab-size: 4;
|
|
404
409
|
}
|
|
405
410
|
|
|
406
|
-
/**
|
|
407
|
-
* Landmarks
|
|
408
|
-
*/
|
|
409
411
|
body {
|
|
410
412
|
width: 100%;
|
|
411
413
|
margin: 0;
|
|
@@ -415,12 +417,6 @@ main {
|
|
|
415
417
|
display: block;
|
|
416
418
|
}
|
|
417
419
|
|
|
418
|
-
body > header,
|
|
419
|
-
body > main,
|
|
420
|
-
body > footer {
|
|
421
|
-
padding-block: var(--pico-block-spacing-vertical);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
420
|
/**
|
|
425
421
|
* Section
|
|
426
422
|
*/
|
|
@@ -764,7 +760,7 @@ button,
|
|
|
764
760
|
background-color: var(--pico-background-color);
|
|
765
761
|
box-shadow: var(--pico-box-shadow);
|
|
766
762
|
color: var(--pico-color);
|
|
767
|
-
font-weight: var(--pico-font-weight);
|
|
763
|
+
font-weight: var(--pico-button-font-weight, var(--pico-font-weight));
|
|
768
764
|
font-size: 1rem;
|
|
769
765
|
line-height: var(--pico-line-height);
|
|
770
766
|
text-align: center;
|
|
@@ -2408,7 +2404,11 @@ label > details.dropdown {
|
|
|
2408
2404
|
--pico-loading-spinner-opacity: 0.5;
|
|
2409
2405
|
}
|
|
2410
2406
|
|
|
2411
|
-
[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 */
|
|
2412
2412
|
white-space: nowrap;
|
|
2413
2413
|
}
|
|
2414
2414
|
[aria-busy="true"]:not(input, select, textarea, html, form)::before {
|
|
@@ -2437,6 +2437,19 @@ a[aria-busy="true"] {
|
|
|
2437
2437
|
pointer-events: none;
|
|
2438
2438
|
}
|
|
2439
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
|
+
}
|
|
2440
2453
|
/**
|
|
2441
2454
|
* Modal (<dialog>)
|
|
2442
2455
|
*/
|
|
@@ -2986,5 +2999,564 @@ progress::-moz-progress-bar {
|
|
|
2986
2999
|
transition-duration: 0s !important;
|
|
2987
3000
|
}
|
|
2988
3001
|
}
|
|
3002
|
+
/*!
|
|
3003
|
+
* Blades CSS standalone kit v3 🥷
|
|
3004
|
+
* Copyright 2026 (https://blades.ninja/css/standalone/)
|
|
3005
|
+
* Licensed under MIT
|
|
3006
|
+
*/
|
|
3007
|
+
/*\3c !--section:code-->```css */
|
|
3008
|
+
|
|
3009
|
+
/* Follows https://github.com/picocss/pico/blob/main/scss/_index.scss */
|
|
3010
|
+
|
|
3011
|
+
:scope,
|
|
3012
|
+
:host {
|
|
3013
|
+
/**
|
|
3014
|
+
* Design Tokens !!! NAMING NOT FINALIZED YET !!!
|
|
3015
|
+
* `--in-pico: *` props below are for reference only (not to be used)
|
|
3016
|
+
*/
|
|
3017
|
+
--blades-token-primary: var(--pico-primary, dodgerblue);
|
|
3018
|
+
--in-pico: #01aaff;
|
|
3019
|
+
--blades-token-secondary: var(--pico-secondary, lightslategray);
|
|
3020
|
+
--in-pico: #969eaf;
|
|
3021
|
+
|
|
3022
|
+
/**
|
|
3023
|
+
* Inherited Variables
|
|
3024
|
+
*/
|
|
3025
|
+
--blades-timeline-border-color: color-mix(
|
|
3026
|
+
in srgb,
|
|
3027
|
+
var(--blades-token-secondary) 50%,
|
|
3028
|
+
transparent
|
|
3029
|
+
);
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
/* Layout */
|
|
3033
|
+
|
|
3034
|
+
/*\3c !--section:docs-->
|
|
3035
|
+
|
|
3036
|
+
`.columns` automatically creates columns with at least 30 characters each:
|
|
3037
|
+
|
|
3038
|
+
<article class="columns">
|
|
3039
|
+
<p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p>
|
|
3040
|
+
</article>
|
|
3041
|
+
|
|
3042
|
+
The smaller the font size, the more columns will be created:
|
|
3043
|
+
|
|
3044
|
+
<article class="columns" style="font-size: 65%">
|
|
3045
|
+
<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>
|
|
3046
|
+
</article>
|
|
3047
|
+
|
|
3048
|
+
Useful for tables of contents and long lists.
|
|
3049
|
+
|
|
3050
|
+
\3c !--section:code-->
|
|
3051
|
+
```css */
|
|
3052
|
+
.columns {
|
|
3053
|
+
-moz-columns: 25ch auto;
|
|
3054
|
+
columns: 25ch auto; /* common container 65ch / 25ch => 2 columns max, with a buffer for list paddings */
|
|
3055
|
+
}
|
|
3056
|
+
/* Avoid breaking inside elements, such as nested lists */
|
|
3057
|
+
.columns > * {
|
|
3058
|
+
-moz-column-break-inside: avoid;
|
|
3059
|
+
break-inside: avoid;
|
|
3060
|
+
}
|
|
3061
|
+
/* Content */
|
|
3062
|
+
/*\3c !--section:docs-->
|
|
3063
|
+
|
|
3064
|
+
The `<pre><code>` blocks are Prism-compatible and support captions via `data-caption="..."` attribute:
|
|
3065
|
+
|
|
3066
|
+
```treeview {data-caption="Blades CSS ships:"}
|
|
3067
|
+
/css/
|
|
3068
|
+
├── blades.css (Pico CSS successor)
|
|
3069
|
+
├── blades.standalone.css (framework-agnostic)
|
|
3070
|
+
├── ninja.css (experimental add-ons)
|
|
3071
|
+
└── pico.css (underlying fork)
|
|
3072
|
+
```
|
|
3073
|
+
|
|
3074
|
+
\3c !--section:code-->
|
|
3075
|
+
```css */
|
|
3076
|
+
@media (width < 768px) {
|
|
3077
|
+
pre {
|
|
3078
|
+
border-radius: 0
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
/* Code block caption via data-attr (to display filename, etc.) */
|
|
3083
|
+
|
|
3084
|
+
code[data-caption]::before {
|
|
3085
|
+
display: block;
|
|
3086
|
+
margin-bottom: 1rem;
|
|
3087
|
+
content: attr(data-caption);
|
|
3088
|
+
font-style: italic;
|
|
3089
|
+
opacity: 50%;
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
|
+
/* Forms */
|
|
3093
|
+
|
|
3094
|
+
/*!
|
|
3095
|
+
* Float Label CSS v2 by Blades CSS 🥷🏷️
|
|
3096
|
+
* Copyright 2016–2026 (https://blades.ninja/css/float-label/)
|
|
3097
|
+
* Licensed under MIT
|
|
3098
|
+
*/
|
|
3099
|
+
/*\3c !--section:docs-->
|
|
3100
|
+
|
|
3101
|
+
First, we target either:
|
|
3102
|
+
1. `<label>` which `:has` inner form inputs (classless approach)
|
|
3103
|
+
2. or explicit `.has-float-label` class (explicit approach)
|
|
3104
|
+
|
|
3105
|
+
```css */
|
|
3106
|
+
label:has(> span):has(
|
|
3107
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3108
|
+
textarea,
|
|
3109
|
+
select
|
|
3110
|
+
),
|
|
3111
|
+
.has-float-label {
|
|
3112
|
+
display: block;
|
|
3113
|
+
position: relative;
|
|
3114
|
+
/*```
|
|
3115
|
+
Finally, we detect if placeholder is shown, but not in focus. That means we can safely hide it, and enlarge the float label instead:
|
|
3116
|
+
```css */
|
|
3117
|
+
}
|
|
3118
|
+
/*```
|
|
3119
|
+
Then, we define the default/fallback state (when the float label should be minimized):
|
|
3120
|
+
```css */
|
|
3121
|
+
label:has(> span):has(
|
|
3122
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3123
|
+
textarea,
|
|
3124
|
+
select
|
|
3125
|
+
) > span,
|
|
3126
|
+
label:has(> span):has(
|
|
3127
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3128
|
+
textarea,
|
|
3129
|
+
select
|
|
3130
|
+
) label,
|
|
3131
|
+
.has-float-label > span,
|
|
3132
|
+
.has-float-label label {
|
|
3133
|
+
position: absolute;
|
|
3134
|
+
top: 0;
|
|
3135
|
+
left: 0;
|
|
3136
|
+
font-size: 75%;
|
|
3137
|
+
cursor: text;
|
|
3138
|
+
}
|
|
3139
|
+
label:has(> span):has(
|
|
3140
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3141
|
+
textarea,
|
|
3142
|
+
select
|
|
3143
|
+
) *:placeholder-shown:not(:focus)::-moz-placeholder, .has-float-label *:placeholder-shown:not(:focus)::-moz-placeholder {
|
|
3144
|
+
opacity: 0;
|
|
3145
|
+
}
|
|
3146
|
+
label:has(> span):has(
|
|
3147
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3148
|
+
textarea,
|
|
3149
|
+
select
|
|
3150
|
+
) *:-moz-placeholder:not(:focus)::placeholder, .has-float-label *:-moz-placeholder:not(:focus)::placeholder {
|
|
3151
|
+
opacity: 0;
|
|
3152
|
+
}
|
|
3153
|
+
label:has(> span):has(
|
|
3154
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3155
|
+
textarea,
|
|
3156
|
+
select
|
|
3157
|
+
) *:placeholder-shown:not(:focus)::placeholder, .has-float-label *:placeholder-shown:not(:focus)::placeholder {
|
|
3158
|
+
opacity: 0;
|
|
3159
|
+
}
|
|
3160
|
+
label:has(> span):has(
|
|
3161
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3162
|
+
textarea,
|
|
3163
|
+
select
|
|
3164
|
+
):has(*:-moz-placeholder:not(:focus)) > span, label:has(> span):has(
|
|
3165
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3166
|
+
textarea,
|
|
3167
|
+
select
|
|
3168
|
+
):has(*:-moz-placeholder:not(:focus)) label, .has-float-label:has(*:-moz-placeholder:not(:focus)) > span, .has-float-label:has(*:-moz-placeholder:not(:focus)) label {
|
|
3169
|
+
font-size: inherit;
|
|
3170
|
+
opacity: 50%;
|
|
3171
|
+
}
|
|
3172
|
+
label:has(> span):has(
|
|
3173
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3174
|
+
textarea,
|
|
3175
|
+
select
|
|
3176
|
+
):has(*:placeholder-shown:not(:focus)) > span,
|
|
3177
|
+
label:has(> span):has(
|
|
3178
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3179
|
+
textarea,
|
|
3180
|
+
select
|
|
3181
|
+
):has(*:placeholder-shown:not(:focus)) label,
|
|
3182
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) > span,
|
|
3183
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) label {
|
|
3184
|
+
font-size: inherit;
|
|
3185
|
+
opacity: 50%;
|
|
3186
|
+
}
|
|
3187
|
+
/*```
|
|
3188
|
+
|
|
3189
|
+
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.
|
|
3190
|
+
|
|
3191
|
+
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.
|
|
3192
|
+
|
|
3193
|
+
*/
|
|
3194
|
+
label:has(> span):has(
|
|
3195
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3196
|
+
textarea,
|
|
3197
|
+
select
|
|
3198
|
+
),
|
|
3199
|
+
.has-float-label {
|
|
3200
|
+
|
|
3201
|
+
/* Enlarged state */
|
|
3202
|
+
}
|
|
3203
|
+
/* Default/fallback state */
|
|
3204
|
+
label:has(> span):has(
|
|
3205
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3206
|
+
textarea,
|
|
3207
|
+
select
|
|
3208
|
+
) > span,
|
|
3209
|
+
label:has(> span):has(
|
|
3210
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3211
|
+
textarea,
|
|
3212
|
+
select
|
|
3213
|
+
) label,
|
|
3214
|
+
.has-float-label > span,
|
|
3215
|
+
.has-float-label label {
|
|
3216
|
+
padding-inline-start: calc(1rem + 1px); /* match Pico's padding + border */
|
|
3217
|
+
padding-block-start: 0.25rem;
|
|
3218
|
+
opacity: 75%;
|
|
3219
|
+
transition: all 0.25s;
|
|
3220
|
+
}
|
|
3221
|
+
label:has(> span):has(
|
|
3222
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3223
|
+
textarea,
|
|
3224
|
+
select
|
|
3225
|
+
) input,
|
|
3226
|
+
label:has(> span):has(
|
|
3227
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3228
|
+
textarea,
|
|
3229
|
+
select
|
|
3230
|
+
) textarea,
|
|
3231
|
+
label:has(> span):has(
|
|
3232
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3233
|
+
textarea,
|
|
3234
|
+
select
|
|
3235
|
+
) select,
|
|
3236
|
+
.has-float-label input,
|
|
3237
|
+
.has-float-label textarea,
|
|
3238
|
+
.has-float-label select {
|
|
3239
|
+
margin-block-start: 0; /* reset Pico */
|
|
3240
|
+
padding-inline-start: 1rem; /* match Pico */
|
|
3241
|
+
padding-block: 1.125rem 0.375rem; /* match Pico's total: 2 x 0.75rem = 1.5rem */
|
|
3242
|
+
}
|
|
3243
|
+
label:has(> span):has(
|
|
3244
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3245
|
+
textarea,
|
|
3246
|
+
select
|
|
3247
|
+
) input::-moz-placeholder, label:has(> span):has(
|
|
3248
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3249
|
+
textarea,
|
|
3250
|
+
select
|
|
3251
|
+
) textarea::-moz-placeholder, label:has(> span):has(
|
|
3252
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3253
|
+
textarea,
|
|
3254
|
+
select
|
|
3255
|
+
) select::-moz-placeholder, .has-float-label input::-moz-placeholder, .has-float-label textarea::-moz-placeholder, .has-float-label select::-moz-placeholder {
|
|
3256
|
+
opacity: 100%;
|
|
3257
|
+
-moz-transition: all 0.25s;
|
|
3258
|
+
transition: all 0.25s;
|
|
3259
|
+
}
|
|
3260
|
+
label:has(> span):has(
|
|
3261
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3262
|
+
textarea,
|
|
3263
|
+
select
|
|
3264
|
+
) input::placeholder, label:has(> span):has(
|
|
3265
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3266
|
+
textarea,
|
|
3267
|
+
select
|
|
3268
|
+
) textarea::placeholder, label:has(> span):has(
|
|
3269
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3270
|
+
textarea,
|
|
3271
|
+
select
|
|
3272
|
+
) select::placeholder, .has-float-label input::placeholder, .has-float-label textarea::placeholder, .has-float-label select::placeholder {
|
|
3273
|
+
opacity: 100%;
|
|
3274
|
+
transition: all 0.25s;
|
|
3275
|
+
}
|
|
3276
|
+
label:has(> span):has(
|
|
3277
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3278
|
+
textarea,
|
|
3279
|
+
select
|
|
3280
|
+
):has(*:-moz-placeholder:not(:focus)) > span, label:has(> span):has(
|
|
3281
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3282
|
+
textarea,
|
|
3283
|
+
select
|
|
3284
|
+
):has(*:-moz-placeholder:not(:focus)) label, .has-float-label:has(*:-moz-placeholder:not(:focus)) > span, .has-float-label:has(*:-moz-placeholder:not(:focus)) label {
|
|
3285
|
+
padding-block: 0.75rem; /* match Pico */
|
|
3286
|
+
}
|
|
3287
|
+
label:has(> span):has(
|
|
3288
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3289
|
+
textarea,
|
|
3290
|
+
select
|
|
3291
|
+
):has(*:placeholder-shown:not(:focus)) > span,
|
|
3292
|
+
label:has(> span):has(
|
|
3293
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3294
|
+
textarea,
|
|
3295
|
+
select
|
|
3296
|
+
):has(*:placeholder-shown:not(:focus)) label,
|
|
3297
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) > span,
|
|
3298
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) label {
|
|
3299
|
+
padding-block: 0.75rem; /* match Pico */
|
|
3300
|
+
}
|
|
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
|
+
}
|
|
3327
|
+
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
|
|
3328
|
+
\3c !--section:code-->
|
|
3329
|
+
```css */
|
|
3330
|
+
/* Use inline flex only if link contains an icon */
|
|
3331
|
+
a:not(.does-not-exist):has(> i) {
|
|
3332
|
+
display: inline-flex;
|
|
3333
|
+
overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
|
|
3334
|
+
gap: 0.375ch; /* =3/8 */
|
|
3335
|
+
text-wrap: balance;
|
|
3336
|
+
}
|
|
3337
|
+
a:not(.does-not-exist) > i {
|
|
3338
|
+
float: left; /* ✅ Chrome ❌ Safari */
|
|
3339
|
+
font-style: normal;
|
|
3340
|
+
text-underline-offset: -2em; /* ❌ Chrome ✅ Safari - to clip it with overflow-y */
|
|
3341
|
+
}
|
|
3342
|
+
/* Favicons */
|
|
3343
|
+
a:not(.does-not-exist) > i > img {
|
|
3344
|
+
display: inline-block; /* for Tailwind CSS Typography */
|
|
3345
|
+
max-width: none; /* to keep ratio safe */
|
|
3346
|
+
height: 1.25em;
|
|
3347
|
+
margin-block-start: calc(-0.25em / 2);
|
|
3348
|
+
}
|
|
3349
|
+
a:not(.does-not-exist) > i[class^="fa-"],
|
|
3350
|
+
a:not(.does-not-exist) > i[class*=" fa-"] {
|
|
3351
|
+
line-height: inherit;
|
|
3352
|
+
--fa-width: auto;
|
|
3353
|
+
}
|
|
3354
|
+
/* Font Awesome */
|
|
3355
|
+
a:not(.does-not-exist) > i.fa-lg {
|
|
3356
|
+
line-height: normal;
|
|
3357
|
+
}
|
|
3358
|
+
/*```
|
|
3359
|
+
\3c !--section:summary-->
|
|
3360
|
+
|
|
3361
|
+
Use *Bl*ades `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links.
|
|
3362
|
+
It automatically handles sizing and alignment while preventing underline on icons.
|
|
3363
|
+
|
|
3364
|
+
\3c !--section:docs-->
|
|
3365
|
+
|
|
3366
|
+
<article class="breakout-item">
|
|
3367
|
+
|
|
3368
|
+
| Use `<i>`-helper with | Clean HTML without `<span>ning` |
|
|
3369
|
+
| ------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
3370
|
+
| [<i>🥷</i> Emojis](#) | `<a><i>🥷</i> Text</a>` |
|
|
3371
|
+
| [<i></i> Favicons](#) | `<a><i><img src="..."></i> Text</a>` |
|
|
3372
|
+
| [<i class="fa-brands fa-github fa-lg"></i> Font Awesome icons](#) | `<a><i class="fa-..."></i> Text</a>` |
|
|
3373
|
+
</article>
|
|
3374
|
+
|
|
3375
|
+
Or even for:
|
|
3376
|
+
|
|
3377
|
+
<article>
|
|
3378
|
+
<a href="#" style="margin: 0 0 0 1rem"><i>🥷</i> very-very-very-very-very-<br>long-multiline-links</a>
|
|
3379
|
+
</article>
|
|
3380
|
+
|
|
3381
|
+
How we made it: https://codepen.io/editor/anydigital/pen/019d2b94-5616-75dc-a23e-e111869d5237
|
|
3382
|
+
|
|
3383
|
+
\3c !--section--> */
|
|
3384
|
+
/*\3c !--section:docs-->
|
|
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 */
|
|
3464
|
+
nav :is(ul, menu)[popover] {
|
|
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] {
|
|
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]:dir(rtl) {
|
|
3485
|
+
position-area: bottom span-left;
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
/*\3c !--section:docs-->
|
|
3489
|
+
|
|
3490
|
+
Use `dl.timeline` or wrap a `<dl>` with `.has-timeline` to style it as a
|
|
3491
|
+
vertical timeline — each `<dd>` gets a left border strip acting as the track:
|
|
3492
|
+
|
|
3493
|
+
<article class="has-timeline">
|
|
3494
|
+
|
|
3495
|
+
May 11, 2026
|
|
3496
|
+
: First Blades CSS stable release (v2.2.0).
|
|
3497
|
+
|
|
3498
|
+
Mar 15, 2025
|
|
3499
|
+
: Last Pico CSS update (v2.1.1).
|
|
3500
|
+
|
|
3501
|
+
</article>
|
|
3502
|
+
|
|
3503
|
+
\3c !--section:code-->```css */
|
|
3504
|
+
dl.timeline dd, .has-timeline > dl dd {
|
|
3505
|
+
margin-block: 0;
|
|
3506
|
+
padding: 0.25rem 0 0.75rem 1rem;
|
|
3507
|
+
border-inline-start: 0.25rem solid var(--blades-timeline-border-color);
|
|
3508
|
+
}
|
|
3509
|
+
/* Compact version (opt-in via `data-compact` attr anywhere) */
|
|
3510
|
+
/*
|
|
3511
|
+
* Compact: opt-in denser sizing and a more current look, applied under `data-compact` on
|
|
3512
|
+
* <html> (whole page) or on any element such as a single <form>. Without the attribute it
|
|
3513
|
+
* changes nothing. Part of blades.css (and blades.layered.css); with per-part imports, import it
|
|
3514
|
+
* last (in the same layer as the other parts).
|
|
3515
|
+
*
|
|
3516
|
+
* The extra selectors keep the values winning where Pico re-declares them at the same
|
|
3517
|
+
* specificity: nested [data-theme] sections, the `.pico` root when combined with the conditional build,
|
|
3518
|
+
* and a shadow host.
|
|
3519
|
+
*/
|
|
3520
|
+
[data-compact],
|
|
3521
|
+
[data-compact] :is([data-theme], .pico),
|
|
3522
|
+
.pico[data-compact],
|
|
3523
|
+
:host([data-compact]),
|
|
3524
|
+
:host([data-compact]) [data-theme] {
|
|
3525
|
+
--pico-border-radius: 0.5rem;
|
|
3526
|
+
--pico-outline-width: 0.1875rem;
|
|
3527
|
+
--pico-block-spacing-vertical: 1.5rem;
|
|
3528
|
+
--pico-block-spacing-horizontal: 1.5rem;
|
|
3529
|
+
--pico-form-element-spacing-vertical: 0.375rem;
|
|
3530
|
+
--pico-form-element-spacing-horizontal: 0.75rem;
|
|
3531
|
+
--pico-form-label-font-weight: 500;
|
|
3532
|
+
--pico-button-font-weight: 500;
|
|
3533
|
+
--pico-form-element-background-color: light-dark(#fff, rgb(28, 33, 43.5));
|
|
3534
|
+
--pico-card-border-color: var(--pico-muted-border-color);
|
|
3535
|
+
--pico-card-box-shadow:
|
|
3536
|
+
0 0 0 var(--pico-border-width) var(--pico-card-border-color), 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
3537
|
+
--pico-card-sectioning-background-color: var(--pico-card-background-color);
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
/* Search fields keep their pill shape */
|
|
3541
|
+
[data-compact]:is([role="search"], [type="search"]) {
|
|
3542
|
+
--pico-border-radius: 5rem;
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
/* Page-level only: everything is sized in rem, so the root size can't change per element */
|
|
3546
|
+
:root[data-compact],
|
|
3547
|
+
:host([data-compact]) {
|
|
3548
|
+
--pico-font-size: 100%;
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3551
|
+
[data-compact] :is(h1, h2, h3, h4, h5, h6),
|
|
3552
|
+
:host([data-compact]) :is(h1, h2, h3, h4, h5, h6) {
|
|
3553
|
+
--pico-font-weight: 600;
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
/* Keep helper text at the normal weight under the 500-weight labels */
|
|
3557
|
+
[data-compact] :where(input, select, textarea, fieldset, .grid) + small,
|
|
3558
|
+
:host([data-compact]) :where(input, select, textarea, fieldset, .grid) + small {
|
|
3559
|
+
font-weight: var(--pico-font-weight);
|
|
3560
|
+
}
|
|
2989
3561
|
|
|
2990
3562
|
}
|