@anyblades/blades 2.4.8 → 3.0.0-alpha.1
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/.github/ISSUE_TEMPLATE/bug_report.md +25 -0
- package/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/.prettierrc.json +6 -0
- package/README.md +130 -104
- package/context7.json +4 -0
- package/css/blades.css +454 -198
- package/css/blades.min.css +145 -0
- package/css/blades.standalone.css +216 -272
- package/css/blades.standalone.min.css +37 -0
- package/css/{blades.ninja.css → ninja.css} +7 -2
- package/css/ninja.min.css +5 -0
- package/css/pico.conditional.css +3189 -0
- package/css/pico.conditional.min.css +107 -0
- package/css/pico.css +3186 -0
- package/css/pico.min.css +105 -0
- package/css/postcss.config.js +23 -0
- package/index.html +63 -0
- package/package.json +27 -11
- package/src/blades.css +4 -3
- package/src/blades.standalone.css +2 -2
- package/src/{blades.ninja.css → ninja.css} +7 -2
- package/src/pico/_components.css +974 -0
- package/src/pico/_content.css +608 -0
- package/src/pico/_forms.css +747 -0
- package/src/pico/_index.css +12 -0
- package/src/pico/_layout.css +128 -0
- package/src/pico/_utilities.css +53 -0
- package/src/pico/_variables.css +671 -0
- package/src/pico.css +1 -0
- package/src/standalone/_core.css +32 -0
- package/src/{blades.standalone.theme.css → standalone/_theme.css} +3 -7
- package/src/{_utilities.css → standalone/_utilities.css} +3 -4
- package/src/standalone/_variables.css +20 -0
- package/src/{link-icon.css → standalone/components/_icon-helper.css} +0 -2
- package/src/{components → standalone/components}/_timeline.css +1 -2
- package/src/{content → standalone/content}/_code.css +9 -12
- package/src/{content/_typography.css → standalone/content/_list.css} +4 -49
- package/src/{content → standalone/content}/_table.css +4 -7
- package/src/standalone/content/_typography.css +38 -0
- package/src/{float-label.core.css → standalone/forms/_float-label.core.css} +22 -14
- package/src/standalone/forms/_float-label.css +2 -0
- package/src/{breakout.css → standalone/layout/_breakout.css} +3 -6
- package/src/{_layout.css → standalone/layout/_columns.css} +2 -20
- package/src/standalone/layout/_scroller.css +10 -0
- package/_config.yml +0 -5
- package/blades.gemspec +0 -16
- package/css/blades.standalone.core.css +0 -738
- package/css/blades.standalone.theme.css +0 -147
- package/css/breakout.css +0 -125
- package/css/float-label.core.css +0 -56
- package/css/float-label.css +0 -96
- package/css/float-label.theme.css +0 -39
- package/css/link-icon.css +0 -59
- package/css/responsive-table.css +0 -57
- package/src/blades.standalone.core.css +0 -21
- package/src/float-label.css +0 -3
- /package/src/{responsive-table.css → standalone/content/_table-responsive.css} +0 -0
- /package/src/{float-label.theme.css → standalone/forms/_float-label.theme.css} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
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 "./layout/_breakout";
|
|
14
|
+
@import "./layout/_columns";
|
|
15
|
+
@import "./layout/_scroller";
|
|
16
|
+
|
|
17
|
+
/* Content */
|
|
18
|
+
@import "./content/_typography";
|
|
19
|
+
@import "./content/_list";
|
|
20
|
+
@import "./content/_table";
|
|
21
|
+
@import "./content/_table-responsive";
|
|
22
|
+
@import "./content/_code";
|
|
23
|
+
|
|
24
|
+
/* Forms */
|
|
25
|
+
@import "./forms/_float-label.core";
|
|
26
|
+
|
|
27
|
+
/* Components */
|
|
28
|
+
@import "./components/_icon-helper";
|
|
29
|
+
@import "./components/_timeline";
|
|
30
|
+
|
|
31
|
+
/* Utilities */
|
|
32
|
+
@import "./_utilities";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
```css */
|
|
4
|
-
@import "./float-label.theme";
|
|
1
|
+
/*<!--section:code-->```css */
|
|
2
|
+
@import "./forms/_float-label.theme";
|
|
5
3
|
|
|
6
4
|
html {
|
|
7
5
|
/* Prevent horizontal overflow and scrolling, modern way. */
|
|
@@ -101,7 +99,7 @@ table {
|
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
|
|
104
|
-
[
|
|
102
|
+
[href="#top"] {
|
|
105
103
|
opacity: 25%;
|
|
106
104
|
&:hover {
|
|
107
105
|
opacity: 75%;
|
|
@@ -130,5 +128,3 @@ table {
|
|
|
130
128
|
text-decoration-style: dotted;
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
|
-
/*```
|
|
134
|
-
<!--section--> */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<!--section:docs-->
|
|
1
|
+
/*<!--section:docs-->
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Dark auto
|
|
5
4
|
|
|
6
5
|
`.dark-auto` automatically creates a simple dark version of any element:
|
|
7
6
|
|
|
@@ -28,7 +27,7 @@ How it works:
|
|
|
28
27
|
}
|
|
29
28
|
/*```
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
## Faded
|
|
32
31
|
|
|
33
32
|
`.faded` reduces the opacity of an element:
|
|
34
33
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
:scope,
|
|
2
|
+
:host {
|
|
3
|
+
/**
|
|
4
|
+
* Design Tokens !!! NAMING NOT FINALIZED YET !!!
|
|
5
|
+
* `--in-pico: *` props below are for reference only (not to be used)
|
|
6
|
+
*/
|
|
7
|
+
--blades-token-primary: var(--pico-primary, dodgerblue);
|
|
8
|
+
--in-pico: #01aaff;
|
|
9
|
+
--blades-token-secondary: var(--pico-secondary, lightslategray);
|
|
10
|
+
--in-pico: #969eaf;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Inherited Variables
|
|
14
|
+
*/
|
|
15
|
+
--blades-timeline-border-color: color-mix(
|
|
16
|
+
in srgb,
|
|
17
|
+
var(--blades-token-secondary) 50%,
|
|
18
|
+
transparent
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
<!--section:docs-->
|
|
3
|
-
|
|
4
|
-
### Code
|
|
1
|
+
/*<!--section:docs-->
|
|
5
2
|
|
|
6
3
|
The `<pre><code>` blocks are Prism-compatible and support captions via `data-caption="..."` attribute:
|
|
7
4
|
|
|
8
|
-
```treeview {data-caption="Blades CSS:"}
|
|
9
|
-
|
|
10
|
-
├── blades.
|
|
11
|
-
├── blades.
|
|
12
|
-
|
|
5
|
+
```treeview {data-caption="Blades CSS ships:"}
|
|
6
|
+
/css/
|
|
7
|
+
├── blades.css (Pico CSS successor)
|
|
8
|
+
├── blades.standalone.css (framework-agnostic)
|
|
9
|
+
├── ninja.css (experimental add-ons)
|
|
10
|
+
└── pico.css (underlying fork)
|
|
13
11
|
```
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
<!--section:code-->
|
|
15
14
|
```css */
|
|
16
15
|
pre {
|
|
17
16
|
@media (width < 768px) {
|
|
@@ -31,5 +30,3 @@ code {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
|
-
/*```
|
|
35
|
-
<!--section--> */
|
|
@@ -1,49 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<!--section:docs,h-anchor-->
|
|
1
|
+
/*<!--section:docs-->
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Links with `href="#..."` inside headings are automatically displayed as anchors:
|
|
7
|
-
|
|
8
|
-
<article>
|
|
9
|
-
<h2 style="margin: 0 0 0 1.5rem">Heading with anchor <a href="#hwa" style="visibility: visible">#</a></h2>
|
|
10
|
-
</article>
|
|
11
|
-
|
|
12
|
-
How it works:
|
|
13
|
-
```css */
|
|
14
|
-
h1,
|
|
15
|
-
h2,
|
|
16
|
-
h3,
|
|
17
|
-
h4,
|
|
18
|
-
h5,
|
|
19
|
-
h6 {
|
|
20
|
-
position: relative;
|
|
21
|
-
|
|
22
|
-
a[aria-hidden="true"] {
|
|
23
|
-
position: absolute;
|
|
24
|
-
right: 100%;
|
|
25
|
-
top: 50%;
|
|
26
|
-
transform: translateY(-50%);
|
|
27
|
-
padding-right: 0.2ch;
|
|
28
|
-
color: silver;
|
|
29
|
-
text-decoration: none;
|
|
30
|
-
visibility: hidden;
|
|
31
|
-
}
|
|
32
|
-
@media /* to avoid double-tap on touch devices */ (hover: hover) {
|
|
33
|
-
&:hover {
|
|
34
|
-
a[aria-hidden="true"] {
|
|
35
|
-
visibility: visible;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/*```
|
|
41
|
-
|
|
42
|
-
**PRO** example of automatic anchors for `11ty`+`markdown-it-anchor`: https://github.com/anyblades/eleventy-blades/blob/main/src/eleventy.config.js
|
|
43
|
-
|
|
44
|
-
<!--section:docs,list-->
|
|
45
|
-
|
|
46
|
-
### List markers
|
|
3
|
+
## Custom markers
|
|
47
4
|
|
|
48
5
|
Customize markers using inline `style="--list-marker:..."` on `<ul>/<ol>` or even individual `<li>`:
|
|
49
6
|
|
|
@@ -80,7 +37,7 @@ ol {
|
|
|
80
37
|
}
|
|
81
38
|
/*```
|
|
82
39
|
|
|
83
|
-
|
|
40
|
+
## Markerless
|
|
84
41
|
|
|
85
42
|
`.markerless` removes markers and reduces padding:
|
|
86
43
|
|
|
@@ -107,7 +64,7 @@ ol {
|
|
|
107
64
|
}
|
|
108
65
|
/*```
|
|
109
66
|
|
|
110
|
-
|
|
67
|
+
## Unlist
|
|
111
68
|
|
|
112
69
|
`.unlist` removes list styling at all:
|
|
113
70
|
|
|
@@ -136,5 +93,3 @@ ol {
|
|
|
136
93
|
}
|
|
137
94
|
}
|
|
138
95
|
}
|
|
139
|
-
/*```
|
|
140
|
-
<!--section--> */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<!--section:docs-->
|
|
1
|
+
/*<!--section:docs-->
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Column expanders
|
|
5
4
|
|
|
6
5
|
Place `<hr>` element inside `<th>` column to expand it horizontally:
|
|
7
6
|
|
|
@@ -37,7 +36,7 @@ th {
|
|
|
37
36
|
}
|
|
38
37
|
/*```
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
## Borderless table
|
|
41
40
|
|
|
42
41
|
`.borderless` removes all default borders:
|
|
43
42
|
|
|
@@ -50,9 +49,7 @@ th {
|
|
|
50
49
|
{.borderless}
|
|
51
50
|
</article>
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<!--section--> */
|
|
52
|
+
<!--section-->*/
|
|
56
53
|
table.borderless {
|
|
57
54
|
th,
|
|
58
55
|
td {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*<!--section:docs-->
|
|
2
|
+
|
|
3
|
+
## Heading anchors
|
|
4
|
+
|
|
5
|
+
Links with `href="#..."` inside headings are automatically displayed as anchors:
|
|
6
|
+
|
|
7
|
+
<article>
|
|
8
|
+
<h2 style="margin: 0 0 0 1.5rem">Heading with anchor <a aria-hidden="true" style="visibility: visible">#</a></h2>
|
|
9
|
+
</article>
|
|
10
|
+
|
|
11
|
+
How it works:
|
|
12
|
+
```css */
|
|
13
|
+
h1,
|
|
14
|
+
h2,
|
|
15
|
+
h3,
|
|
16
|
+
h4,
|
|
17
|
+
h5,
|
|
18
|
+
h6 {
|
|
19
|
+
position: relative;
|
|
20
|
+
|
|
21
|
+
a[aria-hidden="true"] {
|
|
22
|
+
position: absolute;
|
|
23
|
+
right: 100%;
|
|
24
|
+
top: 50%;
|
|
25
|
+
transform: translateY(-50%);
|
|
26
|
+
padding-right: 0.2ch;
|
|
27
|
+
color: silver;
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
visibility: hidden;
|
|
30
|
+
}
|
|
31
|
+
@media /* to avoid double-tap on touch devices */ (hover: hover) {
|
|
32
|
+
&:hover {
|
|
33
|
+
a[aria-hidden="true"] {
|
|
34
|
+
visibility: visible;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Float Label CSS v2 by Blades CSS 🥷🏷️
|
|
3
|
+
* Copyright 2016–2026 (https://blades.ninja/css/float-label/)
|
|
4
|
+
* Licensed under MIT
|
|
5
|
+
*/
|
|
6
|
+
/*<!--section:docs-->
|
|
3
7
|
|
|
4
8
|
First, we target either:
|
|
5
9
|
1. `<label>` which `:has` inner form inputs (classless approach)
|
|
6
10
|
2. or explicit `.has-float-label` class (explicit approach)
|
|
11
|
+
|
|
7
12
|
```css */
|
|
8
|
-
label:has(> span):has(
|
|
13
|
+
label:has(> span):has(
|
|
14
|
+
input:not([type="checkbox"], [type="radio"], [type="range"]),
|
|
15
|
+
textarea,
|
|
16
|
+
select
|
|
17
|
+
),
|
|
9
18
|
.has-float-label {
|
|
10
19
|
display: block;
|
|
11
20
|
position: relative;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```css */
|
|
21
|
+
/*```
|
|
22
|
+
Then, we define the default/fallback state (when the float label should be minimized):
|
|
23
|
+
```css */
|
|
16
24
|
> span,
|
|
17
25
|
label {
|
|
18
26
|
position: absolute;
|
|
@@ -21,10 +29,9 @@ Then, we define the default/fallback state (when the float label should be minim
|
|
|
21
29
|
cursor: text;
|
|
22
30
|
font-size: 75%;
|
|
23
31
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```css */
|
|
32
|
+
/*```
|
|
33
|
+
Finally, we detect if placeholder is shown, but not in focus. That means we can safely hide it, and enlarge the float label instead:
|
|
34
|
+
```css */
|
|
28
35
|
*:placeholder-shown:not(:focus)::placeholder {
|
|
29
36
|
opacity: 0;
|
|
30
37
|
}
|
|
@@ -36,9 +43,10 @@ Finally, we detect if placeholder is shown, but not in focus. That means we can
|
|
|
36
43
|
}
|
|
37
44
|
}
|
|
38
45
|
}
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
/*```
|
|
47
|
+
|
|
41
48
|
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.
|
|
42
49
|
|
|
43
50
|
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.
|
|
44
|
-
|
|
51
|
+
|
|
52
|
+
*/
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
|
|
37
37
|
/* Max out the width of the element */
|
|
38
38
|
&.breakout-item-max {
|
|
39
|
-
width: min(125%, 100dvw) !important;
|
|
39
|
+
width: min(125%, 100dvw) !important;
|
|
40
|
+
/* !important is for cases like figure.breakout-item-max @TODO */
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -86,13 +87,9 @@
|
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
/*```
|
|
89
|
-
<!--section:summary-->
|
|
90
|
-
|
|
91
|
-
The `.breakout` layout allows images, tables, and other figures to automatically extend or bleed beyond their parent container’s width.
|
|
92
|
-
|
|
93
90
|
<!--section:docs-->
|
|
94
91
|
|
|
95
|
-
|
|
92
|
+
The `.breakout` layout allows images, tables, and other figures to automatically extend or bleed beyond their parent container’s width.
|
|
96
93
|
|
|
97
94
|
Break out a wide image from the text flow:
|
|
98
95
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<!--section:docs,columns-->
|
|
3
|
-
|
|
4
|
-
### Auto-columns
|
|
1
|
+
/*<!--section:docs-->
|
|
5
2
|
|
|
6
3
|
`.columns` automatically creates columns with at least 30 characters each:
|
|
7
4
|
|
|
@@ -17,7 +14,7 @@ The smaller the font size, the more columns will be created:
|
|
|
17
14
|
|
|
18
15
|
Useful for tables of contents and long lists.
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
<!--section:code-->
|
|
21
18
|
```css */
|
|
22
19
|
.columns {
|
|
23
20
|
columns: 25ch auto; /* common container 65ch / 25ch => 2 columns max, with a buffer for list paddings */
|
|
@@ -27,18 +24,3 @@ How it works:
|
|
|
27
24
|
break-inside: avoid;
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
|
-
/*```
|
|
31
|
-
<!--section:docs,jump-->
|
|
32
|
-
|
|
33
|
-
### Jump to top
|
|
34
|
-
|
|
35
|
-
`data-jump-to="top"` fixes element to the corner and adds extra top padding to make it easy to click:
|
|
36
|
-
```css */
|
|
37
|
-
[data-jump-to="top"] {
|
|
38
|
-
position: fixed;
|
|
39
|
-
bottom: 0;
|
|
40
|
-
right: 0;
|
|
41
|
-
padding-top: 50vh;
|
|
42
|
-
}
|
|
43
|
-
/*```
|
|
44
|
-
<!--section--> */
|
package/_config.yml
DELETED
package/blades.gemspec
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
Gem::Specification.new do |spec|
|
|
4
|
-
spec.name = "blades"
|
|
5
|
-
spec.version = "2.4.8"
|
|
6
|
-
|
|
7
|
-
spec.authors = ["Anton Staroverov"]
|
|
8
|
-
spec.homepage = "https://blades.ninja/"
|
|
9
|
-
spec.license = "MIT"
|
|
10
|
-
spec.summary = "Fully compatible and actively maintained successor to Pico CSS."
|
|
11
|
-
|
|
12
|
-
spec.files = Dir.glob("{_includes,css}/**/*")
|
|
13
|
-
# puts "spec.files: #{spec.files.inspect}"
|
|
14
|
-
|
|
15
|
-
spec.add_runtime_dependency "jekyll", ">= 3.5", "< 5.0"
|
|
16
|
-
end
|