@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
package/package.json
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anyblades/blades",
|
|
3
|
-
"version": "3.1.0-
|
|
3
|
+
"version": "3.1.0-beta.4",
|
|
4
4
|
"style": "./src/blades.css",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/blades.css",
|
|
7
|
+
"./compact": "./src/blades/_compact.css",
|
|
8
|
+
"./float-label/*": "./src/blades/float-label/_*.css",
|
|
7
9
|
"./pico": "./src/pico.css",
|
|
8
|
-
"./pico/
|
|
9
|
-
"./pico/
|
|
10
|
-
"./pico/layout/*": "./src/pico/layout/_*.css",
|
|
10
|
+
"./pico/components": "./src/pico/components/_index.css",
|
|
11
|
+
"./pico/components/*": "./src/pico/components/_*.css",
|
|
11
12
|
"./pico/content": "./src/pico/content/_index.css",
|
|
12
13
|
"./pico/content/*": "./src/pico/content/_*.css",
|
|
13
14
|
"./pico/forms": "./src/pico/forms/_index.css",
|
|
14
15
|
"./pico/forms/*": "./src/pico/forms/_*.css",
|
|
15
|
-
"./pico/
|
|
16
|
-
"./pico/
|
|
16
|
+
"./pico/layout": "./src/pico/layout/_index.css",
|
|
17
|
+
"./pico/layout/*": "./src/pico/layout/_*.css",
|
|
17
18
|
"./pico/utilities": "./src/pico/_utilities.css",
|
|
18
|
-
"./
|
|
19
|
-
"./float-label": "./src/standalone/forms/_float-label.css",
|
|
20
|
-
"./ninja": "./src/ninja.css",
|
|
19
|
+
"./pico/variables": "./src/pico/_variables.css",
|
|
21
20
|
"./css/*.css": "./css/*.css",
|
|
21
|
+
"./layered/*": "./css/layered/*.css",
|
|
22
22
|
"./package.json": "./package.json"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"src",
|
|
26
26
|
"css/*.css",
|
|
27
|
+
"css/layered",
|
|
27
28
|
"_includes",
|
|
28
29
|
".prettierrc.json"
|
|
29
30
|
],
|
|
@@ -32,9 +33,12 @@
|
|
|
32
33
|
"build": "clear; npm run lint && npm run build:css && npm run build:minify && npm run build:conditional && npm run build:layered",
|
|
33
34
|
"lint": "prettier --write --log-level silent './src/**/*.css'",
|
|
34
35
|
"build:css": "postcss --config css './src/!(_)*.css' --dir css --no-map",
|
|
35
|
-
"build:minify": "
|
|
36
|
+
"build:minify": "for f in css/*.css; do case $f in *.min.css|css/pico.conditional.*) ;; *) lightningcss --minify $f -o ${f%.css}.min.css || exit 1;; esac; done",
|
|
36
37
|
"build:conditional": "for f in '' .min; do { printf '@scope (.pico) {\\n'; cat ./css/pico${f}.css; printf '\\n}\\n'; } > ./css/pico.conditional${f}.css; done",
|
|
37
|
-
"build:layered": "
|
|
38
|
+
"build:layered": "npm run build:layered:css && npm run build:layered:wrap && npm run build:layered:clean",
|
|
39
|
+
"build:layered:css": "rm -rf css/layered && postcss --config css './src/pico/**/_*.css' '!./src/pico/_index.css' ./src/blades/_compact.css --base src --dir css/layered --no-map && mv css/layered/pico/* css/layered/blades/* css/layered/ && rmdir css/layered/pico css/layered/blades",
|
|
40
|
+
"build:layered:wrap": "for f in css/blades.css css/blades.min.css $(find css/layered -name '_*.css'); do case $f in css/blades*) n=${f##*/}; o=css/layered/${n%%.*}.layered.${n#*.};; *) d=${f%/*}; n=${f##*/_}; [ $n = index.css ] && o=$d.css || o=$d/$n;; esac; { printf '@layer blades {\\n'; cat $f; printf '\\n}\\n'; } > $o || exit 1; done",
|
|
41
|
+
"build:layered:clean": "find css/layered -name '_*.css' -delete",
|
|
38
42
|
"start": "npm run build:css -- --watch",
|
|
39
43
|
"prepublishOnly": "npm run build"
|
|
40
44
|
},
|
|
@@ -43,8 +47,8 @@
|
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
49
|
"autoprefixer": "^10.5.0",
|
|
46
|
-
"clean-css-cli": "^5.4.2",
|
|
47
50
|
"css-declaration-sorter": "^7.4.0",
|
|
51
|
+
"lightningcss-cli": "^1.33.0",
|
|
48
52
|
"postcss": "^8.4.33",
|
|
49
53
|
"postcss-cli": "^12.0.0",
|
|
50
54
|
"postcss-import": "^16.1.1",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Compact: opt-in denser sizing and a more current look, applied under `data-compact` on
|
|
3
|
+
* <html> (whole page) or on any element such as a single <form>. Without the attribute it
|
|
4
|
+
* changes nothing. Part of blades.css (and blades.layered.css); with per-part imports, import it
|
|
5
|
+
* last (in the same layer as the other parts).
|
|
6
|
+
*
|
|
7
|
+
* The extra selectors keep the values winning where Pico re-declares them at the same
|
|
8
|
+
* specificity: nested [data-theme] sections, the `.pico` root when combined with the conditional build,
|
|
9
|
+
* and a shadow host.
|
|
10
|
+
*/
|
|
11
|
+
[data-compact],
|
|
12
|
+
[data-compact] :is([data-theme], .pico),
|
|
13
|
+
.pico[data-compact],
|
|
14
|
+
:host([data-compact]),
|
|
15
|
+
:host([data-compact]) [data-theme] {
|
|
16
|
+
--pico-border-radius: 0.5rem;
|
|
17
|
+
--pico-outline-width: 0.1875rem;
|
|
18
|
+
--pico-block-spacing-vertical: 1.5rem;
|
|
19
|
+
--pico-block-spacing-horizontal: 1.5rem;
|
|
20
|
+
--pico-form-element-spacing-vertical: 0.375rem;
|
|
21
|
+
--pico-form-element-spacing-horizontal: 0.75rem;
|
|
22
|
+
--pico-form-label-font-weight: 500;
|
|
23
|
+
--pico-button-font-weight: 500;
|
|
24
|
+
--pico-form-element-background-color: light-dark(#fff, rgb(28, 33, 43.5));
|
|
25
|
+
--pico-card-border-color: var(--pico-muted-border-color);
|
|
26
|
+
--pico-card-box-shadow:
|
|
27
|
+
0 0 0 var(--pico-border-width) var(--pico-card-border-color), 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
28
|
+
--pico-card-sectioning-background-color: var(--pico-card-background-color);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Search fields keep their pill shape */
|
|
32
|
+
[data-compact]:is([role="search"], [type="search"]) {
|
|
33
|
+
--pico-border-radius: 5rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Page-level only: everything is sized in rem, so the root size can't change per element */
|
|
37
|
+
:root[data-compact],
|
|
38
|
+
:host([data-compact]) {
|
|
39
|
+
--pico-font-size: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-compact] :is(h1, h2, h3, h4, h5, h6),
|
|
43
|
+
:host([data-compact]) :is(h1, h2, h3, h4, h5, h6) {
|
|
44
|
+
--pico-font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Keep helper text at the normal weight under the 500-weight labels */
|
|
48
|
+
[data-compact] :where(input, select, textarea, fieldset, .grid) + small,
|
|
49
|
+
:host([data-compact]) :where(input, select, textarea, fieldset, .grid) + small {
|
|
50
|
+
font-weight: var(--pico-font-weight);
|
|
51
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*<!--section:docs-->
|
|
2
|
+
|
|
3
|
+
A `<ul>` or `<menu>` with the `popover` attribute is styled like a dropdown and opens next to the button
|
|
4
|
+
that toggles it, with no JS:
|
|
5
|
+
|
|
6
|
+
```html
|
|
7
|
+
<button popovertarget="actions">Actions</button>
|
|
8
|
+
<ul id="actions" popover>
|
|
9
|
+
<li><a href="#">Edit</a></li>
|
|
10
|
+
<li><a href="#">Duplicate</a></li>
|
|
11
|
+
</ul>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
- Clicking outside or pressing Esc closes it, and it's drawn on top of everything (no `z-index`, no clipping by `overflow`).
|
|
15
|
+
- It opens below the button (on the reading side, also in RTL) and flips when there's no room.
|
|
16
|
+
Open it with `popovertarget`, `commandfor` or `showPopover({ source })`, so it knows its button.
|
|
17
|
+
- Browsers without CSS anchor positioning show it in the middle of the screen instead, like a plain popover.
|
|
18
|
+
- It uses the dropdown colours (`--pico-dropdown-*`, from `components/dropdown`).
|
|
19
|
+
|
|
20
|
+
<!--section:code-->```css */
|
|
21
|
+
:is(ul, menu)[popover] {
|
|
22
|
+
min-width: fit-content;
|
|
23
|
+
margin: auto;
|
|
24
|
+
padding: 0;
|
|
25
|
+
border: var(--pico-border-width) solid var(--pico-dropdown-border-color);
|
|
26
|
+
border-radius: var(--pico-border-radius);
|
|
27
|
+
background-color: var(--pico-dropdown-background-color);
|
|
28
|
+
box-shadow: var(--pico-dropdown-box-shadow);
|
|
29
|
+
color: var(--pico-dropdown-color);
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
opacity: 0;
|
|
32
|
+
transition:
|
|
33
|
+
opacity var(--pico-transition),
|
|
34
|
+
overlay var(--pico-transition) allow-discrete,
|
|
35
|
+
display var(--pico-transition) allow-discrete;
|
|
36
|
+
|
|
37
|
+
/* Beats `nav ul` / `aside ul`, which would otherwise show the closed menu */
|
|
38
|
+
&:not(:popover-open) {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
&:popover-open {
|
|
42
|
+
display: block;
|
|
43
|
+
opacity: 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
li {
|
|
47
|
+
display: block;
|
|
48
|
+
margin-bottom: 0;
|
|
49
|
+
padding: calc(var(--pico-form-element-spacing-vertical) * 0.5)
|
|
50
|
+
var(--pico-form-element-spacing-horizontal);
|
|
51
|
+
list-style: none;
|
|
52
|
+
|
|
53
|
+
&:first-of-type {
|
|
54
|
+
margin-top: calc(var(--pico-form-element-spacing-vertical) * 0.5);
|
|
55
|
+
}
|
|
56
|
+
&:last-of-type {
|
|
57
|
+
margin-bottom: calc(var(--pico-form-element-spacing-vertical) * 0.5);
|
|
58
|
+
}
|
|
59
|
+
&:has(label):hover {
|
|
60
|
+
background-color: var(--pico-dropdown-hover-background-color);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
li a {
|
|
64
|
+
display: block;
|
|
65
|
+
margin: calc(var(--pico-form-element-spacing-vertical) * -0.5)
|
|
66
|
+
calc(var(--pico-form-element-spacing-horizontal) * -1);
|
|
67
|
+
padding: calc(var(--pico-form-element-spacing-vertical) * 0.5)
|
|
68
|
+
var(--pico-form-element-spacing-horizontal);
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
border-radius: 0;
|
|
71
|
+
color: var(--pico-dropdown-color);
|
|
72
|
+
text-decoration: none;
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
|
|
75
|
+
&:is(:hover, :focus, :active, :focus-visible, [aria-current]:not([aria-current="false"])) {
|
|
76
|
+
background-color: var(--pico-dropdown-hover-background-color);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
li label {
|
|
80
|
+
width: 100%;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/* Beats Pico's `nav ul:first-of-type` / `:last-of-type` margins */
|
|
84
|
+
nav :is(ul, menu)[popover] {
|
|
85
|
+
margin: auto;
|
|
86
|
+
}
|
|
87
|
+
@starting-style {
|
|
88
|
+
:is(ul, menu)[popover]:popover-open {
|
|
89
|
+
opacity: 0;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Next to the button that opened it (its implicit anchor) */
|
|
94
|
+
@supports (position-area: bottom) {
|
|
95
|
+
:is(ul, menu)[popover],
|
|
96
|
+
nav :is(ul, menu)[popover] {
|
|
97
|
+
inset: auto;
|
|
98
|
+
margin: 0;
|
|
99
|
+
margin-top: var(--pico-outline-width);
|
|
100
|
+
position-area: bottom span-right;
|
|
101
|
+
position-try-fallbacks: flip-block, flip-inline;
|
|
102
|
+
|
|
103
|
+
&:dir(rtl) {
|
|
104
|
+
position-area: bottom span-left;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Blades CSS standalone kit v3 🥷
|
|
3
|
+
* Copyright 2026 (https://blades.ninja/css/standalone/)
|
|
4
|
+
* Licensed under MIT
|
|
5
|
+
*/
|
|
6
|
+
/*<!--section:code-->```css */
|
|
7
|
+
|
|
8
|
+
/* Follows https://github.com/picocss/pico/blob/main/scss/_index.scss */
|
|
9
|
+
|
|
10
|
+
@import "./_variables";
|
|
11
|
+
|
|
12
|
+
/* Layout */
|
|
13
|
+
@import "./_columns";
|
|
14
|
+
|
|
15
|
+
/* Content */
|
|
16
|
+
@import "./_code";
|
|
17
|
+
|
|
18
|
+
/* Forms */
|
|
19
|
+
@import "./float-label/_index";
|
|
20
|
+
|
|
21
|
+
/* Components */
|
|
22
|
+
@import "./_modal";
|
|
23
|
+
@import "./_icon";
|
|
24
|
+
@import "./_dropdown-popover";
|
|
25
|
+
@import "./_timeline";
|
|
26
|
+
|
|
27
|
+
/* Compact version (opt-in via `data-compact` attr anywhere) */
|
|
28
|
+
@import "./_compact";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*<!--section:docs-->
|
|
2
|
+
|
|
3
|
+
A `<dialog>` opened with `dialog.showModal()` fades in and its `<article>` zooms in, without JS classes.
|
|
4
|
+
Pico's modal JS (`.modal-is-open`, `.modal-is-opening`, `.modal-is-closing`) still works on top of it.
|
|
5
|
+
|
|
6
|
+
- `dialog.close()` closes it at once, as before.
|
|
7
|
+
- `<dialog open>` in markup and non-modal `dialog.show()` aren't animated.
|
|
8
|
+
- Browsers without `@starting-style`, and reduced motion, open it at once.
|
|
9
|
+
|
|
10
|
+
<!--section:code-->```css */
|
|
11
|
+
dialog:modal {
|
|
12
|
+
transition: opacity var(--pico-transition);
|
|
13
|
+
|
|
14
|
+
> article {
|
|
15
|
+
transition: transform var(--pico-transition);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
@starting-style {
|
|
19
|
+
dialog:modal {
|
|
20
|
+
opacity: 0;
|
|
21
|
+
|
|
22
|
+
> article {
|
|
23
|
+
transform: scale(0.96);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
label:has(> span):has(
|
|
1
|
+
label:has(> span):has(
|
|
2
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
3
|
+
textarea,
|
|
4
|
+
select
|
|
5
|
+
),
|
|
2
6
|
.has-float-label {
|
|
3
7
|
/* Default/fallback state */
|
|
4
8
|
> span,
|
package/src/blades.css
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./blades/float-label/_index";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Anton Staroverov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Ninja CSS add-ons for Blades CSS
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Blades CSS' ninja add-ons (experimental) 🥷🧪
|
|
3
|
+
* Copyright 2026 (https://blades.ninja/css/ninja/)
|
|
4
|
+
* Licensed under MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* Layout */
|
|
8
|
+
@import "./_container-breakout";
|
|
9
|
+
@import "./_page-anchors";
|
|
10
|
+
|
|
11
|
+
/* Content */
|
|
12
|
+
@import "./_heading-anchor";
|
|
13
|
+
@import "./_list-helpers";
|
|
14
|
+
@import "./_table-helpers";
|
|
15
|
+
@import "./_table-responsive";
|
|
16
|
+
|
|
17
|
+
/* Other */
|
|
18
|
+
@import "./_utilities";
|
|
19
|
+
@import "./_theme";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Blades CSS' ninja add-ons (experimental) 🥷🧪
|
|
3
|
-
* Copyright 2026 (https://blades.ninja/css/ninja/)
|
|
4
|
-
* Licensed under MIT
|
|
5
|
-
*/
|
|
6
1
|
/*<!--section:docs-->
|
|
7
2
|
|
|
8
3
|
### `sup`er and `sub`headings
|
|
@@ -80,4 +75,58 @@ img[src*="?domain=github.com&"] {
|
|
|
80
75
|
filter: invert(1);
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
|
-
|
|
78
|
+
/*```
|
|
79
|
+
|
|
80
|
+
## Dark auto
|
|
81
|
+
|
|
82
|
+
`.dark-auto` automatically creates a simple dark version of any element:
|
|
83
|
+
|
|
84
|
+
<article data-theme="dark">
|
|
85
|
+
<p>Look how cool <big class="dark-auto">🔥🕷️🐦⬛🐄🦓</big> can look in the dark!</p>
|
|
86
|
+
</article>
|
|
87
|
+
|
|
88
|
+
How it works:
|
|
89
|
+
```css */
|
|
90
|
+
/* Per https://picocss.com/docs/css-variables#css-variables-for-color-schemes */
|
|
91
|
+
:root {
|
|
92
|
+
--blades-dark-filter: invert(100%) hue-rotate(180deg);
|
|
93
|
+
}
|
|
94
|
+
.dark-auto {
|
|
95
|
+
/* Dark color scheme (Auto) */
|
|
96
|
+
@media (prefers-color-scheme: dark) {
|
|
97
|
+
filter: var(--blades-dark-filter);
|
|
98
|
+
}
|
|
99
|
+
/* Dark color scheme (Forced) */
|
|
100
|
+
&[data-theme="dark"],
|
|
101
|
+
&:where([data-theme="dark"] *) {
|
|
102
|
+
filter: var(--blades-dark-filter);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/*```
|
|
106
|
+
|
|
107
|
+
## Faded
|
|
108
|
+
|
|
109
|
+
`.faded` reduces the opacity of an element:
|
|
110
|
+
|
|
111
|
+
<article class="faded">
|
|
112
|
+
Hover to unfade me!
|
|
113
|
+
</article>
|
|
114
|
+
|
|
115
|
+
How it works:
|
|
116
|
+
```css */
|
|
117
|
+
.faded {
|
|
118
|
+
opacity: 50%;
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
opacity: 87.5%;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/*```
|
|
125
|
+
<!--section--> */
|
|
126
|
+
|
|
127
|
+
/* Fix the scrollbar color when inverted by https://tailwindcss.com/docs/filter-invert */
|
|
128
|
+
.invert {
|
|
129
|
+
::-webkit-scrollbar {
|
|
130
|
+
filter: invert(1) !important;
|
|
131
|
+
}
|
|
132
|
+
}
|
package/src/pico/_variables.css
CHANGED
|
@@ -225,7 +225,8 @@ details summary[role="button"]:not(.outline)::after {
|
|
|
225
225
|
--pico-primary-hover-background: light-dark(#02659a, #017fc0);
|
|
226
226
|
--pico-primary-hover-border: var(--pico-primary-hover-background);
|
|
227
227
|
--pico-primary-hover-underline: var(--pico-primary-hover);
|
|
228
|
-
|
|
228
|
+
/* Focus rings are opaque: at 25–50% alpha they composite below 3:1 (SC 1.4.11), see #167 */
|
|
229
|
+
--pico-primary-focus: light-dark(rgb(2, 138, 212), rgb(1, 170, 255));
|
|
229
230
|
--pico-primary-inverse: #fff;
|
|
230
231
|
--pico-secondary: light-dark(#5d6b89, #969eaf);
|
|
231
232
|
--pico-secondary-background: #525f7a;
|
|
@@ -235,7 +236,7 @@ details summary[role="button"]:not(.outline)::after {
|
|
|
235
236
|
--pico-secondary-hover-background: light-dark(#48536b, #5d6b89);
|
|
236
237
|
--pico-secondary-hover-border: var(--pico-secondary-hover-background);
|
|
237
238
|
--pico-secondary-hover-underline: var(--pico-secondary-hover);
|
|
238
|
-
--pico-secondary-focus: light-dark(
|
|
239
|
+
--pico-secondary-focus: light-dark(rgb(93, 107, 137), rgb(144, 158, 190));
|
|
239
240
|
--pico-secondary-inverse: #fff;
|
|
240
241
|
--pico-contrast: light-dark(#181c25, #dfe3eb);
|
|
241
242
|
--pico-contrast-background: light-dark(#181c25, #eff1f4);
|
|
@@ -248,7 +249,7 @@ details summary[role="button"]:not(.outline)::after {
|
|
|
248
249
|
var(--pico-secondary-hover),
|
|
249
250
|
var(--pico-contrast-hover)
|
|
250
251
|
);
|
|
251
|
-
--pico-contrast-focus: light-dark(
|
|
252
|
+
--pico-contrast-focus: light-dark(rgb(93, 107, 137), rgb(207, 213, 226));
|
|
252
253
|
--pico-contrast-inverse: light-dark(#fff, #000);
|
|
253
254
|
--pico-box-shadow: 0 0.5rem 2.5rem light-dark(rgba(129, 145, 181, 0.2), rgba(7, 8.5, 12, 0.2));
|
|
254
255
|
--pico-h1-color: light-dark(#2d3138, #f0f1f3);
|
|
@@ -282,11 +283,11 @@ details summary[role="button"]:not(.outline)::after {
|
|
|
282
283
|
--pico-form-element-disabled-opacity: 0.5;
|
|
283
284
|
--pico-form-element-invalid-border-color: light-dark(
|
|
284
285
|
rgb(183.5, 105.5, 106.5),
|
|
285
|
-
rgb(
|
|
286
|
+
rgb(200.25, 79.25, 72.25)
|
|
286
287
|
);
|
|
287
288
|
--pico-form-element-invalid-active-border-color: light-dark(
|
|
288
289
|
rgb(200.25, 79.25, 72.25),
|
|
289
|
-
rgb(
|
|
290
|
+
rgb(214, 92, 86)
|
|
290
291
|
);
|
|
291
292
|
--pico-form-element-invalid-focus-color: var(--pico-form-element-invalid-active-border-color);
|
|
292
293
|
--pico-form-element-valid-border-color: light-dark(rgb(76, 154.5, 137.5), #2a7b6f);
|
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
--pico-loading-spinner-opacity: 0.5;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
[aria-busy="true"]:not(input, select, textarea, html, form)
|
|
13
|
+
[aria-busy="true"]:not(input, select, textarea, html, form):not(
|
|
14
|
+
:where(button, [type="submit"], [type="button"], [type="reset"], [role="button"])
|
|
15
|
+
) {
|
|
16
|
+
/* :where() zeroes the specificity of the button list inside :not(), so this rule stays
|
|
17
|
+
* low-specificity and doesn't override the more specific button rules below */
|
|
14
18
|
white-space: nowrap;
|
|
15
19
|
}
|
|
16
20
|
[aria-busy="true"]:not(input, select, textarea, html, form)::before {
|
|
@@ -38,3 +42,25 @@ button[aria-busy="true"],
|
|
|
38
42
|
a[aria-busy="true"] {
|
|
39
43
|
pointer-events: none;
|
|
40
44
|
}
|
|
45
|
+
|
|
46
|
+
/* Buttons keep their size: the label stays in place but hidden, the spinner sits on top */
|
|
47
|
+
button,
|
|
48
|
+
[type="submit"],
|
|
49
|
+
[type="button"],
|
|
50
|
+
[type="reset"],
|
|
51
|
+
[role="button"] {
|
|
52
|
+
&[aria-busy="true"]:not(:empty) {
|
|
53
|
+
position: relative;
|
|
54
|
+
color: transparent;
|
|
55
|
+
|
|
56
|
+
> * {
|
|
57
|
+
opacity: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&::before {
|
|
61
|
+
position: absolute;
|
|
62
|
+
inset: 0;
|
|
63
|
+
margin: auto;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -32,7 +32,7 @@ button,
|
|
|
32
32
|
background-color: var(--pico-background-color);
|
|
33
33
|
box-shadow: var(--pico-box-shadow);
|
|
34
34
|
color: var(--pico-color);
|
|
35
|
-
font-weight: var(--pico-font-weight);
|
|
35
|
+
font-weight: var(--pico-button-font-weight, var(--pico-font-weight));
|
|
36
36
|
font-size: 1rem;
|
|
37
37
|
line-height: var(--pico-line-height);
|
|
38
38
|
text-align: center;
|
package/src/pico.css
CHANGED