@anydigital/bricks 1.0.0-alpha.12 → 1.0.0-alpha.13
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 +24 -15
- package/bricks/_prose.css +10 -1
- package/dist/bricks.css +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,26 +80,31 @@ 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
|
|
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)
|
|
97
|
+
- Workaround for widening columns using hidden `hr` elements (minimum width: `25ch`, with zero margin)
|
|
98
|
+
- Support for headings in Markdown tables using `big` elements (styled as bold)
|
|
98
99
|
|
|
99
100
|
**Blockquotes:**
|
|
100
101
|
|
|
101
102
|
- 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
|
|
103
|
+
- 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
|
|
104
|
+
|
|
105
|
+
**Code Blocks:**
|
|
106
|
+
|
|
107
|
+
- Code blocks with `data-file` attribute display the filename above the code block (styled with 50% opacity, italic, and `1.5em` bottom margin)
|
|
103
108
|
|
|
104
109
|
**Usage:**
|
|
105
110
|
|
|
@@ -155,14 +160,14 @@ Base HTML templates that provide the essential document structure with built-in
|
|
|
155
160
|
|
|
156
161
|
- HTML5 DOCTYPE with language attribute (defaults to `en`, configurable via `site.lang`)
|
|
157
162
|
- 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
|
|
163
|
+
- Dynamic title generation with site title suffix (title is stripped of HTML tags and separated with `|`)
|
|
164
|
+
- Favicon link (to `/favicon.ico`)
|
|
160
165
|
- Automatic stylesheet linking from `site.styles` array
|
|
161
|
-
- Inline styles from `site.inline_styles` array
|
|
166
|
+
- Inline styles from `site.inline_styles` array (joined with newlines in a `<style>` tag)
|
|
162
167
|
- Automatic script loading from `site.scripts` array (with `defer` attribute)
|
|
163
|
-
- Inline module scripts from `site.inline_scripts` array
|
|
168
|
+
- Inline module scripts from `site.inline_scripts` array (joined with newlines in a `<script type="module">` tag)
|
|
164
169
|
- Custom header content via `content_for_header`
|
|
165
|
-
- Google Tag Manager integration (
|
|
170
|
+
- Google Tag Manager integration (automatically rendered via `_gtm.liquid` template for both `<head>` and `<body>`)
|
|
166
171
|
|
|
167
172
|
**Usage:**
|
|
168
173
|
|
|
@@ -174,6 +179,8 @@ Base HTML templates that provide the essential document structure with built-in
|
|
|
174
179
|
{% render 'bricks/__html-end' %}
|
|
175
180
|
```
|
|
176
181
|
|
|
182
|
+
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.
|
|
183
|
+
|
|
177
184
|
**Variables:**
|
|
178
185
|
|
|
179
186
|
- `title` - Page title (optional, will be stripped of HTML tags)
|
|
@@ -231,7 +238,9 @@ A template for embedding Google Tag Manager scripts in your pages.
|
|
|
231
238
|
- `site.prod` - Boolean flag to enable GTM only in production
|
|
232
239
|
- `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
240
|
|
|
234
|
-
**
|
|
241
|
+
**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.
|
|
242
|
+
|
|
243
|
+
**Manual Usage:**
|
|
235
244
|
|
|
236
245
|
In your base template's `<head>`:
|
|
237
246
|
|
|
@@ -245,7 +254,7 @@ In your base template's `<body>` (right after the opening tag):
|
|
|
245
254
|
{% render 'bricks/_gtm', site: site, for_body: true %}
|
|
246
255
|
```
|
|
247
256
|
|
|
248
|
-
**Example:**
|
|
257
|
+
**Example (Manual Integration):**
|
|
249
258
|
|
|
250
259
|
```liquid
|
|
251
260
|
<!DOCTYPE html>
|
|
@@ -260,7 +269,7 @@ In your base template's `<body>` (right after the opening tag):
|
|
|
260
269
|
</html>
|
|
261
270
|
```
|
|
262
271
|
|
|
263
|
-
**
|
|
272
|
+
**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
273
|
|
|
265
274
|
## License
|
|
266
275
|
|
package/bricks/_prose.css
CHANGED
|
@@ -101,7 +101,6 @@
|
|
|
101
101
|
/* Workaround for headings in Markdown tables */
|
|
102
102
|
big {
|
|
103
103
|
font-weight: bold;
|
|
104
|
-
font-style: italic;
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
106
|
|
|
@@ -120,4 +119,14 @@
|
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
}
|
|
122
|
+
|
|
123
|
+
code[data-file] {
|
|
124
|
+
&::before {
|
|
125
|
+
content: attr(data-file);
|
|
126
|
+
display: block;
|
|
127
|
+
margin-bottom: 1.5em;
|
|
128
|
+
opacity: 0.5;
|
|
129
|
+
font-style: italic;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
123
132
|
}
|
package/dist/bricks.css
CHANGED
|
@@ -157,7 +157,6 @@ body > main {
|
|
|
157
157
|
|
|
158
158
|
.prose th big,.prose td big {
|
|
159
159
|
font-weight: bold;
|
|
160
|
-
font-style: italic;
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
.prose blockquote {
|
|
@@ -176,6 +175,14 @@ body > main {
|
|
|
176
175
|
margin-right: 0.25em;
|
|
177
176
|
}
|
|
178
177
|
|
|
178
|
+
.prose code[data-file]::before {
|
|
179
|
+
content: attr(data-file);
|
|
180
|
+
display: block;
|
|
181
|
+
margin-bottom: 1.5em;
|
|
182
|
+
opacity: 0.5;
|
|
183
|
+
font-style: italic;
|
|
184
|
+
}
|
|
185
|
+
|
|
179
186
|
/* Breakout CSS - Framework-agnostic utilities for breaking out images and figures */
|
|
180
187
|
|
|
181
188
|
.breakout {
|
package/package.json
CHANGED