Download the PHP package heimrichhannot/contao-stylesheet-manager-bundle without Composer
On this page you can find all versions of the php package heimrichhannot/contao-stylesheet-manager-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heimrichhannot/contao-stylesheet-manager-bundle
More information about heimrichhannot/contao-stylesheet-manager-bundle
Files in heimrichhannot/contao-stylesheet-manager-bundle
Package contao-stylesheet-manager-bundle
Short Description This module offers functionality for generating an aggregated CSS file out of different types of stylesheets in Contao (preserving access to mixins and variables from nearly every file).
License LGPL-3.0+
Homepage https://bitbucket.com/heimrichhannot/contao-stylesheet-manager-bundle
Informations about the package contao-stylesheet-manager-bundle
Contao Stylesheet Manager
This module offers functionality for generating an aggregated CSS file out of different types of stylesheets in Contao (preserving access to mixins and variables from nearly every file).
Features
- expandable architecture (new preprocessors like LESS can be added easily)
- SCSS
- uses locally installed sass for compiling SCSS files (usually )
- aggregating all files to a single CSS file
- support for development and production environment (including css map in dev environment and minification aka compression in production environment)
- caching of the generated CSS file so that a full regeneration is only necessary if at least one of the linked files change
- recursive watching for changes of all imported scss files
- a random string is added to the name of the generated css file to bypass browser cache
Possible types of stylesheets
Note: the order of types is mandatory.
Stylesheet type | Description | Supported formats | Overridable stylesheets |
---|---|---|---|
core stylesheets | e.g. bootstrap | CSS, SCSS | – |
module stylesheets | stylesheets living in contao modules, i.e. assets/css | CSS (else contao would throw Exception) | core |
project stylesheets | project specific stylesheets | CSS, SCSS | core, modules |
Note: Even though project stylesheets are loaded after everything else, there's still access to all stylesheets (including variables, mixins, ... living in the core stylesheets).
Currently supported formats
Note: This module is written in an expandable way, so new compilers can be added easily (e.g. LESS).
- CSS
- SCSS (compiled by sass which is a requirement then)
Technical instructions
Installation
-
Add the following code to a config.php of one of your modules (preferably some kind of module containing all the business logic of your project):
Important note: Every file can import other files. These files are also watched for changes. If you don't want that (e.g. due to performance issues), you can disable this feature by setting
$GLOBALS['STYLESHEET_MANAGER']['preprocessors']['scss']['recursivelyWatchImports'] = false
. - Copy the contao template fe_page.html5 to your contao instance's templates directory and replace by (CAUTION: including the comment characters! Adjust the name after the dot according to your domain name in ).
Configuration
Note: Take a look into in order to see what properties can be adjusted.
Commands
- clear the stylesheet manager cache:
CSS generation and caching
Add a new preprocessor
-
Extend from Compiler (copy Scss.php if you like):
-
Register the new preprocessor in the config:
- Activate the new preprocessor:
Hooks
Name | Arguments | Description |
---|---|---|
modifyFrontendPage | $strBuffer, $strTemplate | Triggers the compiling. |
TODO
- support for contao's tags "static", "media", ... in asset paths added to the according arrays in
All versions of contao-stylesheet-manager-bundle with dependencies
symfony/framework-bundle Version ^2.8|^3.0
contao/core-bundle Version ^4.4