@anydigital/bricks 1.0.0-alpha.10 → 1.0.0-alpha.12
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/.prettierrc.json +3 -0
- package/README.md +60 -51
- package/bricks/__html-begin.liquid +40 -0
- package/bricks/__html-end.liquid +2 -0
- package/bricks/__html.css +2 -1
- package/bricks/{_gtm.njk → _gtm.liquid} +12 -7
- package/bricks/_nav.liquid +9 -0
- package/bricks/_prose.css +27 -15
- package/dist/bricks.css +31 -22
- package/package.json +3 -9
- package/postcss.config.js +8 -0
- package/bricks/__html.njk +0 -17
- package/bricks/_nav.njk +0 -10
package/.prettierrc.json
ADDED
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# *Any*bricks
|
|
2
2
|
|
|
3
|
-
Framework-agnostic CSS utilities and single-file
|
|
3
|
+
Framework-agnostic CSS utilities and single-file Liquid 'bricks' for modern web development.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
### Via CDN
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@anydigital/bricks@1/dist/bricks.css"
|
|
10
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@anydigital/bricks@1/dist/bricks.css" />
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
### Via npm
|
|
@@ -19,7 +19,7 @@ npm install @anydigital/bricks
|
|
|
19
19
|
Then import in your CSS:
|
|
20
20
|
|
|
21
21
|
```css
|
|
22
|
-
@import
|
|
22
|
+
@import "@anydigital/bricks";
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Features
|
|
@@ -29,7 +29,8 @@ Then import in your CSS:
|
|
|
29
29
|
Prevents horizontal overflow and scrolling on the entire page:
|
|
30
30
|
|
|
31
31
|
```css
|
|
32
|
-
html,
|
|
32
|
+
html,
|
|
33
|
+
body {
|
|
33
34
|
overflow-x: clip;
|
|
34
35
|
}
|
|
35
36
|
```
|
|
@@ -70,21 +71,25 @@ This is automatically applied when you include the stylesheet.
|
|
|
70
71
|
The `.prose` class provides enhanced typography for article content and long-form text with container-like behavior:
|
|
71
72
|
|
|
72
73
|
**Container:**
|
|
74
|
+
|
|
73
75
|
- Full width with `1rem` padding
|
|
74
76
|
- Centered with automatic inline margins
|
|
75
77
|
|
|
76
78
|
**Links:**
|
|
79
|
+
|
|
77
80
|
- Custom underline offset (`0.1em`) and thickness (`1px` default, `2px` on hover)
|
|
78
81
|
- Anchor links (starting with `#`) have no text decoration
|
|
79
82
|
- Special handling for `small`, `sup`, or `sub` elements: lighter weight (`300`) and displayed as `inline-block` to prevent underline decoration
|
|
80
83
|
|
|
81
84
|
**Headings:**
|
|
85
|
+
|
|
82
86
|
- `h1` with `small`, `sup`, or `sub` elements get reduced font size (`0.5em`) and lighter weight (`300`)
|
|
83
87
|
- `h2` headings (without classes) get a full-width decorative bar above them (`0.4em` height, positioned `1em` above, with `2em` top margin)
|
|
84
88
|
- `h3` headings (without classes) get a decorative gradient bar to the left (`10em` width, `0.3em` height, fading from 10% to 5% to transparent opacity)
|
|
85
89
|
- `h4` headings (without classes) get a similar decorative gradient bar but thinner (`0.2em` height)
|
|
86
90
|
|
|
87
91
|
**Tables:**
|
|
92
|
+
|
|
88
93
|
- Tables are displayed as blocks with horizontal scrolling
|
|
89
94
|
- On mobile (max-width: 767px), tables get `1.5em` horizontal padding
|
|
90
95
|
- Table cells have `1em` vertical padding (top and bottom)
|
|
@@ -92,6 +97,7 @@ The `.prose` class provides enhanced typography for article content and long-for
|
|
|
92
97
|
- Support for headings in Markdown tables using `big` elements (styled as bold italic)
|
|
93
98
|
|
|
94
99
|
**Blockquotes:**
|
|
100
|
+
|
|
95
101
|
- Lighter font weight (`300`)
|
|
96
102
|
- Adjacent `figcaption` elements are styled with italic text, right alignment, lighter weight (`300`), negative top margin (`-1em`), and an em dash prefix
|
|
97
103
|
|
|
@@ -131,7 +137,7 @@ Includes [breakout-css](https://github.com/anydigital/breakout-css) utilities fo
|
|
|
131
137
|
|
|
132
138
|
```html
|
|
133
139
|
<div class="breakout">
|
|
134
|
-
<img src="image.jpg" alt="Description"
|
|
140
|
+
<img src="image.jpg" alt="Description" />
|
|
135
141
|
</div>
|
|
136
142
|
```
|
|
137
143
|
|
|
@@ -139,66 +145,68 @@ The breakout utilities support images, pictures, figures, canvas, audio, video,
|
|
|
139
145
|
|
|
140
146
|
## Bricks (Template Components)
|
|
141
147
|
|
|
142
|
-
The package includes reusable
|
|
148
|
+
The package includes reusable Liquid templates in the `bricks/` directory. These are useful for common web development patterns.
|
|
143
149
|
|
|
144
|
-
### Base HTML Template (`__html.
|
|
150
|
+
### Base HTML Template (`__html-begin.liquid` and `__html-end.liquid`)
|
|
145
151
|
|
|
146
|
-
|
|
152
|
+
Base HTML templates that provide the essential document structure with built-in support for modern web best practices. Split into begin and end files to wrap around your content.
|
|
147
153
|
|
|
148
154
|
**Features:**
|
|
149
|
-
|
|
155
|
+
|
|
156
|
+
- HTML5 DOCTYPE with language attribute (defaults to `en`, configurable via `site.lang`)
|
|
150
157
|
- UTF-8 charset and comprehensive viewport meta tag with `viewport-fit=cover` for notched devices
|
|
151
158
|
- Dynamic title generation with site title suffix
|
|
152
159
|
- Favicon link
|
|
160
|
+
- Automatic stylesheet linking from `site.styles` array
|
|
161
|
+
- Inline styles from `site.inline_styles` array
|
|
162
|
+
- Automatic script loading from `site.scripts` array (with `defer` attribute)
|
|
163
|
+
- Inline module scripts from `site.inline_scripts` array
|
|
164
|
+
- Custom header content via `content_for_header`
|
|
153
165
|
- Google Tag Manager integration (conditional on production environment)
|
|
154
|
-
- Head and body content blocks for template extension
|
|
155
166
|
|
|
156
167
|
**Usage:**
|
|
157
168
|
|
|
158
|
-
```
|
|
159
|
-
{%
|
|
169
|
+
```liquid
|
|
170
|
+
{% render 'bricks/__html-begin', site: site, title: title, content_for_header: content_for_header %}
|
|
160
171
|
|
|
161
|
-
|
|
162
|
-
<!-- Additional head elements (optional) -->
|
|
163
|
-
{% endblock %}
|
|
172
|
+
<!-- Your page content -->
|
|
164
173
|
|
|
165
|
-
{%
|
|
166
|
-
<!-- Your page content -->
|
|
167
|
-
{% endblock %}
|
|
174
|
+
{% render 'bricks/__html-end' %}
|
|
168
175
|
```
|
|
169
176
|
|
|
170
|
-
**
|
|
177
|
+
**Variables:**
|
|
178
|
+
|
|
171
179
|
- `title` - Page title (optional, will be stripped of HTML tags)
|
|
172
180
|
- `site.title` - Site title for the title suffix
|
|
173
|
-
- `site.
|
|
174
|
-
- `site.
|
|
175
|
-
- `
|
|
181
|
+
- `site.lang` - Language code (optional, defaults to `'en'`)
|
|
182
|
+
- `site.styles` - Array of stylesheet URLs (optional)
|
|
183
|
+
- `site.inline_styles` - Array of inline CSS strings (optional)
|
|
184
|
+
- `site.scripts` - Array of script URLs (optional)
|
|
185
|
+
- `site.inline_scripts` - Array of inline JavaScript strings (optional)
|
|
186
|
+
- `content_for_header` - Custom HTML for the head section (optional)
|
|
187
|
+
- `site.gtm_id` - Google Tag Manager ID (optional)
|
|
188
|
+
- `site.prod` - Boolean flag for production environment (optional)
|
|
176
189
|
|
|
177
|
-
### Navigation (`_nav.
|
|
190
|
+
### Navigation (`_nav.liquid`)
|
|
178
191
|
|
|
179
|
-
A navigation
|
|
192
|
+
A navigation template that renders a list of navigation links with proper accessibility attributes.
|
|
180
193
|
|
|
181
194
|
**Parameters:**
|
|
182
|
-
|
|
183
|
-
- `
|
|
195
|
+
|
|
196
|
+
- `nav_pages` - Array of navigation page objects with `url` and `title` properties
|
|
197
|
+
- `current_url` - The URL of the current page (used to set `aria-current="page"`)
|
|
184
198
|
|
|
185
199
|
**Usage:**
|
|
186
200
|
|
|
187
|
-
```
|
|
188
|
-
{%
|
|
189
|
-
{{ render(navPages, page.url) }}
|
|
201
|
+
```liquid
|
|
202
|
+
{% render 'bricks/_nav', nav_pages: navPages, current_url: page.url %}
|
|
190
203
|
```
|
|
191
204
|
|
|
192
205
|
**Example:**
|
|
193
206
|
|
|
194
|
-
```
|
|
195
|
-
{%
|
|
196
|
-
|
|
197
|
-
{ url: '/about', title: 'About' },
|
|
198
|
-
{ url: '/contact', title: 'Contact' }
|
|
199
|
-
] %}
|
|
200
|
-
{% from "bricks/_nav.njk" import render %}
|
|
201
|
-
{{ render(navPages, '/about') }}
|
|
207
|
+
```liquid
|
|
208
|
+
{% assign navPages = site.pages | where: "nav", true %}
|
|
209
|
+
{% render 'bricks/_nav', nav_pages: navPages, current_url: page.url %}
|
|
202
210
|
```
|
|
203
211
|
|
|
204
212
|
**Output:**
|
|
@@ -213,46 +221,47 @@ A navigation macro that renders a list of navigation links with proper accessibi
|
|
|
213
221
|
|
|
214
222
|
**Compatibility:** Compatible with [Eleventy Navigation plugin](https://www.11ty.dev/docs/plugins/navigation/#bring-your-own-html-render-the-menu-items-manually).
|
|
215
223
|
|
|
216
|
-
### Google Tag Manager (`_gtm.
|
|
224
|
+
### Google Tag Manager (`_gtm.liquid`)
|
|
217
225
|
|
|
218
|
-
A
|
|
226
|
+
A template for embedding Google Tag Manager scripts in your pages.
|
|
219
227
|
|
|
220
228
|
**Parameters:**
|
|
221
|
-
|
|
222
|
-
- `
|
|
229
|
+
|
|
230
|
+
- `site.gtm_id` - Your Google Tag Manager container ID (e.g., `GTM-XXXXXXX`)
|
|
231
|
+
- `site.prod` - Boolean flag to enable GTM only in production
|
|
232
|
+
- `for_body` - Boolean flag (default: `false`). When `false`, renders the script tag for the `<head>`. When `true`, renders the noscript fallback for the `<body>`.
|
|
223
233
|
|
|
224
234
|
**Usage:**
|
|
225
235
|
|
|
226
236
|
In your base template's `<head>`:
|
|
227
237
|
|
|
228
|
-
```
|
|
229
|
-
{%
|
|
230
|
-
{{ gtm.render(site.gtmId) }}
|
|
238
|
+
```liquid
|
|
239
|
+
{% render 'bricks/_gtm', site: site %}
|
|
231
240
|
```
|
|
232
241
|
|
|
233
242
|
In your base template's `<body>` (right after the opening tag):
|
|
234
243
|
|
|
235
|
-
```
|
|
236
|
-
{
|
|
244
|
+
```liquid
|
|
245
|
+
{% render 'bricks/_gtm', site: site, for_body: true %}
|
|
237
246
|
```
|
|
238
247
|
|
|
239
248
|
**Example:**
|
|
240
249
|
|
|
241
|
-
```
|
|
250
|
+
```liquid
|
|
242
251
|
<!DOCTYPE html>
|
|
243
252
|
<html>
|
|
244
253
|
<head>
|
|
245
|
-
{%
|
|
246
|
-
{{ gtm.render('GTM-XXXXXXX') }}
|
|
254
|
+
{% render 'bricks/_gtm', site: site %}
|
|
247
255
|
</head>
|
|
248
256
|
<body>
|
|
249
|
-
{
|
|
257
|
+
{% render 'bricks/_gtm', site: site, for_body: true %}
|
|
250
258
|
<!-- Your content -->
|
|
251
259
|
</body>
|
|
252
260
|
</html>
|
|
253
261
|
```
|
|
254
262
|
|
|
263
|
+
**Note:** The GTM script is only rendered when both `site.prod` is `true` and `site.gtm_id` is set.
|
|
264
|
+
|
|
255
265
|
## License
|
|
256
266
|
|
|
257
267
|
MIT
|
|
258
|
-
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
{% # if-true trick not to break auto-formatting %}
|
|
3
|
+
{% if true %}<html lang="{{ site.lang | default: 'en' }}">{% endif %}
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover">
|
|
8
|
+
<title>
|
|
9
|
+
{{- title | strip_html | append: ' | ' | if: title -}}
|
|
10
|
+
{{- site.title -}}
|
|
11
|
+
</title>
|
|
12
|
+
<link rel="icon" href="/favicon.ico">
|
|
13
|
+
|
|
14
|
+
{% # styles %}
|
|
15
|
+
{%- for href in site.styles %}
|
|
16
|
+
<link rel="stylesheet" href="{{ href }}">
|
|
17
|
+
{%- endfor %}
|
|
18
|
+
<style>
|
|
19
|
+
{{ site.inline_styles | join: '\n' }}
|
|
20
|
+
</style>
|
|
21
|
+
|
|
22
|
+
{% # scripts %}
|
|
23
|
+
{%- for src in site.scripts %}
|
|
24
|
+
<script src="{{ src }}" defer></script>
|
|
25
|
+
{%- endfor %}
|
|
26
|
+
<script type="module">
|
|
27
|
+
{{ site.inline_scripts | join: '\n' }}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{% # custom %}
|
|
31
|
+
{{ content_for_header }}
|
|
32
|
+
|
|
33
|
+
{% render './_gtm', site: site %}
|
|
34
|
+
</head>
|
|
35
|
+
|
|
36
|
+
{% # if-true trick not to break auto-formatting %}
|
|
37
|
+
{% if true %}
|
|
38
|
+
<body>
|
|
39
|
+
{% render './_gtm', site: site, for_body: true %}
|
|
40
|
+
{% endif %}
|
package/bricks/__html.css
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
{%
|
|
1
|
+
{% if site.prod and site.gtm_id %}
|
|
2
|
+
{% capture _ %}
|
|
3
|
+
{% unless for_body %}
|
|
2
4
|
|
|
3
|
-
{% if not bodyFallback %}
|
|
4
5
|
<!-- Google Tag Manager -->
|
|
5
6
|
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
6
7
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
7
8
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
8
9
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
9
|
-
})(window,document,'script','dataLayer','{{
|
|
10
|
+
})(window,document,'script','dataLayer','{{ site.gtm_id }}');</script>
|
|
10
11
|
<!-- End Google Tag Manager -->
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
{% else %}
|
|
14
|
+
|
|
12
15
|
<!-- Google Tag Manager (noscript) -->
|
|
13
|
-
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{
|
|
16
|
+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ site.gtm_id }}"
|
|
14
17
|
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
|
15
18
|
<!-- End Google Tag Manager (noscript) -->
|
|
16
|
-
{% endif %}
|
|
17
19
|
|
|
18
|
-
{%
|
|
20
|
+
{% endunless %}
|
|
21
|
+
{% endcapture %}
|
|
22
|
+
{{ _ | strip }}
|
|
23
|
+
{% endif %}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<nav>
|
|
2
|
+
{%- for entry in nav_pages %}
|
|
3
|
+
{% # prettier-ignore %}
|
|
4
|
+
<a href="{{ entry.url }}" {% if entry.url == current_url %}aria-current="page"{% endif %}>
|
|
5
|
+
{{- entry.title -}}
|
|
6
|
+
</a>
|
|
7
|
+
{%- endfor %}
|
|
8
|
+
</nav>
|
|
9
|
+
{% # Compatible with https://www.11ty.dev/docs/plugins/navigation/#bring-your-own-html-render-the-menu-items-manually %}
|
package/bricks/_prose.css
CHANGED
|
@@ -15,15 +15,26 @@
|
|
|
15
15
|
text-decoration-thickness: 2px;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
small,
|
|
18
|
+
small,
|
|
19
|
+
sup,
|
|
20
|
+
sub {
|
|
19
21
|
font-weight: 300;
|
|
20
22
|
/* Workaround to prevent underline */
|
|
21
23
|
display: inline-block;
|
|
22
24
|
}
|
|
25
|
+
|
|
26
|
+
/* Helper to insert icons in links */
|
|
27
|
+
i {
|
|
28
|
+
font-style: normal;
|
|
29
|
+
/* Workaround to prevent underline */
|
|
30
|
+
display: inline-block;
|
|
31
|
+
}
|
|
23
32
|
}
|
|
24
33
|
|
|
25
34
|
h1 {
|
|
26
|
-
small,
|
|
35
|
+
small,
|
|
36
|
+
sup,
|
|
37
|
+
sub {
|
|
27
38
|
font-size: 0.5em;
|
|
28
39
|
font-weight: 300;
|
|
29
40
|
}
|
|
@@ -35,10 +46,10 @@
|
|
|
35
46
|
position: relative;
|
|
36
47
|
|
|
37
48
|
&::before {
|
|
38
|
-
content:
|
|
49
|
+
content: "";
|
|
39
50
|
display: block;
|
|
40
51
|
position: absolute;
|
|
41
|
-
background-color: rgba(0,0,0,5%);
|
|
52
|
+
background-color: rgba(0, 0, 0, 5%);
|
|
42
53
|
}
|
|
43
54
|
}
|
|
44
55
|
h2:not([class]) {
|
|
@@ -46,22 +57,22 @@
|
|
|
46
57
|
|
|
47
58
|
&::before {
|
|
48
59
|
width: 100vw;
|
|
49
|
-
|
|
60
|
+
left: 50%;
|
|
50
61
|
height: 0.4em;
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
top: -1em;
|
|
63
|
+
transform: translateX(-50%);
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
66
|
h3:not([class]),
|
|
56
67
|
h4:not([class]) {
|
|
57
68
|
&::before {
|
|
58
69
|
width: 10em;
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
right: 100%;
|
|
71
|
+
margin-right: 0.5em;
|
|
61
72
|
height: 0.3em;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
background: linear-gradient(to left, rgba(0,0,0,10%), rgba(0,0,0,5%) 10%, transparent);
|
|
73
|
+
top: 50%;
|
|
74
|
+
transform: translateY(-50%);
|
|
75
|
+
background: linear-gradient(to left, rgba(0, 0, 0, 10%), rgba(0, 0, 0, 5%) 10%, transparent);
|
|
65
76
|
}
|
|
66
77
|
}
|
|
67
78
|
h4:not([class]) {
|
|
@@ -77,7 +88,8 @@
|
|
|
77
88
|
padding-inline: 1.5em;
|
|
78
89
|
}
|
|
79
90
|
}
|
|
80
|
-
th,
|
|
91
|
+
th,
|
|
92
|
+
td {
|
|
81
93
|
padding-top: 1em;
|
|
82
94
|
padding-bottom: 1em;
|
|
83
95
|
/* Workaround to widen particular columns */
|
|
@@ -103,9 +115,9 @@
|
|
|
103
115
|
font-weight: 300;
|
|
104
116
|
|
|
105
117
|
&::before {
|
|
106
|
-
content:
|
|
118
|
+
content: "—";
|
|
107
119
|
margin-right: 0.25em;
|
|
108
120
|
}
|
|
109
121
|
}
|
|
110
|
-
}
|
|
122
|
+
}
|
|
111
123
|
}
|
package/dist/bricks.css
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
/* Prevent horizontal overflow and scrolling, modern way */
|
|
7
7
|
|
|
8
|
-
html,
|
|
8
|
+
html,
|
|
9
|
+
body {
|
|
9
10
|
overflow-x: clip;
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -31,7 +32,7 @@ body > main {
|
|
|
31
32
|
/* Container-like behavior with padding and auto margins */
|
|
32
33
|
width: 100%;
|
|
33
34
|
padding: 1rem;
|
|
34
|
-
margin-inline: auto;
|
|
35
|
+
margin-inline: auto;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
.prose a {
|
|
@@ -54,6 +55,14 @@ body > main {
|
|
|
54
55
|
display: inline-block;
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
/* Helper to insert icons in links */
|
|
59
|
+
|
|
60
|
+
.prose a i {
|
|
61
|
+
font-style: normal;
|
|
62
|
+
/* Workaround to prevent underline */
|
|
63
|
+
display: inline-block;
|
|
64
|
+
}
|
|
65
|
+
|
|
57
66
|
.prose h1 small,.prose h1 sup,.prose h1 sub {
|
|
58
67
|
font-size: 0.5em;
|
|
59
68
|
font-weight: 300;
|
|
@@ -64,24 +73,24 @@ body > main {
|
|
|
64
73
|
}
|
|
65
74
|
|
|
66
75
|
.prose h2:not([class])::before {
|
|
67
|
-
content:
|
|
76
|
+
content: "";
|
|
68
77
|
display: block;
|
|
69
78
|
position: absolute;
|
|
70
|
-
background-color: rgba(0,0,0,5%);
|
|
79
|
+
background-color: rgba(0, 0, 0, 5%);
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
.prose h3:not([class])::before {
|
|
74
|
-
content:
|
|
83
|
+
content: "";
|
|
75
84
|
display: block;
|
|
76
85
|
position: absolute;
|
|
77
|
-
background-color: rgba(0,0,0,5%);
|
|
86
|
+
background-color: rgba(0, 0, 0, 5%);
|
|
78
87
|
}
|
|
79
88
|
|
|
80
89
|
.prose h4:not([class])::before {
|
|
81
|
-
content:
|
|
90
|
+
content: "";
|
|
82
91
|
display: block;
|
|
83
92
|
position: absolute;
|
|
84
|
-
background-color: rgba(0,0,0,5%);
|
|
93
|
+
background-color: rgba(0, 0, 0, 5%);
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
.prose h2:not([class]) {
|
|
@@ -90,30 +99,30 @@ body > main {
|
|
|
90
99
|
|
|
91
100
|
.prose h2:not([class])::before {
|
|
92
101
|
width: 100vw;
|
|
93
|
-
|
|
102
|
+
left: 50%;
|
|
94
103
|
height: 0.4em;
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
top: -1em;
|
|
105
|
+
transform: translateX(-50%);
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
.prose h3:not([class])::before {
|
|
100
109
|
width: 10em;
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
right: 100%;
|
|
111
|
+
margin-right: 0.5em;
|
|
103
112
|
height: 0.3em;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
background: linear-gradient(to left, rgba(0,0,0,10%), rgba(0,0,0,5%) 10%, transparent);
|
|
113
|
+
top: 50%;
|
|
114
|
+
transform: translateY(-50%);
|
|
115
|
+
background: linear-gradient(to left, rgba(0, 0, 0, 10%), rgba(0, 0, 0, 5%) 10%, transparent);
|
|
107
116
|
}
|
|
108
117
|
|
|
109
118
|
.prose h4:not([class])::before {
|
|
110
119
|
width: 10em;
|
|
111
|
-
|
|
112
|
-
|
|
120
|
+
right: 100%;
|
|
121
|
+
margin-right: 0.5em;
|
|
113
122
|
height: 0.3em;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
background: linear-gradient(to left, rgba(0,0,0,10%), rgba(0,0,0,5%) 10%, transparent);
|
|
123
|
+
top: 50%;
|
|
124
|
+
transform: translateY(-50%);
|
|
125
|
+
background: linear-gradient(to left, rgba(0, 0, 0, 10%), rgba(0, 0, 0, 5%) 10%, transparent);
|
|
117
126
|
}
|
|
118
127
|
|
|
119
128
|
.prose h4:not([class])::before {
|
|
@@ -163,7 +172,7 @@ body > main {
|
|
|
163
172
|
}
|
|
164
173
|
|
|
165
174
|
.prose blockquote + figcaption::before {
|
|
166
|
-
content:
|
|
175
|
+
content: "—";
|
|
167
176
|
margin-right: 0.25em;
|
|
168
177
|
}
|
|
169
178
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anydigital/bricks",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
4
|
-
"description": "Framework-agnostic CSS utilities and single-file
|
|
3
|
+
"version": "1.0.0-alpha.12",
|
|
4
|
+
"description": "Framework-agnostic CSS utilities and single-file Liquid 'bricks' for modern web development.",
|
|
5
5
|
"main": "dist/bricks.css",
|
|
6
6
|
"style": "dist/bricks.css",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"bricks"
|
|
10
|
-
],
|
|
11
7
|
"scripts": {
|
|
12
8
|
"postcss": "postcss bricks/bricks.css -o dist/bricks.css",
|
|
13
9
|
"build": "npm run postcss -- --no-map",
|
|
@@ -33,7 +29,5 @@
|
|
|
33
29
|
"postcss-cli": "^11.0.0",
|
|
34
30
|
"postcss-import": "^16.1.1",
|
|
35
31
|
"postcss-preset-env": "^10.6.0"
|
|
36
|
-
}
|
|
37
|
-
"jsdelivr": "dist/bricks.css",
|
|
38
|
-
"unpkg": "dist/bricks.css"
|
|
32
|
+
}
|
|
39
33
|
}
|
package/bricks/__html.njk
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{%- set fromBricks = fromBricks | default('bricks/') -%}
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover">
|
|
7
|
-
<title>{{ title | striptags ~ ' | ' if title }}{{ site.title }}</title>
|
|
8
|
-
<link rel="icon" href="/favicon.ico">
|
|
9
|
-
{% block head %}{% endblock %}
|
|
10
|
-
{% import fromBricks ~ '_gtm.njk' as gtm %}
|
|
11
|
-
{{ gtm.render(site.gtmId) if site.gtmId and site.isProd }}
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
{{ gtm.render(site.gtmId, bodyFallback=true) if site.gtmId and site.isProd }}
|
|
15
|
-
{% block body %}{% endblock %}
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|
package/bricks/_nav.njk
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{% macro render(navPages, curPageUrl) %}
|
|
2
|
-
<nav>
|
|
3
|
-
{%- for entry in navPages %}
|
|
4
|
-
<a href="{{ entry.url }}" {{ 'aria-current="page"' | safe if entry.url == curPageUrl }}>
|
|
5
|
-
{{- entry.title -}}
|
|
6
|
-
</a>
|
|
7
|
-
{%- endfor %}
|
|
8
|
-
</nav>
|
|
9
|
-
{% endmacro %}
|
|
10
|
-
{# Compatible with https://www.11ty.dev/docs/plugins/navigation/#bring-your-own-html-render-the-menu-items-manually #}
|