@anydigital/blades 0.27.0-beta.15 → 0.27.0-beta.16
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 +14 -9
- package/assets/blades.css +43 -40
- package/assets/blades.theme.css +9 -1
- package/assets/breakout.css +7 -2
- package/assets/link-icon.css +6 -6
- package/assets/responsive-table.css +9 -6
- package/blades.gemspec +1 -1
- package/package.json +1 -1
- package/src/_layout.css +4 -14
- package/src/_table.css +0 -2
- package/src/_typography.css +15 -9
- package/src/blades.theme.css +10 -1
- package/src/breakout.css +7 -2
- package/src/link-icon.css +6 -6
- package/src/responsive-table.css +9 -6
package/README.md
CHANGED
|
@@ -43,9 +43,9 @@ Nunjucks/Liquid batteries included (for 11ty/Build Awesome, Jekyll, etc.) 🥷
|
|
|
43
43
|
</ul>
|
|
44
44
|
|
|
45
45
|
<!--section:index,install-css-->
|
|
46
|
-
<details><summary role="button" class="outline"><b>Install CSS blades</b
|
|
46
|
+
<details><summary role="button" class="outline"><b>Install CSS blades</b> via CDN or npm</summary>
|
|
47
47
|
|
|
48
|
-
<mark>
|
|
48
|
+
<mark>Via CDN:</mark>
|
|
49
49
|
|
|
50
50
|
<!--prettier-ignore-->
|
|
51
51
|
```html
|
|
@@ -53,7 +53,7 @@ Nunjucks/Liquid batteries included (for 11ty/Build Awesome, Jekyll, etc.) 🥷
|
|
|
53
53
|
<link href="https://cdn.jsdelivr.net/npm/@anydigital/blades@^0.27.0-alpha/assets/blades.theme.min.css" rel="stylesheet" /><!-- optional -->
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
<mark>
|
|
56
|
+
<mark>Via npm:</mark>
|
|
57
57
|
|
|
58
58
|
```sh
|
|
59
59
|
npm install @anydigital/blades
|
|
@@ -83,7 +83,7 @@ Living example: https://github.com/anydigital/build-awesome-starter/blob/main/_s
|
|
|
83
83
|
<!--{.columns}-->
|
|
84
84
|
|
|
85
85
|
<!--section:index,install-html-->
|
|
86
|
-
<details><summary role="button" class="outline"><b>Install HTML blades</b
|
|
86
|
+
<details><summary role="button" class="outline"><b>Install HTML blades</b> via npm</summary>
|
|
87
87
|
|
|
88
88
|
```sh
|
|
89
89
|
npm install @anydigital/blades
|
|
@@ -93,12 +93,16 @@ ln -s ../node_modules/@anydigital/blades/_includes/blades
|
|
|
93
93
|
|
|
94
94
|
That's it! Now you can use HTML blades in your templates like this:
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
<mark>In Nunjucks:</mark>
|
|
97
|
+
|
|
98
|
+
```jinja2
|
|
97
99
|
{% extends 'blades/html.njk' %}
|
|
98
100
|
{% include 'blades/gtm.njk' %}
|
|
99
101
|
```
|
|
100
102
|
|
|
101
|
-
|
|
103
|
+
<mark>In Liquid:</mark>
|
|
104
|
+
|
|
105
|
+
```liquid
|
|
102
106
|
{% include blades/html.liquid %}
|
|
103
107
|
{% include blades/gtm.liquid for_body=true %}
|
|
104
108
|
{% render blades/links, links: site.links, current_url: page.url %}
|
|
@@ -136,11 +140,12 @@ Or use a preconfigured template:
|
|
|
136
140
|
|
|
137
141
|
- Featured by:
|
|
138
142
|
- https://github.com/uhub/awesome-css
|
|
139
|
-
- 🕶️ [
|
|
143
|
+
- 🕶️ [awesome-css-frameworks](https://github.com/gabrielizalo/Awesome-CSS-Frameworks-and-UI-Libraries/tree/master/Lightweight)
|
|
140
144
|
- 🕶️ [awesome-eleventy](https://github.com/anydigital/awesome-11ty-build-awesome)
|
|
145
|
+
- https://11tybundle.dev/showcase/
|
|
141
146
|
- [https://jekyll-themes.com/](https://jekyll-themes.com/anydigital/blades)
|
|
142
|
-
-
|
|
143
|
-
-
|
|
147
|
+
- https://github.com/anydigital/build-awesome-starter
|
|
148
|
+
- https://github.com/anydigital/bladeswitch starter
|
|
144
149
|
- https://github.com/hostfurl/minformhf starter
|
|
145
150
|
- Showcase:
|
|
146
151
|
- https://any.digital/ (Pico ⁺ Blades)
|
package/assets/blades.css
CHANGED
|
@@ -3,34 +3,23 @@
|
|
|
3
3
|
/* Layout */
|
|
4
4
|
|
|
5
5
|
/* Extends https://github.com/picocss/pico/blob/main/scss/layout/
|
|
6
|
-
<!--section:docs-->
|
|
6
|
+
<!--section:docs-intro-->
|
|
7
7
|
|
|
8
8
|
Global styles:
|
|
9
|
-
- Prevent horizontal overflow and scrolling, modern way.
|
|
10
9
|
```css */
|
|
11
10
|
|
|
12
11
|
html {
|
|
12
|
+
/* Prevent horizontal overflow and scrolling, modern way. */
|
|
13
13
|
overflow-x: clip;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
/*```
|
|
17
|
-
|
|
18
|
-
### Landmarks
|
|
19
|
-
- Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support).
|
|
20
|
-
- Make the `body` a flex container with column layout, and `main` to automatically fill available space. This is useful for creating sticky footers and full-height layouts.
|
|
21
|
-
```css */
|
|
22
|
-
|
|
23
16
|
body {
|
|
17
|
+
/* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
|
|
24
18
|
min-height: 100dvh;
|
|
25
|
-
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
> main {
|
|
29
|
-
flex-grow: 1;
|
|
30
|
-
}
|
|
31
19
|
}
|
|
32
20
|
|
|
33
21
|
/*```
|
|
22
|
+
<!--section:docs-->
|
|
34
23
|
|
|
35
24
|
### Auto-columns
|
|
36
25
|
```css */
|
|
@@ -151,10 +140,14 @@ Table of contents (`[data-is-toc]`) has auto-columns by default.
|
|
|
151
140
|
}
|
|
152
141
|
}
|
|
153
142
|
|
|
154
|
-
|
|
143
|
+
/*```
|
|
144
|
+
<!--section:docs,summary-->
|
|
145
|
+
|
|
155
146
|
Framework-agnostic utilities for breaking out images and figures beyond their container width.
|
|
156
147
|
|
|
157
|
-
Use the `.breakout` class to allow elements to extend beyond their parent container
|
|
148
|
+
Use the `.breakout` class to allow elements to extend beyond their parent container.
|
|
149
|
+
|
|
150
|
+
<!--section:docs-->
|
|
158
151
|
|
|
159
152
|
```html
|
|
160
153
|
<div class="breakout">
|
|
@@ -163,12 +156,13 @@ Use the `.breakout` class to allow elements to extend beyond their parent contai
|
|
|
163
156
|
```
|
|
164
157
|
|
|
165
158
|
The breakout container has `10%` inline padding and a max-width of `calc(10% + 65ch + 10%)`. The breakout utilities support images, pictures, figures, canvas, audio, video, tables, pre, iframe, and other media elements. Tables inside `.breakout` are specifically enhanced for horizontal scrolling and full-bleed mobile display. This is automatically included when you import the stylesheet.
|
|
159
|
+
|
|
166
160
|
<!--section--> */
|
|
167
161
|
|
|
168
162
|
/* Content */
|
|
169
163
|
|
|
170
164
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss
|
|
171
|
-
<!--section:docs-->
|
|
165
|
+
<!--section:docs-intro-->
|
|
172
166
|
|
|
173
167
|
Global styles:
|
|
174
168
|
```css */
|
|
@@ -190,6 +184,7 @@ body {
|
|
|
190
184
|
}
|
|
191
185
|
|
|
192
186
|
/*```
|
|
187
|
+
<!--section:docs-->
|
|
193
188
|
|
|
194
189
|
### Heading anchors
|
|
195
190
|
|
|
@@ -209,13 +204,14 @@ h6 {
|
|
|
209
204
|
position: relative;
|
|
210
205
|
|
|
211
206
|
[data-is-anchor] {
|
|
212
|
-
visibility: hidden;
|
|
213
207
|
position: absolute;
|
|
214
|
-
top: 0;
|
|
215
208
|
right: 100%;
|
|
209
|
+
top: 50%;
|
|
210
|
+
transform: translateY(-50%);
|
|
216
211
|
padding-right: 0.2ch;
|
|
217
212
|
color: silver;
|
|
218
213
|
text-decoration: none;
|
|
214
|
+
visibility: hidden;
|
|
219
215
|
}
|
|
220
216
|
/* Avoid double-tap on touch devices */
|
|
221
217
|
@media (hover: hover) {
|
|
@@ -263,14 +259,20 @@ ol {
|
|
|
263
259
|
/* ⚠️ `data-marker` works only in Chrome and Firefox */
|
|
264
260
|
content: attr(data-marker) " ";
|
|
265
261
|
}
|
|
262
|
+
}
|
|
266
263
|
|
|
267
|
-
|
|
268
|
-
&.unlist {
|
|
269
|
-
padding-inline-start: 0;
|
|
264
|
+
/*```
|
|
270
265
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
266
|
+
### Unlist
|
|
267
|
+
|
|
268
|
+
Helper class to remove list styling at all:
|
|
269
|
+
```css */
|
|
270
|
+
|
|
271
|
+
.unlist {
|
|
272
|
+
padding-inline-start: 0;
|
|
273
|
+
|
|
274
|
+
> li {
|
|
275
|
+
list-style: none;
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
278
|
|
|
@@ -282,15 +284,13 @@ ol {
|
|
|
282
284
|
```css */
|
|
283
285
|
|
|
284
286
|
a {
|
|
285
|
-
/*
|
|
287
|
+
/* Use inline flex only if link contains an icon */
|
|
286
288
|
&:has(> i) {
|
|
287
289
|
display: inline-flex;
|
|
288
290
|
gap: 0.375ch; /* =3/8 */
|
|
289
291
|
text-wrap: balance;
|
|
290
292
|
overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
|
|
291
293
|
}
|
|
292
|
-
|
|
293
|
-
/* Helper to handle [fav]icons in links */
|
|
294
294
|
> i {
|
|
295
295
|
font-style: normal;
|
|
296
296
|
float: left; /* ✅ Chrome ❌ Safari */
|
|
@@ -318,11 +318,13 @@ a {
|
|
|
318
318
|
/*```
|
|
319
319
|
> **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
320
320
|
|
|
321
|
-
<!--section:docs-->
|
|
321
|
+
<!--section:docs,summary-->
|
|
322
322
|
|
|
323
|
-
Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
|
|
323
|
+
Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
<!--section:docs-->
|
|
326
|
+
|
|
327
|
+
Compare:
|
|
326
328
|
|
|
327
329
|
| Without Blades <hr class="lg"> | With Blades' `<i>`-helper <hr class="lg"> | Clean HTML without `<span>ning` <hr class="x2"> |
|
|
328
330
|
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
|
@@ -383,8 +385,6 @@ table {
|
|
|
383
385
|
}
|
|
384
386
|
|
|
385
387
|
/*```
|
|
386
|
-
---
|
|
387
|
-
|
|
388
388
|
### Borderless table
|
|
389
389
|
|
|
390
390
|
`<table class="borderless">` removes all default borders:
|
|
@@ -442,21 +442,24 @@ Soft-increase selector specificity trick:
|
|
|
442
442
|
|
|
443
443
|
`table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
444
444
|
|
|
445
|
-
<!--section:docs-->
|
|
445
|
+
<!--section:docs,summary-->
|
|
446
446
|
|
|
447
|
-
`<table class="responsive">` allows a table to full-bleed and scroll on mobile
|
|
448
|
-
<hr><div>
|
|
447
|
+
`<table class="responsive">` allows a table to full-bleed and scroll on mobile.
|
|
449
448
|
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
<!--section:docs-->
|
|
450
|
+
|
|
451
|
+
| Term | Description <hr class="x2"> | Link |
|
|
452
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
452
453
|
| Responsive design | Approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfaction. | https://en.wikipedia.org/wiki/Responsive_web_design |
|
|
453
454
|
|
|
454
455
|
{.responsive}
|
|
455
|
-
|
|
456
|
+
|
|
457
|
+
---
|
|
456
458
|
|
|
457
459
|
Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
458
460
|
|
|
459
461
|
Living examples:
|
|
462
|
+
|
|
460
463
|
- https://any.digital/insights/ai-ide/
|
|
461
464
|
- https://any.digital/insights/css-frameworks/
|
|
462
465
|
- https://any.digital/insights/ssg/
|
package/assets/blades.theme.css
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/* <!--section:code-->
|
|
2
2
|
```css */
|
|
3
|
+
body {
|
|
4
|
+
/* Make the `body` a flex container with column layout, and `main` to automatically fill available space. This is useful for creating sticky footers and full-height layouts. */
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
> main {
|
|
8
|
+
flex-grow: 1;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
3
11
|
a {
|
|
4
12
|
&:not([href^="#"]) {
|
|
5
13
|
text-decoration-thickness: 1px;
|
|
@@ -57,7 +65,7 @@ table {
|
|
|
57
65
|
[data-jump-to="top"] {
|
|
58
66
|
> i {
|
|
59
67
|
display: inline-block;
|
|
60
|
-
padding: 0.25rem;
|
|
68
|
+
padding: 0.25rem 0.375rem;
|
|
61
69
|
margin: 0.5rem;
|
|
62
70
|
font-size: 0.75rem;
|
|
63
71
|
color: black;
|
package/assets/breakout.css
CHANGED
|
@@ -78,10 +78,14 @@
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
/*```
|
|
82
|
+
<!--section:docs,summary-->
|
|
83
|
+
|
|
82
84
|
Framework-agnostic utilities for breaking out images and figures beyond their container width.
|
|
83
85
|
|
|
84
|
-
Use the `.breakout` class to allow elements to extend beyond their parent container
|
|
86
|
+
Use the `.breakout` class to allow elements to extend beyond their parent container.
|
|
87
|
+
|
|
88
|
+
<!--section:docs-->
|
|
85
89
|
|
|
86
90
|
```html
|
|
87
91
|
<div class="breakout">
|
|
@@ -90,4 +94,5 @@ Use the `.breakout` class to allow elements to extend beyond their parent contai
|
|
|
90
94
|
```
|
|
91
95
|
|
|
92
96
|
The breakout container has `10%` inline padding and a max-width of `calc(10% + 65ch + 10%)`. The breakout utilities support images, pictures, figures, canvas, audio, video, tables, pre, iframe, and other media elements. Tables inside `.breakout` are specifically enhanced for horizontal scrolling and full-bleed mobile display. This is automatically included when you import the stylesheet.
|
|
97
|
+
|
|
93
98
|
<!--section--> */
|
package/assets/link-icon.css
CHANGED
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
<!--section:code-->
|
|
3
3
|
```css */
|
|
4
4
|
a {
|
|
5
|
-
/*
|
|
5
|
+
/* Use inline flex only if link contains an icon */
|
|
6
6
|
&:has(> i) {
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
gap: 0.375ch; /* =3/8 */
|
|
9
9
|
text-wrap: balance;
|
|
10
10
|
overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
/* Helper to handle [fav]icons in links */
|
|
14
12
|
> i {
|
|
15
13
|
font-style: normal;
|
|
16
14
|
float: left; /* ✅ Chrome ❌ Safari */
|
|
@@ -37,11 +35,13 @@ a {
|
|
|
37
35
|
/*```
|
|
38
36
|
> **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
39
37
|
|
|
40
|
-
<!--section:docs-->
|
|
38
|
+
<!--section:docs,summary-->
|
|
41
39
|
|
|
42
|
-
Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
|
|
40
|
+
Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
<!--section:docs-->
|
|
43
|
+
|
|
44
|
+
Compare:
|
|
45
45
|
|
|
46
46
|
| Without Blades <hr class="lg"> | With Blades' `<i>`-helper <hr class="lg"> | Clean HTML without `<span>ning` <hr class="x2"> |
|
|
47
47
|
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
|
@@ -29,21 +29,24 @@ Soft-increase selector specificity trick:
|
|
|
29
29
|
|
|
30
30
|
`table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
31
31
|
|
|
32
|
-
<!--section:docs-->
|
|
32
|
+
<!--section:docs,summary-->
|
|
33
|
+
|
|
34
|
+
`<table class="responsive">` allows a table to full-bleed and scroll on mobile.
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
<hr><div>
|
|
36
|
+
<!--section:docs-->
|
|
36
37
|
|
|
37
|
-
| Term
|
|
38
|
-
|
|
|
38
|
+
| Term | Description <hr class="x2"> | Link |
|
|
39
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
39
40
|
| Responsive design | Approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfaction. | https://en.wikipedia.org/wiki/Responsive_web_design |
|
|
40
41
|
|
|
41
42
|
{.responsive}
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
---
|
|
43
45
|
|
|
44
46
|
Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
45
47
|
|
|
46
48
|
Living examples:
|
|
49
|
+
|
|
47
50
|
- https://any.digital/insights/ai-ide/
|
|
48
51
|
- https://any.digital/insights/css-frameworks/
|
|
49
52
|
- https://any.digital/insights/ssg/
|
package/blades.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "blades"
|
|
5
|
-
spec.version = "0.27.0-beta.
|
|
5
|
+
spec.version = "0.27.0-beta.16"
|
|
6
6
|
spec.authors = ["Anton Staroverov"]
|
|
7
7
|
|
|
8
8
|
spec.summary = "Framework-agnostic CSS utilities and single-file Liquid 'blades' for modern web development."
|
package/package.json
CHANGED
package/src/_layout.css
CHANGED
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
/* Extends https://github.com/picocss/pico/blob/main/scss/layout/
|
|
2
|
-
<!--section:docs-->
|
|
2
|
+
<!--section:docs-intro-->
|
|
3
3
|
|
|
4
4
|
Global styles:
|
|
5
|
-
- Prevent horizontal overflow and scrolling, modern way.
|
|
6
5
|
```css */
|
|
7
6
|
html {
|
|
7
|
+
/* Prevent horizontal overflow and scrolling, modern way. */
|
|
8
8
|
overflow-x: clip;
|
|
9
9
|
}
|
|
10
|
-
/*```
|
|
11
|
-
|
|
12
|
-
### Landmarks
|
|
13
|
-
- Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support).
|
|
14
|
-
- Make the `body` a flex container with column layout, and `main` to automatically fill available space. This is useful for creating sticky footers and full-height layouts.
|
|
15
|
-
```css */
|
|
16
10
|
body {
|
|
11
|
+
/* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
|
|
17
12
|
min-height: 100dvh;
|
|
18
|
-
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
> main {
|
|
22
|
-
flex-grow: 1;
|
|
23
|
-
}
|
|
24
13
|
}
|
|
25
14
|
/*```
|
|
15
|
+
<!--section:docs-->
|
|
26
16
|
|
|
27
17
|
### Auto-columns
|
|
28
18
|
```css */
|
package/src/_table.css
CHANGED
package/src/_typography.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss
|
|
2
|
-
<!--section:docs-->
|
|
2
|
+
<!--section:docs-intro-->
|
|
3
3
|
|
|
4
4
|
Global styles:
|
|
5
5
|
```css */
|
|
@@ -19,6 +19,7 @@ body {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
/*```
|
|
22
|
+
<!--section:docs-->
|
|
22
23
|
|
|
23
24
|
### Heading anchors
|
|
24
25
|
|
|
@@ -37,13 +38,14 @@ h6 {
|
|
|
37
38
|
position: relative;
|
|
38
39
|
|
|
39
40
|
[data-is-anchor] {
|
|
40
|
-
visibility: hidden;
|
|
41
41
|
position: absolute;
|
|
42
|
-
top: 0;
|
|
43
42
|
right: 100%;
|
|
43
|
+
top: 50%;
|
|
44
|
+
transform: translateY(-50%);
|
|
44
45
|
padding-right: 0.2ch;
|
|
45
46
|
color: silver;
|
|
46
47
|
text-decoration: none;
|
|
48
|
+
visibility: hidden;
|
|
47
49
|
}
|
|
48
50
|
/* Avoid double-tap on touch devices */
|
|
49
51
|
@media (hover: hover) {
|
|
@@ -89,14 +91,18 @@ ol {
|
|
|
89
91
|
/* ⚠️ `data-marker` works only in Chrome and Firefox */
|
|
90
92
|
content: attr(data-marker) " ";
|
|
91
93
|
}
|
|
94
|
+
}
|
|
95
|
+
/*```
|
|
92
96
|
|
|
93
|
-
|
|
94
|
-
&.unlist {
|
|
95
|
-
padding-inline-start: 0;
|
|
97
|
+
### Unlist
|
|
96
98
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
Helper class to remove list styling at all:
|
|
100
|
+
```css */
|
|
101
|
+
.unlist {
|
|
102
|
+
padding-inline-start: 0;
|
|
103
|
+
|
|
104
|
+
> li {
|
|
105
|
+
list-style: none;
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
108
|
/*```
|
package/src/blades.theme.css
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
/* <!--section:code-->
|
|
2
2
|
```css */
|
|
3
|
+
body {
|
|
4
|
+
/* Make the `body` a flex container with column layout, and `main` to automatically fill available space. This is useful for creating sticky footers and full-height layouts. */
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
> main {
|
|
8
|
+
flex-grow: 1;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
a {
|
|
4
13
|
&:not([href^="#"]) {
|
|
5
14
|
text-decoration-thickness: 1px;
|
|
@@ -64,7 +73,7 @@ table {
|
|
|
64
73
|
[data-jump-to="top"] {
|
|
65
74
|
> i {
|
|
66
75
|
display: inline-block;
|
|
67
|
-
padding: 0.25rem;
|
|
76
|
+
padding: 0.25rem 0.375rem;
|
|
68
77
|
margin: 0.5rem;
|
|
69
78
|
font-size: 0.75rem;
|
|
70
79
|
color: black;
|
package/src/breakout.css
CHANGED
|
@@ -79,10 +79,14 @@
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
/*```
|
|
83
|
+
<!--section:docs,summary-->
|
|
84
|
+
|
|
83
85
|
Framework-agnostic utilities for breaking out images and figures beyond their container width.
|
|
84
86
|
|
|
85
|
-
Use the `.breakout` class to allow elements to extend beyond their parent container
|
|
87
|
+
Use the `.breakout` class to allow elements to extend beyond their parent container.
|
|
88
|
+
|
|
89
|
+
<!--section:docs-->
|
|
86
90
|
|
|
87
91
|
```html
|
|
88
92
|
<div class="breakout">
|
|
@@ -91,4 +95,5 @@ Use the `.breakout` class to allow elements to extend beyond their parent contai
|
|
|
91
95
|
```
|
|
92
96
|
|
|
93
97
|
The breakout container has `10%` inline padding and a max-width of `calc(10% + 65ch + 10%)`. The breakout utilities support images, pictures, figures, canvas, audio, video, tables, pre, iframe, and other media elements. Tables inside `.breakout` are specifically enhanced for horizontal scrolling and full-bleed mobile display. This is automatically included when you import the stylesheet.
|
|
98
|
+
|
|
94
99
|
<!--section--> */
|
package/src/link-icon.css
CHANGED
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
<!--section:code-->
|
|
3
3
|
```css */
|
|
4
4
|
a {
|
|
5
|
-
/*
|
|
5
|
+
/* Use inline flex only if link contains an icon */
|
|
6
6
|
&:has(> i) {
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
gap: 0.375ch; /* =3/8 */
|
|
9
9
|
text-wrap: balance;
|
|
10
10
|
overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
/* Helper to handle [fav]icons in links */
|
|
14
12
|
> i {
|
|
15
13
|
font-style: normal;
|
|
16
14
|
float: left; /* ✅ Chrome ❌ Safari */
|
|
@@ -37,11 +35,13 @@ a {
|
|
|
37
35
|
/*```
|
|
38
36
|
> **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
39
37
|
|
|
40
|
-
<!--section:docs-->
|
|
38
|
+
<!--section:docs,summary-->
|
|
41
39
|
|
|
42
|
-
Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
|
|
40
|
+
Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
<!--section:docs-->
|
|
43
|
+
|
|
44
|
+
Compare:
|
|
45
45
|
|
|
46
46
|
| Without Blades <hr class="lg"> | With Blades' `<i>`-helper <hr class="lg"> | Clean HTML without `<span>ning` <hr class="x2"> |
|
|
47
47
|
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
package/src/responsive-table.css
CHANGED
|
@@ -29,21 +29,24 @@ Soft-increase selector specificity trick:
|
|
|
29
29
|
|
|
30
30
|
`table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
31
31
|
|
|
32
|
-
<!--section:docs-->
|
|
32
|
+
<!--section:docs,summary-->
|
|
33
|
+
|
|
34
|
+
`<table class="responsive">` allows a table to full-bleed and scroll on mobile.
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
<hr><div>
|
|
36
|
+
<!--section:docs-->
|
|
36
37
|
|
|
37
|
-
| Term
|
|
38
|
-
|
|
|
38
|
+
| Term | Description <hr class="x2"> | Link |
|
|
39
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
39
40
|
| Responsive design | Approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfaction. | https://en.wikipedia.org/wiki/Responsive_web_design |
|
|
40
41
|
|
|
41
42
|
{.responsive}
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
---
|
|
43
45
|
|
|
44
46
|
Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
45
47
|
|
|
46
48
|
Living examples:
|
|
49
|
+
|
|
47
50
|
- https://any.digital/insights/ai-ide/
|
|
48
51
|
- https://any.digital/insights/css-frameworks/
|
|
49
52
|
- https://any.digital/insights/ssg/
|