@anydigital/bricks 0.24.2 → 0.25.0

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 CHANGED
@@ -22,7 +22,9 @@ Then import in your CSS:
22
22
  @import "@anydigital/bricks";
23
23
  ```
24
24
 
25
- ## Features
25
+ <!--section:css-h2-->
26
+
27
+ ## CSS 'Bricks'
26
28
 
27
29
  ### Overflow Control
28
30
 
@@ -188,13 +190,45 @@ Includes [breakout-css](https://github.com/anydigital/breakout-css) utilities fo
188
190
 
189
191
  The breakout container has `10%` inline padding and a max-width of `calc(10% + 65ch + 10%)`. The breakout utilities support images, pictures, figures, canvas, audio, video, tables, pre, iframe, and other media elements. Tables inside `.breakout` are specifically enhanced for horizontal scrolling and full-bleed mobile display. This is automatically included when you import the stylesheet.
190
192
 
191
- ## Bricks (Template Components)
193
+ <!--section:njk-liquid-h2-->
194
+
195
+ ## Universal Template 'Bricks' <small>(`.njk` & `.liquid`)</small> <sub>from https://github.com/anydigital/bricks</sub>
196
+
197
+ The package includes reusable templates in the `bricks/` directory. These are useful for common web development patterns.
198
+
199
+ ### Installation
200
+
201
+ ```sh
202
+ npm install @anydigital/bricks
203
+ cd ./src/_includes
204
+ ln -s ../../node_modules/@anydigital/bricks/src/bricks
205
+ ```
192
206
 
193
- The package includes reusable Liquid templates in the `bricks/` directory. These are useful for common web development patterns.
207
+ ### Base HTML Template <small>(`__html.*`)</small>
194
208
 
195
- ### Base HTML Template (`__html.liquid`)
209
+ A unified base HTML template `bricks/__html.{njk|liquid}` that provides the essential document structure with built-in support for modern web best practices.
210
+
211
+ **Usage:**
196
212
 
197
- A unified base HTML template that provides the essential document structure with built-in support for modern web best practices.
213
+ ```jinja2 {data-caption="in .njk layout:"}
214
+ {% extends 'bricks/__html.njk' %}
215
+
216
+ {% block body %}
217
+ <!-- YOUR page content -->
218
+ {% endblock %}
219
+ ```
220
+
221
+ Example: https://github.com/anydigital/sveleven/blob/main/src/_theme/__layout.njk
222
+
223
+ ```liquid {data-caption="in .liquid layout:"}
224
+ {% capture body %}
225
+ <!-- YOUR page content -->
226
+ {% endcapture %}
227
+
228
+ {% include 'bricks/__html' %}
229
+ ```
230
+
231
+ Example: https://github.com/anydigital/sveleven/blob/main/src/_theme/__layout.liquid
198
232
 
199
233
  **Features:**
200
234
 
@@ -207,19 +241,7 @@ A unified base HTML template that provides the essential document structure with
207
241
  - Automatic script loading from `site.scripts` array (with `defer` attribute)
208
242
  - Inline module scripts from `site.inline_scripts` array (joined with newlines in a `<script type="module">` tag)
209
243
  - Custom header content via `content_for_header`
210
- - Google Tag Manager integration (automatically rendered via `_gtm.liquid` template for both `<head>` and `<body>`)
211
-
212
- **Usage:**
213
-
214
- ```liquid
215
- {% capture page_content %}
216
- <!-- Your page content -->
217
- {% endcapture %}
218
-
219
- {% render 'bricks/__html', site: site, title: title, content_for_header: content_for_header, body: page_content %}
220
- ```
221
-
222
- 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.
244
+ - Google Tag Manager integration (automatically rendered via `_gtm.{njk|liquid}` template for both `<head>` and `<body>` when `site.prod` and `site.gtm_id` are set)
223
245
 
224
246
  **Variables:**
225
247
 
@@ -235,26 +257,20 @@ Note: Google Tag Manager is automatically included in both `<head>` and `<body>`
235
257
  - `site.gtm_id` - Google Tag Manager ID (optional)
236
258
  - `site.prod` - Boolean flag for production environment (optional)
237
259
 
238
- ### Navigation (`_nav.liquid`)
260
+ ### Navigation <small>(`_nav.*`)</small>
239
261
 
240
- A navigation template that renders a list of navigation links with proper accessibility attributes.
262
+ A navigation template `bricks/_nav.{njk|liquid}` that renders a list of navigation links with proper accessibility attributes.
241
263
 
242
264
  **Parameters:**
243
265
 
244
266
  - `nav_pages` - Array of navigation page objects with `url` and `title` properties
245
267
  - `current_url` - The URL of the current page (used to set `aria-current="page"`)
246
268
 
247
- **Usage:**
248
-
249
- ```liquid
250
- {% render 'bricks/_nav', nav_pages: navPages, current_url: page.url %}
251
- ```
252
-
253
- **Example:**
269
+ **Usage example with [Eleventy Navigation plugin](https://www.11ty.dev/docs/plugins/navigation/#bring-your-own-html-render-the-menu-items-manually):**
254
270
 
255
- ```liquid
256
- {% assign navPages = site.pages | where: "nav", true %}
257
- {% render 'bricks/_nav', nav_pages: navPages, current_url: page.url %}
271
+ ```liquid {data-caption="in .liquid:"}
272
+ {% assign nav_pages = collections.all | eleventyNavigation %}
273
+ {% render 'bricks/_nav', nav_pages: nav_pages, current_url: page.url %}
258
274
  ```
259
275
 
260
276
  **Output:**
@@ -267,11 +283,9 @@ A navigation template that renders a list of navigation links with proper access
267
283
  </nav>
268
284
  ```
269
285
 
270
- **Compatibility:** Compatible with [Eleventy Navigation plugin](https://www.11ty.dev/docs/plugins/navigation/#bring-your-own-html-render-the-menu-items-manually).
286
+ ### Google Tag Manager <small>(`_gtm.*`)</small>
271
287
 
272
- ### Google Tag Manager (`_gtm.liquid`)
273
-
274
- A template for embedding Google Tag Manager scripts in your pages.
288
+ A template `bricks/_gtm.{njk|liquid}` for embedding Google Tag Manager scripts in your pages.
275
289
 
276
290
  **Parameters:**
277
291
 
@@ -279,38 +293,12 @@ A template for embedding Google Tag Manager scripts in your pages.
279
293
  - `site.prod` - Boolean flag to enable GTM only in production
280
294
  - `for_body` - Boolean flag (default: `false`). When `false`, renders the script tag for the `<head>`. When `true`, renders the noscript fallback for the `<body>`.
281
295
 
282
- **Note:** This template is automatically included when using `__html.liquid`. You only need to manually render it if you're not using that base template.
283
-
284
- **Manual Usage:**
285
-
286
- In your base template's `<head>`:
287
-
288
- ```liquid
289
- {% render 'bricks/_gtm', site: site %}
290
- ```
296
+ **Note:** This template is automatically included when using `__html.liquid`. You only need to manually render it if you're not using that base template, see examples:
291
297
 
292
- In your base template's `<body>` (right after the opening tag):
293
-
294
- ```liquid
295
- {% render 'bricks/_gtm', site: site, for_body: true %}
296
- ```
297
-
298
- **Example (Manual Integration):**
299
-
300
- ```liquid
301
- <!DOCTYPE html>
302
- <html>
303
- <head>
304
- {% render 'bricks/_gtm', site: site %}
305
- </head>
306
- <body>
307
- {% render 'bricks/_gtm', site: site, for_body: true %}
308
- <!-- Your content -->
309
- </body>
310
- </html>
311
- ```
298
+ - https://github.com/anydigital/bricks/blob/main/bricks/__html.njk
299
+ - https://github.com/anydigital/bricks/blob/main/bricks/__html.liquid
312
300
 
313
- **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.
301
+ <!--section-->
314
302
 
315
303
  ## License
316
304
 
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@anydigital/bricks",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "Framework-agnostic CSS utilities and single-file Liquid 'bricks' for modern web development.",
5
- "style": "./bricks/bricks.css",
5
+ "style": "./src/bricks.css",
6
6
  "exports": {
7
- ".": "./bricks/bricks.css",
7
+ ".": "./src/bricks.css",
8
8
  "./dist": "./dist/bricks.css"
9
9
  },
10
10
  "scripts": {
11
- "postcss": "postcss bricks/bricks.css -o dist/bricks.css",
11
+ "postcss": "postcss src/bricks.css -o dist/bricks.css",
12
12
  "build": "npm run postcss -- --no-map",
13
13
  "start": "npm run postcss -- --watch",
14
14
  "prepublishOnly": "npm run build"
@@ -3,7 +3,7 @@
3
3
  * Framework-agnostic CSS utility helpers
4
4
  */
5
5
 
6
- @import "./__html";
6
+ @import "./_base";
7
7
  @import "./_prose";
8
8
  @import "@anydigital/breakout-css"; /* after prose to override it */
9
9
  @import "./_prism";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes