Skip to content

Commit

Permalink
Add note about compiling block styles (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Towers <github@luketowers.ca>
  • Loading branch information
damsfx and LukeTowers authored Feb 25, 2023
1 parent 86206e8 commit 6b16852
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ For now, blocks need to be rendered through the use of a special `blocks.htm` pa
{% endfor %}
```

You can then use the following Twig snippet to render the block data:
You can then use the following Twig snippet to render the block data in your layout:

```twig
{% partial 'blocks' blocks=blocks %}
Expand All @@ -168,3 +168,24 @@ The following is an example of the desired API for rendering blocks:
```

Other ideas and suggestions are welcome.

### Integrating with TailwindCSS / CSS Purging

If your theme uses CSS class purging (i.e. Tailwind), it can be useful to add the following paths to your build configuration to include the styles for any blocks defined by the theme or plugins.

```js
// tailwind.config.js
module.exports = {
content: [
// Winter.Pages static page content
'./content/**/*.htm',
'./layouts/**/*.htm',
'./pages/**/*.htm',
'./partials/**/*.htm',
'./blocks/**/*.block',
// Blocks provided by plugins
'../../plugins/*/*/blocks/*.block',
],
};
```
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
}
],
"support": {
"issues": "https://github.com/wintercms/wn-sso-plugin/issues",
"issues": "https://github.com/wintercms/wn-blocks-plugin/issues",
"discord": "https://discord.gg/D5MFSPH6Ux",
"source": "https://github.com/wintercms/wn-sso-plugin"
"source": "https://github.com/wintercms/wn-blocks-plugin"
}
}

0 comments on commit 6b16852

Please sign in to comment.