A NSW Government website
Search for a command to run...
The NSW Email Design System framework is a Node.js project that provides reusable components, layouts, and tooling for building accessible, responsive HTML emails. It leverages the Maizzle framework and NSW Design System tokens to deliver production-ready email templates.
tailwindcss-preset-email
preset@nswds/tokens
and custom colour palettes defined inconfig.js
Path | Purpose |
---|---|
components/ | Small, reusable HTML partials (e.g., button, image, section) |
blocks/ | Larger content patterns (e.g., headers, footers, galleries) |
layouts/ | Wrappers providing document skeleton; main.html is the default layout |
emails/ | Component demo pages used to generate the documentation site |
templates/ | Starter email templates grouped by purpose (welcome, announcement, etc.) |
images/ | Static assets copied to docs/assets during build |
docs/ | Compiled output for demos and production builds |
lib/ | Utility functions and colour definitions |
config.js | Base Maizzle configuration, design tokens, and build settings |
config.production.js | Production overrides for Maizzle builds |
The config.js
file specifies which folders contain components and how static assets are handled during builds.
palettes
, theme
, semantic
) and brand assets (logo
, social
).width
, padding
, and column layouts generated via utility functions.toUnitlessLH
), layout generation (generateColumnLayouts
), colour manipulation (generateTint
), and ratios (parseRatio
).Each component is an HTML partial with an optional <script props>
block. Props are processed by Maizzle before rendering. Example: components/button.html
exposes style and behaviour settings for different button variants.
Blocks combine multiple components into higher-level patterns (e.g., footers, galleries). They also use<script props>
to define configurable options, making them reusable in templates and documentation pages.
layouts/main.html
sets up the document structure, meta tags, font loading, reset styles, responsive behaviour, and an optional preheader. It includes embedded Tailwind styles and a script to adjust theme tokens dynamically.
templates/
): Starter emails grouped by use case (e.g.,welcome
, announcement
). Each template subfolder contains one or more numbered variations (1/index.html
), allowing multiple examples under a category.emails/
): Demo pages illustrating individual components and blocks. These are compiled to the documentation site for preview.npm run dev
starts Maizzle in watch mode, compiling templates and components into thedocs
directory.
npm run build
runs Maizzle with the production configuration, generating minified HTML and copying assets to docs
.
Optional scripts run automated accessibility testing against compiled output:
npm run a11y
(axe CLI)npm run a11y:lighthouse
(Lighthouse CI)config.js
.tailwind.config.js
.images/
are automatically copied to the output during builds.<x-button>
,<x-header>
) and override props as needed.The NSW Email Framework structures email development around Maizzle, Tailwind, and NSW Design System tokens. A clear separation of components, blocks, layouts, and templates—backed by configurable utilities—enables quick creation of accessible, responsive email HTML. The project's scripts and configuration files orchestrate building, theming, and accessibility testing, making it a robust foundation for NSW Government email communications.