skom / stylex-connector
StyleX Connector - Bridges StyleX build-time CSS authoring with TYPO3 Fluid templates.
Package info
github.com/Starraider/stylex-connector
Type:typo3-cms-extension
pkg:composer/skom/stylex-connector
Requires
- php: >=8.1 <8.5
- typo3/cms-core: ^12.4 || ^13.4 || ^14.3
- typo3/cms-fluid: ^12.4 || ^13.4 || ^14.3
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.0 || ^11.0 || ^12.0
- squizlabs/php_codesniffer: ^3.13
- typo3/coding-standards: ^0.8
- typo3/testing-framework: ^8.0 || ^9.0
Suggests
- bk2k/bootstrap-package: When using Bootstrap Package alongside StyleX.
- praetorius/vite-asset-collector: For Vite-based asset management in TYPO3.
Provides
None
Conflicts
None
Replaces
None
README
StyleX Connector makes classes compiled by StyleX available in TYPO3 Fluid templates. A sitepackage registers a JSON manifest produced by its frontend build. The {stylex:class(...)} ViewHelper composes supported static conflict maps, including null clearing, or looks up complete class recipes. Recipes concatenate without conflict resolution; dynamic class-plus-variable styles need a consumer adapter.
The extension targets TYPO3 12.4, 13.4, and 14.3 or later in the 14.x line. PHP 8.1 is supported with TYPO3 12.4; TYPO3 13.4 and 14.3 require PHP 8.2 or later. The extension currently limits its PHP support to 8.4. It does not compile StyleX source files or serve the generated CSS.
TYPO3 12.4 is in ELTS. Production installations on that line need a current patched ELTS core release.
Documentation
Start with the installation guide. It covers dependencies, the Vite build and both manifests, TYPO3 registration, asset delivery, and verification in order.
- Vite and asset delivery
- DDEV development server
- Using the ViewHelper
- Content Blocks, Fluid Styled Content, and Bootstrap integrations
- Configuration reference
- Architecture
- Troubleshooting
Minimal example
After the package is registered on Packagist, install the extension in the TYPO3 project:
composer require skom/stylex-connector
Register the build's StyleX manifest in the sitepackage's ext_localconf.php:
\Vendor\StylexConnector\Configuration\StylexRegistry::registerManifest( 'my_sitepackage', 'EXT:my_sitepackage/Resources/Public/StylexManifest/stylex-manifest.json' );
After the frontend build creates that file and the page includes its CSS, use a manifest key in Fluid:
<button class="{stylex:class(styles: 'Button.root')}">Save</button>
Until then, add the Git repository as a Composer VCS repository and require skom/stylex-connector:dev-main in a test project. Follow the installation guide for the required build and asset setup around this example.
Upgrades
The current improvements retain v1 manifests and both PHP namespaces. The maintained optional Vite adapter emits v2 manifests with stable keys and paired CSS hashes. Use vendor/bin/typo3 stylex:validate --required-key Button.root before deployment. Deploy matching CSS and manifests together and flush dependent page caches. See upgrade notes for precedence and deprecated CSS controls. See the changelog for release notes.
Privacy and data handling
StyleX Connector reads local JSON manifests and caches their style keys and CSS class names in TYPO3's cache. It does not collect, store, or transmit personal data. Flushing TYPO3 caches deletes the cached manifest data. No privacy-specific configuration or retention schedule is needed for the connector itself; the host site remains responsible for its own data handling.
Issues and security
Report bugs and ask questions through GitHub issues. Send suspected security vulnerabilities privately to sven@skom.de instead of opening a public issue.
License
This project is licensed under the GNU General Public License v2.0 or later.