Skip to content

DmfAutoStyleguide

DmfAutoStyleguide renders all relevant Bootstrap and Shopware components at /styleguide using the active, compiled theme CSS: no separate stylesheet, no post-install build step. The plugin also ships a CLI and Claude Code Skill pipeline for extracting and applying design tokens.

Quick facts

Composer packagedmf/sw6-plugin-auto-styleguide
Plugin classDmfAutoStyleguide\DmfAutoStyleguide
NamespaceDmfAutoStyleguide
Version1.0.0
Shopware~6.7.0
PHP8.2+

Installation

bash
composer require dmf/sw6-plugin-auto-styleguide
bin/console plugin:refresh
bin/console plugin:install --activate DmfAutoStyleguide
bin/console cache:clear

No build step required, the styleguide reuses the already compiled theme CSS.

Configuration

Plugin setting in the admin (System → Plugins → DmfAutoStyleguide → Configure):

FieldTypeDefaultEffect
enabledboolfalseEnable the styleguide in prod. It is always reachable in dev and stage.

Visibility

In production environments /styleguide returns 404 by default. Toggle enabled to expose it explicitly, e.g. for stakeholder access.

Styleguide sections

15 component sections at /styleguide:

SectionContents
ColorsTheme SCSS tokens (auto-detected) + Bootstrap theme colors
Typographyh1–h6, Display 1–3, body, weights, inline elements
ButtonsSolid, outline, sizes, states, full-width
FormsInputs, select, textarea, checkboxes, radios, switches
BadgesVariants, pills
AlertsSuccess, danger, warning, info
CardsBody, header/footer, themed
TablesDefault, striped
DropdownsPrimary, outline, active/disabled items
PaginationDefault, sizes (sm/lg)
BreadcrumbStandard Shopware breadcrumb
ModalsTrigger + modal dialog
Tabs & AccordionBootstrap tabs + accordion
LinksDefault, colored, bold, no-underline
UtilitiesSpacing scale, border radius, shadows, text/bg colors

Token pipeline (CLI)

dmf:styleguide:map-tokens

Compares the token configuration between parent and child theme. Auto-detected via configInheritance in theme.json.

bash
bin/console dmf:styleguide:map-tokens                 # dry run
bin/console dmf:styleguide:map-tokens --theme=MyTheme # specific child theme
bin/console dmf:styleguide:map-tokens --format=json   # CI-friendly output
bin/console dmf:styleguide:map-tokens --apply         # write overrides into the child theme

Write protection

TokenMapWriter only writes to paths containing /custom/. Writes targeting vendor/ are blocked.

dmf:styleguide:generate

Extracts design tokens from an HTML source and writes them as JSON.

bash
bin/console dmf:styleguide:generate -i path/to/styleguide.html
bin/console dmf:styleguide:generate -i styleguide.html -o var/tokens

Output:

FileContents
var/styleguide/design-tokens.jsonColor, typography, spacing, border
var/styleguide/component-mapping.jsonCSS classes grouped by component category

Claude Code Skill: /extract-tokens

The plugin ships an extract-tokens skill that runs the full workflow interactively (Figma MCP → token diff → SCSS and theme.json write).

bash
/extract-tokens path/to/styleguide.html
/extract-tokens https://figma.com/design/ABC123/MyDesign?node-id=0-1
/extract-tokens current
/extract-tokens styleguide.html --theme MyCustomTheme
/extract-tokens styleguide.html --write

CLI vs. skill

FeatureCLI (bin/console)Skill (/extract-tokens)
Parse HTMLJSON outputInteractive report + diff
FigmaOnly pre-exported JSONDirectly via MCP, paste a URL
Detect theme--theme flagAuto-detected from project structure
Write tokensmap-tokens --apply onlyDirectly into SCSS and theme.json
Context,Knows SCSS conventions, asks when unsure

Auto-detection

The plugin auto-detects:

  • Child theme via configInheritance in theme.json.
  • Parent theme as the last entry (after @Storefront) in configInheritance.
  • Token prefix based on the most common $prefix- convention in SCSS.
  • SCSS path in known directories (abstract/variables/custom.scss, overrides.scss, …).

Notes

Theme-agnostic

The default sections render with any Shopware theme. The plugin detects the active child theme and its tokens automatically. Theme-specific extensions are included via {% sw_include ... ignore missing %}, missing templates do not cause errors.