@anyblades/blades 2.4.7 → 2.4.9
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 +91 -28
- package/blades.gemspec +1 -1
- package/css/blades.css +35 -62
- package/css/blades.standalone.core.css +35 -61
- package/css/blades.standalone.css +36 -67
- package/css/blades.standalone.theme.css +1 -5
- package/css/float-label.core.css +12 -12
- package/css/float-label.css +12 -12
- package/css/link-icon.css +6 -6
- package/package.json +1 -1
- package/src/_layout.css +2 -10
- package/src/_utilities.css +3 -4
- package/src/blades.standalone.core.css +2 -0
- package/src/blades.standalone.theme.css +1 -5
- package/src/components/_timeline.css +0 -1
- package/src/content/_code.css +3 -7
- package/src/content/_table.css +4 -7
- package/src/content/_typography.css +3 -10
- package/src/float-label.core.css +12 -12
- package/src/link-icon.css +2 -2
package/css/link-icon.css
CHANGED
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
\3c !--section:code-->
|
|
3
3
|
```css */
|
|
4
4
|
/* Use inline flex only if link contains an icon */
|
|
5
|
-
a:
|
|
5
|
+
a:not(.does-not-exist):has(> i) {
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
|
|
8
8
|
gap: 0.375ch; /* =3/8 */
|
|
9
9
|
text-wrap: balance;
|
|
10
10
|
}
|
|
11
|
-
a > i {
|
|
11
|
+
a:not(.does-not-exist) > i {
|
|
12
12
|
float: left; /* ✅ Chrome ❌ Safari */
|
|
13
13
|
font-style: normal;
|
|
14
14
|
text-underline-offset: -2em; /* ❌ Chrome ✅ Safari - to clip it with overflow-y */
|
|
15
15
|
}
|
|
16
16
|
/* Favicons */
|
|
17
|
-
a > i > img {
|
|
17
|
+
a:not(.does-not-exist) > i > img {
|
|
18
18
|
display: inline-block; /* for Tailwind CSS Typography */
|
|
19
19
|
max-width: none; /* to keep ratio safe */
|
|
20
20
|
height: 1.25em;
|
|
21
21
|
margin-block-start: calc(-0.25em / 2);
|
|
22
22
|
}
|
|
23
|
-
a > i[class^="fa-"],
|
|
24
|
-
a > i[class*=" fa-"] {
|
|
23
|
+
a:not(.does-not-exist) > i[class^="fa-"],
|
|
24
|
+
a:not(.does-not-exist) > i[class*=" fa-"] {
|
|
25
25
|
line-height: inherit;
|
|
26
26
|
--fa-width: auto;
|
|
27
27
|
}
|
|
28
28
|
/* Font Awesome */
|
|
29
|
-
a > i.fa-lg {
|
|
29
|
+
a:not(.does-not-exist) > i.fa-lg {
|
|
30
30
|
line-height: normal;
|
|
31
31
|
}
|
|
32
32
|
/*```
|
package/package.json
CHANGED
package/src/_layout.css
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<!--section:docs,columns-->
|
|
3
|
-
|
|
4
|
-
### Auto-columns
|
|
1
|
+
/*<!--section:columns-->
|
|
5
2
|
|
|
6
3
|
`.columns` automatically creates columns with at least 30 characters each:
|
|
7
4
|
|
|
@@ -27,10 +24,7 @@ How it works:
|
|
|
27
24
|
break-inside: avoid;
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
|
-
|
|
31
|
-
<!--section:docs,jump-->
|
|
32
|
-
|
|
33
|
-
### Jump to top
|
|
27
|
+
/*```<!--section:jump-->
|
|
34
28
|
|
|
35
29
|
`data-jump-to="top"` fixes element to the corner and adds extra top padding to make it easy to click:
|
|
36
30
|
```css */
|
|
@@ -40,5 +34,3 @@ How it works:
|
|
|
40
34
|
right: 0;
|
|
41
35
|
padding-top: 50vh;
|
|
42
36
|
}
|
|
43
|
-
/*```
|
|
44
|
-
<!--section--> */
|
package/src/_utilities.css
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<!--section:docs-->
|
|
1
|
+
/*<!--section:docs-->
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Auto-dark
|
|
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
|
|
package/src/content/_code.css
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
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
|
|
|
@@ -11,7 +8,8 @@ The `<pre><code>` blocks are Prism-compatible and support captions via `data-cap
|
|
|
11
8
|
├── blades.theme.css # minimal opinionated theme
|
|
12
9
|
└── blades.css # above two together
|
|
13
10
|
```
|
|
14
|
-
|
|
11
|
+
|
|
12
|
+
<!--section:code-->
|
|
15
13
|
```css */
|
|
16
14
|
pre {
|
|
17
15
|
@media (width < 768px) {
|
|
@@ -31,5 +29,3 @@ code {
|
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
|
-
/*```
|
|
35
|
-
<!--section--> */
|
package/src/content/_table.css
CHANGED
|
@@ -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 {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
<!--section:docs,h-anchor-->
|
|
3
|
-
|
|
4
|
-
### Heading anchors
|
|
1
|
+
/*<!--section:h-anchor-->
|
|
5
2
|
|
|
6
3
|
Links with `href="#..."` inside headings are automatically displayed as anchors:
|
|
7
4
|
|
|
8
5
|
<article>
|
|
9
|
-
<h2 style="margin: 0 0 0 1.5rem">Heading with anchor <a
|
|
6
|
+
<h2 style="margin: 0 0 0 1.5rem">Heading with anchor <a aria-hidden="true" style="visibility: visible">#</a></h2>
|
|
10
7
|
</article>
|
|
11
8
|
|
|
12
9
|
How it works:
|
|
@@ -41,9 +38,7 @@ h6 {
|
|
|
41
38
|
|
|
42
39
|
**PRO** example of automatic anchors for `11ty`+`markdown-it-anchor`: https://github.com/anyblades/eleventy-blades/blob/main/src/eleventy.config.js
|
|
43
40
|
|
|
44
|
-
<!--section:
|
|
45
|
-
|
|
46
|
-
### List markers
|
|
41
|
+
<!--section:list-->
|
|
47
42
|
|
|
48
43
|
Customize markers using inline `style="--list-marker:..."` on `<ul>/<ol>` or even individual `<li>`:
|
|
49
44
|
|
|
@@ -136,5 +131,3 @@ ol {
|
|
|
136
131
|
}
|
|
137
132
|
}
|
|
138
133
|
}
|
|
139
|
-
/*```
|
|
140
|
-
<!--section--> */
|
package/src/float-label.core.css
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* Sources moved here from https://github.com/anyblades/float-label-css for easier maintenance
|
|
2
2
|
<!--section:docs-->
|
|
3
3
|
|
|
4
4
|
First, we target either:
|
|
5
5
|
1. `<label>` which `:has` inner form inputs (classless approach)
|
|
6
6
|
2. or explicit `.has-float-label` class (explicit approach)
|
|
7
|
+
|
|
7
8
|
```css */
|
|
8
9
|
label:has(> span):has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select),
|
|
9
10
|
.has-float-label {
|
|
10
11
|
display: block;
|
|
11
12
|
position: relative;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```css */
|
|
13
|
+
/*```
|
|
14
|
+
Then, we define the default/fallback state (when the float label should be minimized):
|
|
15
|
+
```css */
|
|
16
16
|
> span,
|
|
17
17
|
label {
|
|
18
18
|
position: absolute;
|
|
@@ -21,10 +21,9 @@ Then, we define the default/fallback state (when the float label should be minim
|
|
|
21
21
|
cursor: text;
|
|
22
22
|
font-size: 75%;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```css */
|
|
24
|
+
/*```
|
|
25
|
+
Finally, we detect if placeholder is shown, but not in focus. That means we can safely hide it, and enlarge the float label instead:
|
|
26
|
+
```css */
|
|
28
27
|
*:placeholder-shown:not(:focus)::placeholder {
|
|
29
28
|
opacity: 0;
|
|
30
29
|
}
|
|
@@ -36,9 +35,10 @@ Finally, we detect if placeholder is shown, but not in focus. That means we can
|
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
/*```
|
|
39
|
+
|
|
41
40
|
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
41
|
|
|
43
42
|
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
|
-
|
|
43
|
+
|
|
44
|
+
<!--section-->*/
|
package/src/link-icon.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
|
|
2
2
|
<!--section:code-->
|
|
3
3
|
```css */
|
|
4
|
-
a {
|
|
4
|
+
a:not(.does-not-exist) /* soft win specificity over Pico's `a[role="button"]` and inner `img:not([height])` */ {
|
|
5
5
|
/* Use inline flex only if link contains an icon */
|
|
6
|
-
&:has(> i)
|
|
6
|
+
&:has(> i) {
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
gap: 0.375ch; /* =3/8 */
|
|
9
9
|
text-wrap: balance;
|