Do more with {LESS}
The LESS Stylesheets module released on the marketplace brings support for the LESS dynamic stylesheet language into Kentico CMS 7. Kentico CMS 8 will have general support for registering any CSS preprocessor.
The CSS language is a very important part of website development. CSS stylesheets can be large-scale and complex. To increase efficiency and simplify the usage of CSS, the community has started to develop CSS preprocessors.
We can’t say which preprocessor you should use. This depends on the preferences of individual web developers and the type of the project. Currently, we can see three main preprocessors:
LESS,
Sass and
Stylus.
LESS Stylesheets module
The Less Stylesheets module allows you to use the LESS preprocessor in Kentico CMS 7. The module uses client-side compilation (modern browsers only), leveraging the native LESS compiler. This offers the possibility of easily upgrading to the latest version. The module is released under the Apache License.
Once you download and install the package from the marketplace, you can access the interface in
Site manager -> Development, under the new
{LESS} stylesheets section.
The default installation contains a predefined stylesheet with useful mixins, which you can import to your custom LESS stylesheets.
You can couple LESS stylesheets with existing CSS stylesheets. When you edit a coupled LESS stylesheet, the system automatically updates the associated CSS code. You can assign the connected CSS stylesheet to your website (or individual pages) as usual.
The LESS Stylesheet module has some limitations:
-
The system doesn’t support source control mode for LESS stylesheets (storing stylesheets as physical files).
-
No versioning for LESS stylesheets.
-
LESS code containers (uncoupled LESS stylesheets) don’t have check-in/out functionality.
You can find more information about the module in the instruction document.
General support in Kentico CMS 8
Kentico CMS 8 will have built-in support for registering any CSS preprocessor. You will be able to register custom preprocessors if you have the appropriate server-side libraries to compile the CSS code (e.g.
dot-less).
This solution brings several advantages over the LESS Stylesheets module:
-
General support for any CSS preprocessor
-
Server-side compilation
-
Better user experience (you can use the same UI and functionality for both basic CSS and stylesheets based on preprocessors).
I will write more details about this feature in a future blog post. Feel free to use the comments below or the discussion related to the
LESS Stylesheets module on the marketplace.