@anydigital/bricks 0.27.0-alpha.6 → 0.27.0-alpha.7
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 +2 -2
- package/_includes/bricks/nav.liquid +6 -1
- package/assets/breakout.css +3 -3
- package/assets/bricks.css +38 -8
- package/assets/bricks.theme.css +40 -0
- package/bricks.gemspec +1 -1
- package/package.json +2 -1
- package/src/{_refactor/_prose.css → _TODO.css} +0 -36
- package/src/_tricks.css +32 -1
- package/src/_unreduce-motion.css +12 -0
- package/src/breakout.css +3 -3
- package/src/bricks.css +0 -2
- package/src/bricks.theme.css +40 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# `bricks[.css]
|
|
1
|
+
# `bricks`<sub><sup>`[.css|.njk|.liquid]`</sup></sub>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A graceful, semantic CSS extension for Pico or Tailwind, with Nunjucks/Liquid batteries included 🥷
|
|
4
4
|
|
|
5
5
|
<!--section:css-h2-->
|
|
6
6
|
|
|
@@ -6,4 +6,9 @@
|
|
|
6
6
|
</a>
|
|
7
7
|
{%- endfor %}
|
|
8
8
|
</nav>
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
{%- comment %}
|
|
11
|
+
Compatible with:
|
|
12
|
+
- https://picocss.com/docs/nav
|
|
13
|
+
- https://www.11ty.dev/docs/plugins/navigation/#bring-your-own-html-render-the-menu-items-manually
|
|
14
|
+
{%- endcomment %}
|
package/assets/breakout.css
CHANGED
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
table,
|
|
13
13
|
pre,
|
|
14
14
|
figure, video, iframe, canvas,
|
|
15
|
-
|
|
16
|
-
p > img, p > picture,
|
|
15
|
+
img, picture,
|
|
17
16
|
/* Custom utility classes for other tags that need to be broken out */
|
|
18
17
|
.breakout-item,
|
|
19
18
|
.breakout-item-max
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
/* Respect img/picture min-width */
|
|
29
|
-
&:is(
|
|
28
|
+
&:is(img, picture) {
|
|
30
29
|
min-width: auto;
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -86,6 +85,7 @@
|
|
|
86
85
|
background: linear-gradient(to left, gray, transparent);
|
|
87
86
|
}
|
|
88
87
|
|
|
88
|
+
/* @TODO: add to tricks-wiki why `*` works here, but `&` fails */
|
|
89
89
|
&:where(hr + *) {
|
|
90
90
|
&::before {
|
|
91
91
|
display: none !important;
|
package/assets/bricks.css
CHANGED
|
@@ -45,8 +45,6 @@ pre {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/* @import "./_prose"; */
|
|
49
|
-
|
|
50
48
|
/* Breakout CSS - Framework-agnostic utilities for breaking out images and figures */
|
|
51
49
|
|
|
52
50
|
.breakout,
|
|
@@ -61,8 +59,7 @@ pre {
|
|
|
61
59
|
table,
|
|
62
60
|
pre,
|
|
63
61
|
figure, video, iframe, canvas,
|
|
64
|
-
|
|
65
|
-
p > img, p > picture,
|
|
62
|
+
img, picture,
|
|
66
63
|
/* Custom utility classes for other tags that need to be broken out */
|
|
67
64
|
.breakout-item,
|
|
68
65
|
.breakout-item-max
|
|
@@ -75,7 +72,7 @@ pre {
|
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
/* Respect img/picture min-width */
|
|
78
|
-
&:is(
|
|
75
|
+
&:is(img, picture) {
|
|
79
76
|
min-width: auto;
|
|
80
77
|
}
|
|
81
78
|
|
|
@@ -135,6 +132,7 @@ pre {
|
|
|
135
132
|
background: linear-gradient(to left, gray, transparent);
|
|
136
133
|
}
|
|
137
134
|
|
|
135
|
+
/* @TODO: add to tricks-wiki why `*` works here, but `&` fails */
|
|
138
136
|
&:where(hr + *) {
|
|
139
137
|
&::before {
|
|
140
138
|
display: none !important;
|
|
@@ -171,8 +169,6 @@ pre {
|
|
|
171
169
|
}
|
|
172
170
|
}
|
|
173
171
|
|
|
174
|
-
/* @import "./_util"; */
|
|
175
|
-
|
|
176
172
|
table.borderless {
|
|
177
173
|
th,
|
|
178
174
|
td {
|
|
@@ -206,6 +202,14 @@ h6 {
|
|
|
206
202
|
}
|
|
207
203
|
}
|
|
208
204
|
|
|
205
|
+
/* Helper to handle icons in links */
|
|
206
|
+
|
|
207
|
+
a > i {
|
|
208
|
+
display: inline-block;
|
|
209
|
+
margin-inline-end: 0.375ch; /* =3/8 */
|
|
210
|
+
font-style: normal;
|
|
211
|
+
}
|
|
212
|
+
|
|
209
213
|
/* Favicons in links @TODO: add to tricks-wiki */
|
|
210
214
|
|
|
211
215
|
a[data-has-favicon] {
|
|
@@ -214,7 +218,7 @@ a[data-has-favicon] {
|
|
|
214
218
|
> img {
|
|
215
219
|
max-height: 1.25em;
|
|
216
220
|
margin-top: calc(-0.25em / 2);
|
|
217
|
-
margin-inline-end: 0.
|
|
221
|
+
margin-inline-end: 0.375ch; /* =3/8 */
|
|
218
222
|
|
|
219
223
|
/* for tw-typography (.prose) */
|
|
220
224
|
display: inline-block;
|
|
@@ -230,3 +234,29 @@ a[data-has-favicon] {
|
|
|
230
234
|
filter: invert(1) !important;
|
|
231
235
|
}
|
|
232
236
|
}
|
|
237
|
+
|
|
238
|
+
/* Jump to top trick */
|
|
239
|
+
|
|
240
|
+
[data-jump-to="top"] {
|
|
241
|
+
position: fixed;
|
|
242
|
+
bottom: 0;
|
|
243
|
+
right: 0;
|
|
244
|
+
padding-top: 50vh;
|
|
245
|
+
opacity: 25%;
|
|
246
|
+
|
|
247
|
+
&:hover {
|
|
248
|
+
opacity: 75%;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Table of contents */
|
|
253
|
+
|
|
254
|
+
[data-is-toc] {
|
|
255
|
+
a {
|
|
256
|
+
text-decoration: none;
|
|
257
|
+
}
|
|
258
|
+
> ul {
|
|
259
|
+
columns: 2;
|
|
260
|
+
font-size: 90%;
|
|
261
|
+
}
|
|
262
|
+
}
|
package/assets/bricks.theme.css
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
a {
|
|
2
|
+
&:not([href^="#"]) {
|
|
3
|
+
text-decoration-thickness: 1px;
|
|
4
|
+
&:hover {
|
|
5
|
+
text-decoration-thickness: 2px;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
h1 {
|
|
2
11
|
font-size: 2.5em; /* for pico.css & tw-typography */
|
|
3
12
|
margin-bottom: 1rem; /* for tw-typography */
|
|
@@ -7,6 +16,12 @@ hr {
|
|
|
7
16
|
margin-block: 2em; /* for pico.css & tw-typography */
|
|
8
17
|
}
|
|
9
18
|
|
|
19
|
+
ul {
|
|
20
|
+
ul {
|
|
21
|
+
font-size: 90%;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
10
25
|
pre {
|
|
11
26
|
small {
|
|
12
27
|
opacity: 50%;
|
|
@@ -22,3 +37,28 @@ table {
|
|
|
22
37
|
margin-bottom: 0.25rem;
|
|
23
38
|
}
|
|
24
39
|
}
|
|
40
|
+
|
|
41
|
+
[data-jump-to="top"] {
|
|
42
|
+
> i {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
padding: 0.25rem;
|
|
45
|
+
margin: 0.5rem;
|
|
46
|
+
font-size: 0.75rem;
|
|
47
|
+
color: black;
|
|
48
|
+
border-color: black;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-is-toc] {
|
|
53
|
+
> ul > * > a {
|
|
54
|
+
font-weight: 500;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.breakout,
|
|
59
|
+
.breakout-all {
|
|
60
|
+
> img,
|
|
61
|
+
> figure {
|
|
62
|
+
margin-bottom: 1rem;
|
|
63
|
+
}
|
|
64
|
+
}
|
package/bricks.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "bricks"
|
|
5
|
-
spec.version = "0.27.0-alpha.
|
|
5
|
+
spec.version = "0.27.0-alpha.7"
|
|
6
6
|
spec.authors = ["Anton Staroverov"]
|
|
7
7
|
|
|
8
8
|
spec.summary = "Framework-agnostic CSS utilities and single-file Liquid 'bricks' for modern web development."
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anydigital/bricks",
|
|
3
|
-
"version": "0.27.0-alpha.
|
|
3
|
+
"version": "0.27.0-alpha.7",
|
|
4
4
|
"description": "Framework-agnostic CSS utilities and single-file Liquid 'bricks' for modern web development.",
|
|
5
5
|
"style": "./src/bricks.css",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./src/bricks.css",
|
|
8
8
|
"./theme": "./src/bricks.theme.css",
|
|
9
|
+
"./unreduce-motion": "./src/_unreduce-motion.css",
|
|
9
10
|
"./dist": "./dist/bricks.css"
|
|
10
11
|
},
|
|
11
12
|
"scripts": {
|
|
@@ -1,40 +1,4 @@
|
|
|
1
1
|
.prose {
|
|
2
|
-
/* Helper for multi-line subtitles */
|
|
3
|
-
sub {
|
|
4
|
-
vertical-align: top;
|
|
5
|
-
bottom: -0.05em;
|
|
6
|
-
line-height: 1.1;
|
|
7
|
-
font-weight: 300;
|
|
8
|
-
/* Workaround to prevent underline inside links */
|
|
9
|
-
display: inline-block;
|
|
10
|
-
width: 100%;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
a {
|
|
14
|
-
text-underline-offset: 0.1em;
|
|
15
|
-
text-decoration-thickness: 1px;
|
|
16
|
-
/* Don't underline links that point to anchors */
|
|
17
|
-
&[href^="#"] {
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
}
|
|
20
|
-
&:hover {
|
|
21
|
-
text-decoration-thickness: 2px;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
img {
|
|
26
|
-
&:not(:where(.prose > img, .prose > p > img)) {
|
|
27
|
-
margin-top: 0;
|
|
28
|
-
margin-bottom: 1em;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
h1 {
|
|
33
|
-
sub {
|
|
34
|
-
font-size: 50%;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
2
|
th,
|
|
39
3
|
td {
|
|
40
4
|
/* Keep extra space on the right for better horizontal scroll on mobile */
|
package/src/_tricks.css
CHANGED
|
@@ -30,6 +30,13 @@ h6 {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/* Helper to handle icons in links */
|
|
34
|
+
a > i {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
margin-inline-end: 0.375ch; /* =3/8 */
|
|
37
|
+
font-style: normal;
|
|
38
|
+
}
|
|
39
|
+
|
|
33
40
|
/* Favicons in links @TODO: add to tricks-wiki */
|
|
34
41
|
a[data-has-favicon] {
|
|
35
42
|
display: inline-block;
|
|
@@ -37,7 +44,7 @@ a[data-has-favicon] {
|
|
|
37
44
|
> img {
|
|
38
45
|
max-height: 1.25em;
|
|
39
46
|
margin-top: calc(-0.25em / 2);
|
|
40
|
-
margin-inline-end: 0.
|
|
47
|
+
margin-inline-end: 0.375ch; /* =3/8 */
|
|
41
48
|
|
|
42
49
|
/* for tw-typography (.prose) */
|
|
43
50
|
display: inline-block;
|
|
@@ -52,3 +59,27 @@ a[data-has-favicon] {
|
|
|
52
59
|
filter: invert(1) !important;
|
|
53
60
|
}
|
|
54
61
|
}
|
|
62
|
+
|
|
63
|
+
/* Jump to top trick */
|
|
64
|
+
[data-jump-to="top"] {
|
|
65
|
+
position: fixed;
|
|
66
|
+
bottom: 0;
|
|
67
|
+
right: 0;
|
|
68
|
+
padding-top: 50vh;
|
|
69
|
+
opacity: 25%;
|
|
70
|
+
|
|
71
|
+
&:hover {
|
|
72
|
+
opacity: 75%;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Table of contents */
|
|
77
|
+
[data-is-toc] {
|
|
78
|
+
a {
|
|
79
|
+
text-decoration: none;
|
|
80
|
+
}
|
|
81
|
+
> ul {
|
|
82
|
+
columns: 2;
|
|
83
|
+
font-size: 90%;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* @TODO: tricks-wiki */
|
|
2
|
+
@utility unreduce-animation-* {
|
|
3
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4
|
+
&:not([aria-busy="true"]) {
|
|
5
|
+
animation-duration: --value([ *]) !important;
|
|
6
|
+
animation-delay: 0 !important;
|
|
7
|
+
animation-iteration-count: infinite !important;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Overrides https://github.com/picocss/pico/blob/main/scss/utilities/_reduce-motion.scss */
|
package/src/breakout.css
CHANGED
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
table,
|
|
13
13
|
pre,
|
|
14
14
|
figure, video, iframe, canvas,
|
|
15
|
-
|
|
16
|
-
p > img, p > picture,
|
|
15
|
+
img, picture,
|
|
17
16
|
/* Custom utility classes for other tags that need to be broken out */
|
|
18
17
|
.breakout-item,
|
|
19
18
|
.breakout-item-max
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
/* Respect img/picture min-width */
|
|
29
|
-
&:is(
|
|
28
|
+
&:is(img, picture) {
|
|
30
29
|
min-width: auto;
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -86,6 +85,7 @@
|
|
|
86
85
|
background: linear-gradient(to left, gray, transparent);
|
|
87
86
|
}
|
|
88
87
|
|
|
88
|
+
/* @TODO: add to tricks-wiki why `*` works here, but `&` fails */
|
|
89
89
|
&:where(hr + *) {
|
|
90
90
|
&::before {
|
|
91
91
|
display: none !important;
|
package/src/bricks.css
CHANGED
package/src/bricks.theme.css
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
a {
|
|
2
|
+
&:not([href^="#"]) {
|
|
3
|
+
text-decoration-thickness: 1px;
|
|
4
|
+
&:hover {
|
|
5
|
+
text-decoration-thickness: 2px;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
h1 {
|
|
2
11
|
font-size: 2.5em; /* for pico.css & tw-typography */
|
|
3
12
|
margin-bottom: 1rem; /* for tw-typography */
|
|
@@ -7,6 +16,12 @@ hr {
|
|
|
7
16
|
margin-block: 2em; /* for pico.css & tw-typography */
|
|
8
17
|
}
|
|
9
18
|
|
|
19
|
+
ul {
|
|
20
|
+
ul {
|
|
21
|
+
font-size: 90%;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
10
25
|
pre {
|
|
11
26
|
small {
|
|
12
27
|
opacity: 50%;
|
|
@@ -22,3 +37,28 @@ table {
|
|
|
22
37
|
margin-bottom: 0.25rem;
|
|
23
38
|
}
|
|
24
39
|
}
|
|
40
|
+
|
|
41
|
+
[data-jump-to="top"] {
|
|
42
|
+
> i {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
padding: 0.25rem;
|
|
45
|
+
margin: 0.5rem;
|
|
46
|
+
font-size: 0.75rem;
|
|
47
|
+
color: black;
|
|
48
|
+
border-color: black;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-is-toc] {
|
|
53
|
+
> ul > * > a {
|
|
54
|
+
font-weight: 500;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.breakout,
|
|
59
|
+
.breakout-all {
|
|
60
|
+
> img,
|
|
61
|
+
> figure {
|
|
62
|
+
margin-bottom: 1rem;
|
|
63
|
+
}
|
|
64
|
+
}
|