Silverstripe module to allow use of LessCss to programatically generate CSS
This module creates a simple interface for developing LESS powered websites using Silverstripe.
LESS is a powerful API that allows you to develop CSS styles with real programming logic. This lets developers
generate styles expressively, as opposed to repetitively, supporting maintainable and responsive designs.
LESS injects functionality such as variables, mixins, operations and functions.
This module is built on the LessPhp implementation of LESS.
composer require "tractorcow/silverstripe-lessphp": "3.0.*@dev"
For more examples please see http://lesscss.org/#synopsis
/themes/tractorcow/lesscss/typography.less.css
@color: #4D926F;
.typography
{
p {
color: @color;
}
h1 {
color: @color;
}
}
Will generate:
/themes/tractorcow/css/typgraphy.css
.typography p {
color: #4D926F;
}
.typography h1 {
color: #4D926F;
}
/themes/tractorcow/lesscss/layout.less.css
.rounded-corners(@radius: 5px)
{
border-radius: @radius;
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
}
#header {
.rounded-corners;
}
#footer {
.rounded-corners(10px);
}
Will generate:
/themes/tractorcow/css/layout.css
#header {
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
#footer {
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
}
Copyright (c) 2013, Damian Mooyman, Olivier Penhoat
All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem