-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Storefront Components #16486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Philipp Schuch (Phil23)
merged 16 commits into
trunk
from
15352/storefront-components-release
May 20, 2026
Merged
feat: Storefront Components #16486
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
44d68dd
feat: Storefront Components
Phil23 3dd2c1f
Merge branch 'trunk' into 15352/storefront-components-release
Phil23 9c014bf
Fix broken URL escaping in CSS vars
Phil23 44adb68
Fix Vite build and dev-server issues
Phil23 48fdacc
Merge remote-tracking branch 'origin/trunk' into 15352/storefront-com…
Phil23 58c6cb8
Fix release notes
Phil23 8cabfe5
Implment code review feedback for tests
Phil23 8087d0a
Merge remote-tracking branch 'origin/trunk' into 15352/storefront-com…
Phil23 d92da3d
Remove NPM ignore
Phil23 0d808c2
Fix test
Phil23 c2fd38a
Implement code review feedback
Phil23 a55216d
Merge remote-tracking branch 'origin/trunk' into 15352/storefront-com…
Phil23 e0f50be
Upgrade Storybook and fix NPM audit
Phil23 68b9e26
Refactor ThemeCompiler
Phil23 41c3a9d
Implement code review feedback
Phil23 7339851
Merge remote-tracking branch 'origin/trunk' into 15352/storefront-com…
Phil23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| title: Build-time SCSS compilation for Storefront components | ||
| date: 2026-04-20 | ||
| area: storefront | ||
| tags: [storefront, scss, vite, components, theme-compiler] | ||
| --- | ||
|
|
||
| ## Context | ||
|
|
||
| * The Storefront component system introduces theme-agnostic Twig UX components that can be contributed by the Storefront, plugins, and apps. | ||
| * The existing SCSS compilation pipeline runs inside PHP (`ThemeCompiler` via `scssphp/scssphp`) as part of `theme:compile`. It was designed for the monolithic per-theme stylesheet (`all.css`) and is tightly coupled to the theme lifecycle. | ||
| * Running component SCSS through the PHP compiler would mean component styles are recompiled on every `theme:compile`, even when the component source has not changed. | ||
| * The PHP compiler does not have access to the same Sass load paths, Node.js ecosystem packages, or modern Sass features that are available in the JS build toolchain. | ||
| * Compiling component SCSS inside the PHP compiler would also require the compiler to know which component files belong to which bundle, adding more complexity to the theme system. | ||
| * For apps, component source files are only available inside the app's zip archive. Resolving them through the PHP compiler would require downloading and unpacking the zip on every `theme:compile` just to discover and process SCSS files. | ||
|
|
||
| ## Decision | ||
|
|
||
| * Component SCSS is compiled at **build time** by Vite (the same toolchain already used to compile component JavaScript), not by the PHP theme compiler. | ||
| * Each bundle's `Resources/views/components/**/*.scss` files are compiled to individual CSS files and placed in `Resources/public/storefront/components/` alongside their JS counterparts. | ||
| * The compiled CSS files are theme-agnostic and are published through Shopware's normal asset flow (`assets:install` to `public/bundles/<bundle>/storefront/components`). Theme compile reads bundle-local Vite build meta files and provides CSS information for components in the import map saved in the theme runtime config. | ||
| * Theme customisation that previously relied on injecting SCSS variables at compile time (e.g. `$sw-color-brand-primary`) is replaced by **native CSS custom properties** (`var(--sw-color-brand-primary)`). The current active theme's configuration is written as a `<style>` block of `--sw-*` custom properties into the storefront page template at render time. | ||
|
|
||
| ## Consequences | ||
|
|
||
| * **Component SCSS cannot use SCSS theme variables** (`$sw-*`). Components that need runtime-configurable values must use CSS custom properties (`var(--sw-*)`). SCSS abstracts from Bootstrap or the Shopware skin layer (mixins, functions, fixed design tokens) remain fully available. | ||
| * **Component SCSS cannot use runtime feature-flag state**. Feature flags are runtime information, while component SCSS is compiled at build time. Conditional styling that depends on feature flags must be handled at runtime (for example via markup/classes/data attributes or JavaScript), not via SCSS feature checks. | ||
| * Component CSS is compiled once per deployment, not on every `theme:compile`. A build step (`composer build:js:storefront` or the individual component build) must run whenever component SCSS source changes. | ||
| * Developers adding a new bundle with components must ensure their component stylesheets do not depend on SCSS variables that are only resolved at theme-compile time. | ||
| * Extensions (plugins and apps) must ship the pre-compiled CSS files as part of their release artifact. The compiled output from `Resources/public/storefront/components/` must be included in the extension files so that they can be copied without requiring a build step on the merchant's server. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.