-
Notifications
You must be signed in to change notification settings - Fork 49
Document CSS and frontend asset build workflow #505
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
adiati98
merged 15 commits into
mautic:7.2
from
Promptless:promptless/pr-16143-scss-build
Jul 17, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ab5fc3c
Add documentation for building CSS and frontend assets
promptless[bot] a580392
Address PR review feedback on asset documentation
promptless[bot] b92bb65
Add vale directives around Building Assets heading
promptless[bot] ccf05dc
Add vale directives around Importmap term
promptless[bot] 97ff276
Add Importmap to Vale vocabulary and remove vale directives
promptless[bot] 2f7e013
Merge branch '7.2' into promptless/pr-16143-scss-build
adiati98 5eaa8bd
Merge branch '7.2' into promptless/pr-16143-scss-build
adiati98 91cb571
Fix capitalization: use lowercase 'assets' for Symfony frontend assets
promptless[bot] 84aea56
Wrap assets paragraph with vale off/on per reviewer request
promptless[bot] 32aad1d
Document offline.css compatibility stylesheet from SCSS production build
promptless[bot] 45229ba
Wrap asset build prose in Vale suppression markers per review
promptless[bot] c29b8d0
Merge branch '7.2' into promptless/pr-16143-scss-build
adiati98 21d1343
Suppress FeatureList false positive on build-assets title
promptless[bot] d76b27a
Address review: remove note, reword title to avoid FeatureList false …
promptless[bot] bc0abc9
Merge branch '7.2' into promptless/pr-16143-scss-build
adiati98 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,7 @@ HTTPS | |
| HubSpot | ||
| IDP | ||
| IMAP | ||
| Importmap | ||
| infographics | ||
| Initialisms | ||
| initialisms | ||
|
|
||
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,82 @@ | ||
| Building CSS and frontend files | ||
| ############################### | ||
|
|
||
| Mautic uses SCSS for styling core UI Components and the SymfonyCasts Sass Bundle to compile them during development and for production builds. | ||
|
|
||
| .. vale off | ||
|
|
||
| Building SCSS during development | ||
| ================================ | ||
|
|
||
| .. vale on | ||
|
|
||
| To compile Sass files, run: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| composer sass:build | ||
|
|
||
| To automatically rebuild on file changes during development: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| composer sass:watch | ||
|
|
||
| The SCSS source files live in ``app/bundles/CoreBundle/Assets/css/``. The watch command rebuilds CSS automatically when files in this directory change. | ||
|
|
||
| .. vale off | ||
|
|
||
| Building assets for production | ||
| ============================== | ||
|
|
||
| .. vale on | ||
|
|
||
| .. vale off | ||
|
|
||
| To build all frontend assets for production: | ||
|
adiati98 marked this conversation as resolved.
|
||
|
|
||
| .. vale on | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| composer generate-assets | ||
|
|
||
| .. vale off | ||
|
|
||
| This builds the Sass files, compiles assets through Asset Mapper to ``var/assets/`` and ``public/assets/``, and generates minified CSS and JavaScript files in the ``media/`` directory. | ||
|
adiati98 marked this conversation as resolved.
|
||
|
|
||
| .. vale on | ||
|
|
||
| You can also run the console command directly: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| bin/console mautic:assets:generate | ||
|
|
||
| Running ``composer install`` automatically compiles the Sass files, so fresh installations include built CSS by default. | ||
|
|
||
| .. vale off | ||
|
|
||
| The production build also generates ``css/offline.css``, a compatibility stylesheet that combines the compiled Sass output with ``app.css``. Standalone pages that can't load assets through Asset Mapper's normal page head, such as the offline page, link to this single style sheet directly. | ||
|
|
||
| .. vale on | ||
|
|
||
| Bootstrap framework | ||
| =================== | ||
|
|
||
| Mautic uses Bootstrap 3.4.1 for its UI framework. The Bootstrap source files come from the ``twbs/bootstrap-sass`` Composer package and are available for importing in your SCSS files. | ||
|
|
||
| .. vale off | ||
|
|
||
| Asset Mapper architecture | ||
| ========================= | ||
|
|
||
| .. vale on | ||
|
|
||
| Mautic uses Symfony Asset Mapper and Importmap for managing frontend JavaScript modules. The Asset Mapper configuration lives in ``app/config/config.php`` and the import map in ``importmap.php``. | ||
|
adiati98 marked this conversation as resolved.
|
||
|
|
||
| .. vale off | ||
|
|
||
| Compiled CSS outputs to ``var/sass/``. Asset Mapper serves it through Symfony's asset system in development. Production builds copy finalized assets to ``media/css/``. | ||
|
adiati98 marked this conversation as resolved.
adiati98 marked this conversation as resolved.
adiati98 marked this conversation as resolved.
|
||
|
|
||
| .. vale on | ||
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.
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.