@anydigital/bricks 1.0.0-alpha.12 → 1.0.0-alpha.14
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 +25 -15
- package/bricks/_prose.css +24 -1
- package/dist/bricks.css +22 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,26 +80,32 @@ The `.prose` class provides enhanced typography for article content and long-for
|
|
|
80
80
|
- Custom underline offset (`0.1em`) and thickness (`1px` default, `2px` on hover)
|
|
81
81
|
- Anchor links (starting with `#`) have no text decoration
|
|
82
82
|
- Special handling for `small`, `sup`, or `sub` elements: lighter weight (`300`) and displayed as `inline-block` to prevent underline decoration
|
|
83
|
+
- Icon helper: `i` elements inside links are displayed as `inline-block` with normal font style to prevent underline decoration, with `1em` height, `-10%` vertical alignment, and `0.25em` right margin. Nested `img` elements are styled with `100%` height and no margin
|
|
83
84
|
|
|
84
85
|
**Headings:**
|
|
85
86
|
|
|
86
87
|
- `h1` with `small`, `sup`, or `sub` elements get reduced font size (`0.5em`) and lighter weight (`300`)
|
|
87
|
-
- `h2` headings (without classes) get a full-width decorative bar above them (`0.4em` height, positioned `1em` above
|
|
88
|
-
- `h3` headings (without classes) get a decorative gradient bar to the left (`10em` width, `0.
|
|
89
|
-
- `h4` headings
|
|
88
|
+
- `h2` headings (without classes) get a full-width decorative bar above them (`0.4em` height, positioned `1em` above with `2em` top margin, centered using transform)
|
|
89
|
+
- `h3` and `h4` headings (without classes) get a decorative gradient bar to the left (`10em` width, positioned with `0.5em` right margin, vertically centered using transform, gradient from 10% to 5% to transparent opacity)
|
|
90
|
+
- `h4` headings have a thinner bar (`0.2em` height instead of `0.3em`)
|
|
90
91
|
|
|
91
92
|
**Tables:**
|
|
92
93
|
|
|
93
94
|
- Tables are displayed as blocks with horizontal scrolling
|
|
94
95
|
- On mobile (max-width: 767px), tables get `1.5em` horizontal padding
|
|
95
|
-
- Table cells have `1em` vertical padding (top and bottom)
|
|
96
|
-
- Workaround for widening columns using hidden `hr` elements (minimum width: `25ch
|
|
97
|
-
- Support for headings in Markdown tables using `big` elements (styled as bold
|
|
96
|
+
- Table cells (`th` and `td`) have `1em` vertical padding (top and bottom) and `top` vertical alignment
|
|
97
|
+
- Workaround for widening columns using hidden `hr` elements (minimum width: `25ch`, with zero margin and hidden visibility)
|
|
98
|
+
- Support for headings in Markdown tables using `big` elements (styled as bold)
|
|
99
|
+
- Images in table cells have no top margin and `0.75em` bottom margin
|
|
98
100
|
|
|
99
101
|
**Blockquotes:**
|
|
100
102
|
|
|
101
103
|
- Lighter font weight (`300`)
|
|
102
|
-
- Adjacent `figcaption` elements are styled with italic text, right alignment, lighter weight (`300`), negative top margin (`-1em`), and an em dash prefix
|
|
104
|
+
- Adjacent `figcaption` elements (using `+ figcaption` selector) are styled with italic text, right alignment, lighter weight (`300`), negative top margin (`-1em`), and an em dash prefix (`—`) with `0.25em` right margin
|
|
105
|
+
|
|
106
|
+
**Code Blocks:**
|
|
107
|
+
|
|
108
|
+
- Code blocks with `data-file` attribute display the filename above the code block (styled with 50% opacity, italic, and `1.5em` bottom margin)
|
|
103
109
|
|
|
104
110
|
**Usage:**
|
|
105
111
|
|
|
@@ -155,14 +161,14 @@ Base HTML templates that provide the essential document structure with built-in
|
|
|
155
161
|
|
|
156
162
|
- HTML5 DOCTYPE with language attribute (defaults to `en`, configurable via `site.lang`)
|
|
157
163
|
- UTF-8 charset and comprehensive viewport meta tag with `viewport-fit=cover` for notched devices
|
|
158
|
-
- Dynamic title generation with site title suffix
|
|
159
|
-
- Favicon link
|
|
164
|
+
- Dynamic title generation with site title suffix (title is stripped of HTML tags and separated with `|`)
|
|
165
|
+
- Favicon link (to `/favicon.ico`)
|
|
160
166
|
- Automatic stylesheet linking from `site.styles` array
|
|
161
|
-
- Inline styles from `site.inline_styles` array
|
|
167
|
+
- Inline styles from `site.inline_styles` array (joined with newlines in a `<style>` tag)
|
|
162
168
|
- Automatic script loading from `site.scripts` array (with `defer` attribute)
|
|
163
|
-
- Inline module scripts from `site.inline_scripts` array
|
|
169
|
+
- Inline module scripts from `site.inline_scripts` array (joined with newlines in a `<script type="module">` tag)
|
|
164
170
|
- Custom header content via `content_for_header`
|
|
165
|
-
- Google Tag Manager integration (
|
|
171
|
+
- Google Tag Manager integration (automatically rendered via `_gtm.liquid` template for both `<head>` and `<body>`)
|
|
166
172
|
|
|
167
173
|
**Usage:**
|
|
168
174
|
|
|
@@ -174,6 +180,8 @@ Base HTML templates that provide the essential document structure with built-in
|
|
|
174
180
|
{% render 'bricks/__html-end' %}
|
|
175
181
|
```
|
|
176
182
|
|
|
183
|
+
Note: Google Tag Manager is automatically included in both `<head>` and `<body>` (via the `_gtm.liquid` template) when `site.prod` and `site.gtm_id` are set.
|
|
184
|
+
|
|
177
185
|
**Variables:**
|
|
178
186
|
|
|
179
187
|
- `title` - Page title (optional, will be stripped of HTML tags)
|
|
@@ -231,7 +239,9 @@ A template for embedding Google Tag Manager scripts in your pages.
|
|
|
231
239
|
- `site.prod` - Boolean flag to enable GTM only in production
|
|
232
240
|
- `for_body` - Boolean flag (default: `false`). When `false`, renders the script tag for the `<head>`. When `true`, renders the noscript fallback for the `<body>`.
|
|
233
241
|
|
|
234
|
-
**
|
|
242
|
+
**Note:** This template is automatically included when using `__html-begin.liquid` and `__html-end.liquid`. You only need to manually render it if you're not using those base templates.
|
|
243
|
+
|
|
244
|
+
**Manual Usage:**
|
|
235
245
|
|
|
236
246
|
In your base template's `<head>`:
|
|
237
247
|
|
|
@@ -245,7 +255,7 @@ In your base template's `<body>` (right after the opening tag):
|
|
|
245
255
|
{% render 'bricks/_gtm', site: site, for_body: true %}
|
|
246
256
|
```
|
|
247
257
|
|
|
248
|
-
**Example:**
|
|
258
|
+
**Example (Manual Integration):**
|
|
249
259
|
|
|
250
260
|
```liquid
|
|
251
261
|
<!DOCTYPE html>
|
|
@@ -260,7 +270,7 @@ In your base template's `<body>` (right after the opening tag):
|
|
|
260
270
|
</html>
|
|
261
271
|
```
|
|
262
272
|
|
|
263
|
-
**
|
|
273
|
+
**Rendering Logic:** The GTM script is only rendered when both `site.prod` is `true` and `site.gtm_id` is set. The template uses a capture block to strip whitespace from the output.
|
|
264
274
|
|
|
265
275
|
## License
|
|
266
276
|
|
package/bricks/_prose.css
CHANGED
|
@@ -25,9 +25,17 @@
|
|
|
25
25
|
|
|
26
26
|
/* Helper to insert icons in links */
|
|
27
27
|
i {
|
|
28
|
+
height: 1em;
|
|
29
|
+
vertical-align: -10%;
|
|
30
|
+
margin-right: 0.25em;
|
|
28
31
|
font-style: normal;
|
|
29
32
|
/* Workaround to prevent underline */
|
|
30
33
|
display: inline-block;
|
|
34
|
+
|
|
35
|
+
img {
|
|
36
|
+
height: 100%;
|
|
37
|
+
margin: 0 !important;
|
|
38
|
+
}
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
|
|
@@ -92,6 +100,7 @@
|
|
|
92
100
|
td {
|
|
93
101
|
padding-top: 1em;
|
|
94
102
|
padding-bottom: 1em;
|
|
103
|
+
vertical-align: top;
|
|
95
104
|
/* Workaround to widen particular columns */
|
|
96
105
|
hr {
|
|
97
106
|
min-width: 25ch;
|
|
@@ -101,7 +110,11 @@
|
|
|
101
110
|
/* Workaround for headings in Markdown tables */
|
|
102
111
|
big {
|
|
103
112
|
font-weight: bold;
|
|
104
|
-
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
img {
|
|
116
|
+
margin-top: 0;
|
|
117
|
+
margin-bottom: 0.75em;
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
120
|
|
|
@@ -120,4 +133,14 @@
|
|
|
120
133
|
}
|
|
121
134
|
}
|
|
122
135
|
}
|
|
136
|
+
|
|
137
|
+
code[data-file] {
|
|
138
|
+
&::before {
|
|
139
|
+
content: attr(data-file);
|
|
140
|
+
display: block;
|
|
141
|
+
margin-bottom: 1.5em;
|
|
142
|
+
opacity: 0.5;
|
|
143
|
+
font-style: italic;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
123
146
|
}
|
package/dist/bricks.css
CHANGED
|
@@ -58,11 +58,19 @@ body > main {
|
|
|
58
58
|
/* Helper to insert icons in links */
|
|
59
59
|
|
|
60
60
|
.prose a i {
|
|
61
|
+
height: 1em;
|
|
62
|
+
vertical-align: -10%;
|
|
63
|
+
margin-right: 0.25em;
|
|
61
64
|
font-style: normal;
|
|
62
65
|
/* Workaround to prevent underline */
|
|
63
66
|
display: inline-block;
|
|
64
67
|
}
|
|
65
68
|
|
|
69
|
+
.prose a i img {
|
|
70
|
+
height: 100%;
|
|
71
|
+
margin: 0 !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
.prose h1 small,.prose h1 sup,.prose h1 sub {
|
|
67
75
|
font-size: 0.5em;
|
|
68
76
|
font-weight: 300;
|
|
@@ -144,6 +152,7 @@ body > main {
|
|
|
144
152
|
.prose th,.prose td {
|
|
145
153
|
padding-top: 1em;
|
|
146
154
|
padding-bottom: 1em;
|
|
155
|
+
vertical-align: top;
|
|
147
156
|
/* Workaround to widen particular columns */
|
|
148
157
|
}
|
|
149
158
|
|
|
@@ -157,7 +166,11 @@ body > main {
|
|
|
157
166
|
|
|
158
167
|
.prose th big,.prose td big {
|
|
159
168
|
font-weight: bold;
|
|
160
|
-
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.prose th img,.prose td img {
|
|
172
|
+
margin-top: 0;
|
|
173
|
+
margin-bottom: 0.75em;
|
|
161
174
|
}
|
|
162
175
|
|
|
163
176
|
.prose blockquote {
|
|
@@ -176,6 +189,14 @@ body > main {
|
|
|
176
189
|
margin-right: 0.25em;
|
|
177
190
|
}
|
|
178
191
|
|
|
192
|
+
.prose code[data-file]::before {
|
|
193
|
+
content: attr(data-file);
|
|
194
|
+
display: block;
|
|
195
|
+
margin-bottom: 1.5em;
|
|
196
|
+
opacity: 0.5;
|
|
197
|
+
font-style: italic;
|
|
198
|
+
}
|
|
199
|
+
|
|
179
200
|
/* Breakout CSS - Framework-agnostic utilities for breaking out images and figures */
|
|
180
201
|
|
|
181
202
|
.breakout {
|
package/package.json
CHANGED