@anyblades/blades 0.28.0-alpha.4 → 0.28.0-alpha.6
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 +29 -35
- package/_includes/blades/html.njk +1 -1
- package/assets/blades.core.css +201 -132
- package/assets/blades.css +234 -161
- package/assets/blades.theme.css +32 -27
- package/assets/breakout.css +40 -8
- package/assets/link-icon.css +20 -12
- package/assets/responsive-table.css +16 -13
- package/blades.gemspec +1 -1
- package/package.json +1 -1
- package/src/_layout.css +20 -23
- package/src/_utilities.css +35 -11
- package/src/blades.core.css +4 -4
- package/src/blades.theme.css +33 -29
- package/src/breakout.css +40 -8
- package/src/{_code.css → content/_code.css} +17 -4
- package/src/content/_table.css +66 -0
- package/src/content/_typography.css +114 -0
- package/src/link-icon.css +20 -12
- package/src/responsive-table.css +16 -13
- package/src/_table.css +0 -67
- package/src/_typography.css +0 -116
package/assets/blades.theme.css
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
|
+
<!--section:docs-->
|
|
3
|
+
<details>How it works:
|
|
2
4
|
```css */
|
|
3
5
|
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select),
|
|
4
6
|
.has-float-label {
|
|
@@ -31,17 +33,40 @@ label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
}
|
|
36
|
+
html {
|
|
37
|
+
/* Prevent horizontal overflow and scrolling, modern way. */
|
|
38
|
+
overflow-x: clip;
|
|
39
|
+
|
|
40
|
+
/* Enable font smoothing */
|
|
41
|
+
-webkit-font-smoothing: antialiased;
|
|
42
|
+
-moz-osx-font-smoothing: grayscale;
|
|
43
|
+
}
|
|
34
44
|
body {
|
|
45
|
+
/* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
|
|
46
|
+
min-height: 100dvh;
|
|
47
|
+
|
|
35
48
|
/* 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. */
|
|
36
49
|
display: flex;
|
|
37
50
|
flex-direction: column;
|
|
38
51
|
> main {
|
|
39
52
|
flex-grow: 1;
|
|
40
53
|
}
|
|
54
|
+
|
|
55
|
+
/* Evaluates the last ~4 lines of text blocks to prevent a single word from sitting on the final line. */
|
|
56
|
+
text-wrap: pretty;
|
|
57
|
+
|
|
58
|
+
/* Enable global hyphenation */
|
|
59
|
+
hyphens: auto;
|
|
60
|
+
/* ... except for links and tables which are better (safer) without hyphenation */
|
|
61
|
+
a,
|
|
62
|
+
table {
|
|
63
|
+
hyphens: none;
|
|
64
|
+
}
|
|
41
65
|
}
|
|
42
66
|
a {
|
|
43
67
|
&:not([href^="#"]) {
|
|
44
68
|
text-decoration-thickness: 1px;
|
|
69
|
+
|
|
45
70
|
&:hover {
|
|
46
71
|
text-decoration-thickness: 2px;
|
|
47
72
|
}
|
|
@@ -51,22 +76,6 @@ h1 {
|
|
|
51
76
|
font-size: 2.5em; /* for pico.css & tw-typography */
|
|
52
77
|
margin-bottom: 1rem; /* for tw-typography */
|
|
53
78
|
}
|
|
54
|
-
/* Potential fix https://github.com/picocss/pico/blob/main/css/pico.css for the very first headings
|
|
55
|
-
:where(article, address, blockquote, dl, figure, form, ol, p, pre, table, ul) ~ :is(h1, h2, h3, h4, h5, h6) {
|
|
56
|
-
margin-top: var(--pico-typography-spacing-top);
|
|
57
|
-
}
|
|
58
|
-
h1,
|
|
59
|
-
h2,
|
|
60
|
-
h3,
|
|
61
|
-
h4,
|
|
62
|
-
h5,
|
|
63
|
-
h6 {
|
|
64
|
-
& ~ & {
|
|
65
|
-
margin-bottom: 2rem;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
NOTE: be careful with wrapped headings, i.e. inside nav: https://blades.ninja/build-awesome-11ty/#usage
|
|
69
|
-
*/
|
|
70
79
|
hr {
|
|
71
80
|
margin-block: 2em; /* for pico.css & tw-typography */
|
|
72
81
|
}
|
|
@@ -94,6 +103,11 @@ table {
|
|
|
94
103
|
}
|
|
95
104
|
}
|
|
96
105
|
[data-jump-to="top"] {
|
|
106
|
+
opacity: 25%;
|
|
107
|
+
&:hover {
|
|
108
|
+
opacity: 75%;
|
|
109
|
+
}
|
|
110
|
+
|
|
97
111
|
> i {
|
|
98
112
|
display: inline-block;
|
|
99
113
|
padding: 0.25rem 0.375rem;
|
|
@@ -103,16 +117,6 @@ table {
|
|
|
103
117
|
border-color: black;
|
|
104
118
|
}
|
|
105
119
|
}
|
|
106
|
-
[data-is-toc] {
|
|
107
|
-
font-size: 87.5%;
|
|
108
|
-
|
|
109
|
-
a {
|
|
110
|
-
text-decoration: none;
|
|
111
|
-
}
|
|
112
|
-
> ul > * > a {
|
|
113
|
-
font-weight: 500;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
120
|
.breakout,
|
|
117
121
|
.breakout-all {
|
|
118
122
|
> img,
|
|
@@ -126,4 +130,5 @@ table {
|
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
/*```
|
|
133
|
+
</details>
|
|
129
134
|
<!--section--> */
|
package/assets/breakout.css
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
|
+
<!--section:how-->
|
|
3
|
+
<details>How it works:
|
|
4
|
+
```css */
|
|
2
5
|
.breakout,
|
|
3
6
|
.breakout-all {
|
|
4
7
|
/* Prepare the container for breakout elements */
|
|
@@ -79,20 +82,49 @@
|
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
/*```
|
|
82
|
-
|
|
85
|
+
</details>
|
|
83
86
|
|
|
84
|
-
|
|
87
|
+
<!--section:summary-->
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
The `.breakout` layout allows images, tables, and other figures to automatically extend or bleed beyond their parent container’s width.
|
|
87
90
|
|
|
88
91
|
<!--section:docs-->
|
|
89
92
|
|
|
93
|
+
### Demo <!-- inside parent .breakout -->
|
|
94
|
+
|
|
95
|
+
Break out a wide image from the text flow:
|
|
96
|
+
|
|
97
|
+
<div><!-- Dummy div to avoid p tag in Markdown --></div><img
|
|
98
|
+
src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='3000' height='300'><rect width='100%' height='100%' fill='gray'/></svg>">
|
|
99
|
+
|
|
100
|
+
Or table:
|
|
101
|
+
|
|
102
|
+
| Imagine<hr> | a<hr> | really<hr> | wide<hr> | table<hr> | here<hr> |
|
|
103
|
+
| ----------- | ----- | ---------- | -------- | --------- | -------- |
|
|
104
|
+
| ... |
|
|
105
|
+
|
|
106
|
+
Or code block:
|
|
107
|
+
|
|
90
108
|
```html
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
109
|
+
<p>
|
|
110
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod. Lorem ipsum dolor sit amet consectetur
|
|
111
|
+
adipisicing elit. Quisquam, quod.
|
|
112
|
+
</p>
|
|
94
113
|
```
|
|
95
114
|
|
|
96
|
-
|
|
115
|
+
Or anything else:
|
|
116
|
+
|
|
117
|
+
<article class="breakout-item-max" data-theme="dark">
|
|
118
|
+
|
|
119
|
+
Using `.breakout-item` and `.breakout-item-max` helpers {style=margin:0}
|
|
120
|
+
|
|
121
|
+
</article>
|
|
122
|
+
|
|
123
|
+
<div><hr></div>
|
|
124
|
+
|
|
125
|
+
`.breakout-all` also visually breaks out headings and horizontal rules:
|
|
126
|
+
|
|
127
|
+
<h2>Heading 2</h2><h3>Heading 3</h3><h4>Heading 4</h4><h5>Heading 5</h5><h6>Heading 6</h6>
|
|
128
|
+
<hr>
|
|
97
129
|
|
|
98
130
|
<!--section--> */
|
package/assets/link-icon.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
|
|
2
|
-
<!--section:
|
|
2
|
+
<!--section:how-->
|
|
3
|
+
<details>How it works:
|
|
3
4
|
```css */
|
|
4
5
|
a {
|
|
5
6
|
/* Use inline flex only if link contains an icon */
|
|
@@ -33,24 +34,31 @@ a {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
/*```
|
|
36
|
-
>
|
|
37
|
+
</details>
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
How we made it: https://codepen.io/editor/anydigital/pen/019d2b94-5616-75dc-a23e-e111869d5237
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
**PRO** example of automatic favicons for `11ty`: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
42
|
+
|
|
43
|
+
<!--section:summary-->
|
|
44
|
+
|
|
45
|
+
Use *Bl*ades `<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.
|
|
41
46
|
|
|
42
47
|
<!--section:docs-->
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
<article class="breakout-item">
|
|
45
50
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
| [
|
|
49
|
-
| [
|
|
50
|
-
| [<
|
|
51
|
+
| Use `<i>`-helper with | Clean HTML without `<span>ning` |
|
|
52
|
+
| ------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
53
|
+
| [<i>🥷</i> Emojis](#) | `<a><i>🥷</i> Text</a>` |
|
|
54
|
+
| [<i></i> Favicons](#) | `<a><i><img src="..."></i> Text</a>` |
|
|
55
|
+
| [<i class="fa-brands fa-github fa-lg"></i> Font Awesome icons](#) | `<a><i class="fa-..."></i> Text</a>` |
|
|
56
|
+
</article>
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
Or even:
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
<article>
|
|
61
|
+
<a href="#" style="margin: 0 0 0 1rem"><i>🥷</i> very-very-very-very-very-<br>long-multiline-links</a>
|
|
62
|
+
</article>
|
|
55
63
|
|
|
56
64
|
<!--section--> */
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
|
+
<!--section:how-->
|
|
3
|
+
<details>How it works:
|
|
2
4
|
```css */
|
|
3
5
|
table.responsive,
|
|
4
6
|
.breakout > table:not(.does-not-exist),
|
|
@@ -24,17 +26,20 @@ table.responsive,
|
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
/*```
|
|
27
|
-
|
|
28
|
-
Soft-increase selector specificity trick:
|
|
29
|
+
</details>
|
|
29
30
|
|
|
30
|
-
`table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
31
|
+
`table:not(.does-not-exist)` trick (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
31
32
|
|
|
32
|
-
<!--section:
|
|
33
|
+
<!--section:summary-->
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
`.responsive` makes a table full-bleed and scroll on mobile, without a need for a redundant wrapper (finally).
|
|
36
|
+
|
|
37
|
+
Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
35
38
|
|
|
36
39
|
<!--section:docs-->
|
|
37
40
|
|
|
41
|
+
### Demo table
|
|
42
|
+
|
|
38
43
|
| Term | Description <hr class="x2"> | Link |
|
|
39
44
|
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
40
45
|
| 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 |
|
|
@@ -43,13 +48,11 @@ Soft-increase selector specificity trick:
|
|
|
43
48
|
|
|
44
49
|
---
|
|
45
50
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Living examples:
|
|
51
|
+
Living examples: <!--A-Z-->
|
|
49
52
|
|
|
50
|
-
- https://
|
|
51
|
-
- https://
|
|
52
|
-
- https://
|
|
53
|
-
- https://blades.ninja/
|
|
53
|
+
- https://blades.ninja/ai/ide/
|
|
54
|
+
- https://blades.ninja/build-awesome-11ty/starters/
|
|
55
|
+
- https://blades.ninja/css/frameworks/
|
|
56
|
+
- https://blades.ninja/ssg/
|
|
54
57
|
|
|
55
58
|
<!--section--> */
|
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.28.0-alpha.
|
|
5
|
+
spec.version = "0.28.0-alpha.6"
|
|
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,24 +1,25 @@
|
|
|
1
1
|
/* Extends https://github.com/picocss/pico/blob/main/scss/layout/
|
|
2
|
-
<!--section:docs-intro-->
|
|
3
|
-
|
|
4
|
-
Global styles:
|
|
5
|
-
```css */
|
|
6
|
-
html {
|
|
7
|
-
/* Prevent horizontal overflow and scrolling, modern way. */
|
|
8
|
-
overflow-x: clip;
|
|
9
|
-
}
|
|
10
|
-
body {
|
|
11
|
-
/* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
|
|
12
|
-
min-height: 100dvh;
|
|
13
|
-
}
|
|
14
|
-
/*```
|
|
15
2
|
<!--section:docs-->
|
|
16
3
|
|
|
17
4
|
### Auto-columns
|
|
5
|
+
|
|
6
|
+
`.columns` automatically creates columns with at least 30 characters each:
|
|
7
|
+
|
|
8
|
+
<article class="columns">
|
|
9
|
+
<p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p>
|
|
10
|
+
</article>
|
|
11
|
+
|
|
12
|
+
The smaller the font size, the more columns will be created:
|
|
13
|
+
|
|
14
|
+
<article class="columns" style="font-size: 65%">
|
|
15
|
+
<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>
|
|
16
|
+
</article>
|
|
17
|
+
|
|
18
|
+
Useful for tables of contents and long lists.
|
|
19
|
+
|
|
20
|
+
<details>How it works:
|
|
18
21
|
```css */
|
|
19
|
-
.columns
|
|
20
|
-
[data-is-toc] > ul,
|
|
21
|
-
[data-is-toc] > ol {
|
|
22
|
+
.columns {
|
|
22
23
|
columns: 30ch auto; /* 2 cols max for 65ch container */
|
|
23
24
|
|
|
24
25
|
/* Avoid breaking inside elements, such as nested lists */
|
|
@@ -27,21 +28,17 @@ body {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
/*```
|
|
30
|
-
|
|
31
|
-
Table of contents (`[data-is-toc]`) has auto-columns by default.
|
|
31
|
+
</details>
|
|
32
32
|
|
|
33
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:
|
|
34
36
|
```css */
|
|
35
37
|
[data-jump-to="top"] {
|
|
36
38
|
position: fixed;
|
|
37
39
|
bottom: 0;
|
|
38
40
|
right: 0;
|
|
39
41
|
padding-top: 50vh;
|
|
40
|
-
opacity: 25%;
|
|
41
|
-
|
|
42
|
-
&:hover {
|
|
43
|
-
opacity: 75%;
|
|
44
|
-
}
|
|
45
42
|
}
|
|
46
43
|
/*```
|
|
47
44
|
<!--section--> */
|
package/src/_utilities.css
CHANGED
|
@@ -1,34 +1,58 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* Extends https://github.com/picocss/pico/tree/main/scss/utilities
|
|
2
2
|
<!--section:docs-->
|
|
3
3
|
|
|
4
4
|
### Auto-dark
|
|
5
|
+
|
|
6
|
+
`.dark-auto` automatically creates a simple dark version of any element:
|
|
7
|
+
|
|
8
|
+
<article data-theme="dark">
|
|
9
|
+
<p>Look how cool <big class="dark-auto">🔥🕷️🐦⬛🐄🦓</big> can look in the dark!</p>
|
|
10
|
+
</article>
|
|
11
|
+
|
|
12
|
+
<details>How it works:
|
|
5
13
|
```css */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
/* Per https://picocss.com/docs/css-variables#css-variables-for-color-schemes */
|
|
15
|
+
:root {
|
|
16
|
+
--blades-dark-filter: invert(100%) hue-rotate(180deg);
|
|
17
|
+
}
|
|
18
|
+
.dark-auto {
|
|
19
|
+
/* Dark color scheme (Auto) */
|
|
20
|
+
@media (prefers-color-scheme: dark) {
|
|
21
|
+
filter: var(--blades-dark-filter);
|
|
22
|
+
}
|
|
23
|
+
/* Dark color scheme (Forced) */
|
|
24
|
+
&[data-theme="dark"],
|
|
25
|
+
&:where([data-theme="dark"] *) {
|
|
26
|
+
filter: var(--blades-dark-filter);
|
|
11
27
|
}
|
|
12
28
|
}
|
|
13
29
|
/*```
|
|
30
|
+
</details>
|
|
14
31
|
|
|
15
32
|
### Faded
|
|
33
|
+
|
|
34
|
+
`.faded` reduces the opacity of an element:
|
|
35
|
+
|
|
36
|
+
<article class="faded">
|
|
37
|
+
Hover to unfade me!
|
|
38
|
+
</article>
|
|
39
|
+
|
|
40
|
+
<details>How it works:
|
|
16
41
|
```css */
|
|
17
42
|
.faded {
|
|
18
43
|
opacity: 50%;
|
|
44
|
+
|
|
19
45
|
&:hover {
|
|
20
46
|
opacity: 87.5%;
|
|
21
47
|
}
|
|
22
48
|
}
|
|
23
49
|
/*```
|
|
50
|
+
</details>
|
|
51
|
+
<!--section--> */
|
|
24
52
|
|
|
25
|
-
|
|
26
|
-
```css */
|
|
27
|
-
/* Extends https://tailwindcss.com/docs/filter-invert */
|
|
53
|
+
/* Fix the scrollbar color when inverted by https://tailwindcss.com/docs/filter-invert */
|
|
28
54
|
.invert {
|
|
29
|
-
/* Fix the scrollbar color when inverted */
|
|
30
55
|
::-webkit-scrollbar {
|
|
31
56
|
filter: invert(1) !important;
|
|
32
57
|
}
|
|
33
58
|
}
|
|
34
|
-
/*``` <!--section--> */
|
package/src/blades.core.css
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/* Follows https://github.com/picocss/pico/blob/main/scss/_index.scss */
|
|
2
2
|
|
|
3
3
|
/* Layout */
|
|
4
4
|
@import "./_layout";
|
|
5
5
|
@import "./breakout";
|
|
6
6
|
|
|
7
7
|
/* Content */
|
|
8
|
-
@import "./_typography";
|
|
8
|
+
@import "./content/_typography";
|
|
9
9
|
@import "./link-icon";
|
|
10
|
-
@import "./_table";
|
|
10
|
+
@import "./content/_table";
|
|
11
11
|
@import "./responsive-table";
|
|
12
|
-
@import "./_code";
|
|
12
|
+
@import "./content/_code";
|
|
13
13
|
|
|
14
14
|
/* Forms */
|
|
15
15
|
@import "./float-label.core";
|
package/src/blades.theme.css
CHANGED
|
@@ -1,19 +1,45 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
|
+
<!--section:docs-->
|
|
3
|
+
<details>How it works:
|
|
2
4
|
```css */
|
|
3
5
|
@import "./float-label.theme";
|
|
4
6
|
|
|
7
|
+
html {
|
|
8
|
+
/* Prevent horizontal overflow and scrolling, modern way. */
|
|
9
|
+
overflow-x: clip;
|
|
10
|
+
|
|
11
|
+
/* Enable font smoothing */
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
body {
|
|
17
|
+
/* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
|
|
18
|
+
min-height: 100dvh;
|
|
19
|
+
|
|
6
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. */
|
|
7
21
|
display: flex;
|
|
8
22
|
flex-direction: column;
|
|
9
23
|
> main {
|
|
10
24
|
flex-grow: 1;
|
|
11
25
|
}
|
|
26
|
+
|
|
27
|
+
/* Evaluates the last ~4 lines of text blocks to prevent a single word from sitting on the final line. */
|
|
28
|
+
text-wrap: pretty;
|
|
29
|
+
|
|
30
|
+
/* Enable global hyphenation */
|
|
31
|
+
hyphens: auto;
|
|
32
|
+
/* ... except for links and tables which are better (safer) without hyphenation */
|
|
33
|
+
a,
|
|
34
|
+
table {
|
|
35
|
+
hyphens: none;
|
|
36
|
+
}
|
|
12
37
|
}
|
|
13
38
|
|
|
14
39
|
a {
|
|
15
40
|
&:not([href^="#"]) {
|
|
16
41
|
text-decoration-thickness: 1px;
|
|
42
|
+
|
|
17
43
|
&:hover {
|
|
18
44
|
text-decoration-thickness: 2px;
|
|
19
45
|
}
|
|
@@ -25,23 +51,6 @@ h1 {
|
|
|
25
51
|
margin-bottom: 1rem; /* for tw-typography */
|
|
26
52
|
}
|
|
27
53
|
|
|
28
|
-
/* Potential fix https://github.com/picocss/pico/blob/main/css/pico.css for the very first headings
|
|
29
|
-
:where(article, address, blockquote, dl, figure, form, ol, p, pre, table, ul) ~ :is(h1, h2, h3, h4, h5, h6) {
|
|
30
|
-
margin-top: var(--pico-typography-spacing-top);
|
|
31
|
-
}
|
|
32
|
-
h1,
|
|
33
|
-
h2,
|
|
34
|
-
h3,
|
|
35
|
-
h4,
|
|
36
|
-
h5,
|
|
37
|
-
h6 {
|
|
38
|
-
& ~ & {
|
|
39
|
-
margin-bottom: 2rem;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
NOTE: be careful with wrapped headings, i.e. inside nav: https://blades.ninja/build-awesome-11ty/#usage
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
54
|
hr {
|
|
46
55
|
margin-block: 2em; /* for pico.css & tw-typography */
|
|
47
56
|
}
|
|
@@ -73,6 +82,11 @@ table {
|
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
[data-jump-to="top"] {
|
|
85
|
+
opacity: 25%;
|
|
86
|
+
&:hover {
|
|
87
|
+
opacity: 75%;
|
|
88
|
+
}
|
|
89
|
+
|
|
76
90
|
> i {
|
|
77
91
|
display: inline-block;
|
|
78
92
|
padding: 0.25rem 0.375rem;
|
|
@@ -83,17 +97,6 @@ table {
|
|
|
83
97
|
}
|
|
84
98
|
}
|
|
85
99
|
|
|
86
|
-
[data-is-toc] {
|
|
87
|
-
font-size: 87.5%;
|
|
88
|
-
|
|
89
|
-
a {
|
|
90
|
-
text-decoration: none;
|
|
91
|
-
}
|
|
92
|
-
> ul > * > a {
|
|
93
|
-
font-weight: 500;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
100
|
.breakout,
|
|
98
101
|
.breakout-all {
|
|
99
102
|
> img,
|
|
@@ -108,4 +111,5 @@ table {
|
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
/*```
|
|
114
|
+
</details>
|
|
111
115
|
<!--section--> */
|
package/src/breakout.css
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
|
+
<!--section:how-->
|
|
3
|
+
<details>How it works:
|
|
4
|
+
```css */
|
|
2
5
|
.breakout,
|
|
3
6
|
.breakout-all {
|
|
4
7
|
/* Prepare the container for breakout elements */
|
|
@@ -80,20 +83,49 @@
|
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
/*```
|
|
83
|
-
|
|
86
|
+
</details>
|
|
84
87
|
|
|
85
|
-
|
|
88
|
+
<!--section:summary-->
|
|
86
89
|
|
|
87
|
-
|
|
90
|
+
The `.breakout` layout allows images, tables, and other figures to automatically extend or bleed beyond their parent container’s width.
|
|
88
91
|
|
|
89
92
|
<!--section:docs-->
|
|
90
93
|
|
|
94
|
+
### Demo <!-- inside parent .breakout -->
|
|
95
|
+
|
|
96
|
+
Break out a wide image from the text flow:
|
|
97
|
+
|
|
98
|
+
<div><!-- Dummy div to avoid p tag in Markdown --></div><img
|
|
99
|
+
src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='3000' height='300'><rect width='100%' height='100%' fill='gray'/></svg>">
|
|
100
|
+
|
|
101
|
+
Or table:
|
|
102
|
+
|
|
103
|
+
| Imagine<hr> | a<hr> | really<hr> | wide<hr> | table<hr> | here<hr> |
|
|
104
|
+
| ----------- | ----- | ---------- | -------- | --------- | -------- |
|
|
105
|
+
| ... |
|
|
106
|
+
|
|
107
|
+
Or code block:
|
|
108
|
+
|
|
91
109
|
```html
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
110
|
+
<p>
|
|
111
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod. Lorem ipsum dolor sit amet consectetur
|
|
112
|
+
adipisicing elit. Quisquam, quod.
|
|
113
|
+
</p>
|
|
95
114
|
```
|
|
96
115
|
|
|
97
|
-
|
|
116
|
+
Or anything else:
|
|
117
|
+
|
|
118
|
+
<article class="breakout-item-max" data-theme="dark">
|
|
119
|
+
|
|
120
|
+
Using `.breakout-item` and `.breakout-item-max` helpers {style=margin:0}
|
|
121
|
+
|
|
122
|
+
</article>
|
|
123
|
+
|
|
124
|
+
<div><hr></div>
|
|
125
|
+
|
|
126
|
+
`.breakout-all` also visually breaks out headings and horizontal rules:
|
|
127
|
+
|
|
128
|
+
<h2>Heading 2</h2><h3>Heading 3</h3><h4>Heading 4</h4><h5>Heading 5</h5><h6>Heading 6</h6>
|
|
129
|
+
<hr>
|
|
98
130
|
|
|
99
131
|
<!--section--> */
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_code.scss
|
|
2
|
+
<!--section:docs-->
|
|
3
|
+
|
|
2
4
|
### Code
|
|
3
|
-
|
|
5
|
+
|
|
6
|
+
The `<pre><code>` blocks are Prism-compatible and support captions via `data-caption="..."` attribute:
|
|
7
|
+
|
|
8
|
+
```treeview {data-caption="Key Blades CSS files:"}
|
|
9
|
+
├── blades.core.css # reusable class-light utilities, unthemed
|
|
10
|
+
├── blades.theme.css # minimal opinionated theme
|
|
11
|
+
└── blades.css # above two together
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
<details>How it works:
|
|
4
15
|
```css */
|
|
5
16
|
pre {
|
|
6
17
|
padding: 1rem 1.5rem;
|
|
@@ -28,7 +39,7 @@ code {
|
|
|
28
39
|
}
|
|
29
40
|
}
|
|
30
41
|
|
|
31
|
-
|
|
42
|
+
/* Extends https://github.com/PrismJS/prism/blob/master/plugins/treeview/prism-treeview.css */
|
|
32
43
|
.token.treeview-part {
|
|
33
44
|
.entry-line {
|
|
34
45
|
width: 2.5em !important;
|
|
@@ -42,4 +53,6 @@ code {
|
|
|
42
53
|
}
|
|
43
54
|
}
|
|
44
55
|
}
|
|
45
|
-
/*```
|
|
56
|
+
/*```
|
|
57
|
+
</details>
|
|
58
|
+
<!--section--> */
|