Download the PHP package axllent/silverstripe-less without Composer
On this page you can find all versions of the php package axllent/silverstripe-less. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download axllent/silverstripe-less
More information about axllent/silverstripe-less
Files in axllent/silverstripe-less
Package silverstripe-less
Short Description Wrapper for less.php to integrate LESS into Silverstripe
License MIT
Homepage https://github.com/axllent/silverstripe-less
Informations about the package silverstripe-less
Less.php module for Silverstripe
A wrapper for less.php to integrate LESS into Silverstripe.
Features
- Integrates a fork of less.php seamlessly into Silverstripe
- Includes flushing option (
?flush
) to regenerate CSS stylesheets (ie. force undetected less changes with @import) - Writes processed *.css files into
assets/_css
and automatically modifiesRequirements
paths - Allows custom global variables to be passed through to less compiling (yaml configuration)
- Automatic compression of CSS files when in
live
mode (may require an initial?flush
) - Adds any processed editor.less files to TinyMCE (must be included in your front-end template)
Requirements
- Silverstripe ^5
Installation
Usage
You need refer to your less files by their full LESS filenames (eg:stylesheet.less
).
Note: The less.php
compiler transforms relative paths like url('../images/logo.png')
into url('/themes/site/images/logo.png')
based on the path provided as you included the files, meaning these won't work in Silverstripe due to the exposed directory structure via (_resources/...
). The two simplest solutions are:
- Use a variable in your less files to provide the path to your files (ie: do not use relative paths), or:
- Include your files using "_resources" in the path to your less file, eg:
Requirements:css('_resources/themes/site/css/stylesheet.less');
Example
In your page controller:
Or via template
The generated HTML will point automatically to the processed CSS file in assets/_css
rather than the original less file location, for example
Further documentation
- Usage.md for usage examples.
- Configuration.md for configuration options.
- View Changelog
All versions of silverstripe-less with dependencies
silverstripe/framework Version ^5.0
wikimedia/less.php Version ^4.1