A minimal Eleventy (11ty) sample to try SpiraCSS with WebC and plain SCSS.
- Node.js 20+ (recommended)
npm installThe following settings are already configured in this sample:
spiracss.config.js(aliasRoots / generator / selectorPolicy)stylelint.config.jswith@spiracss/stylelint-pluginenabled.eleventy.cjspaths aligned withspiracss.config.js
If not installed, please install the following extensions:
- SpiraCSS HTML to SCSS
- SpiraCSS Comment Links
npm run dev- The top page is already styled and shows data-mode variants/states
- The About page is HTML-first so you can try the SCSS generation flow
- Layout + includes live under
src/_includes/(WebC)
src/index.webc- Styled page
- Includes
data-variant/data-state/aria-selectedexamples
src/about.webc- HTML-first workflow content
src/_includes/layouts/base.webc- Layout with header/footer
src/_includes/partials/- Header/Footer includes
src/_includes/blocks/- Hero/Card blocks
src/assets/css/home.scss/src/assets/css/about.scss- Page entry SCSS (page layer +
@relwiring)
- Page entry SCSS (page layer +
src/assets/css/global.scss/src/assets/css/common.scss- Global styles shared by all pages
spiracss.config.js- SpiraCSS config (shared by HTML CLI / Stylelint)
spiracss-ai-agent-doc.md- AI operation guide (rules and decision criteria)
- If you use AI, load this document into your AI context first
src/about.webc is HTML-first and the layout wraps it, so generating from the full file in Root mode may fail.
Select <main class="about-flow"> ... </main> and generate from that selection.
For manual work, use the VS Code extension. For AI usage, you can base your flow on the HTML CLI.
- Open
src/about.webcand select<main class="about-flow"> ... </main> - Run
Generate SpiraCSS SCSS from Rootfrom the editor context menu or a shortcut - Save the generated SCSS (e.g.,
src/assets/css/about-flow.scss) - Update the parent comment to
// @assets/css/about.scssif needed - Wire it from
src/assets/css/about.scsswith a placement rule and@relcomment - Cmd/Ctrl+Click
// @rel/...in SCSS to jump to related files - Apply your design styles on top of the generated structure
- If Stylelint reports errors, fix them (ask AI if needed)
- Top page (index)
data-variant/data-state/aria-selectedare separated in SCSS- Page-layer wiring is visible via
@relcomments
- About page
- SCSS can be generated from HTML-first content