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: LESSSass 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.
 
less_general.png
 
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.
 
less_coupled.png
 
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).
 
less_v8.png
 
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.
Share this article on   LinkedIn Google+

Jakub Oczko

Jakub is a Technical Leader at Kentico.

Comments

Jakub Oczko commented on

Hi Alexander,

it seems that you are using web application project and the code behind files are not included in your project or project is not built. See: http://devnet.kentico.com/getattachment/Marketplace/Modules/LESS-Stylesheets/Instructions_LESS_1-0.pdf

Jakub

Jakub Oczko commented on

Hi James,

LESS module won't be released for version 8 and higher. It's better to wait for upgrade and use LESS preprocessor (http://devnet.kentico.com/marketplace/integration/less-preprocessor).

Jakub

Alexander commented on

Very good news. But! I try to install package from marketplace on Kentico 7.0.65 and I get error with Parser Error Message: Could not load type 'CMSModules_LessStylesheets_Less_List'. Upss.. :)

James commented on

Super excited about standard LESS support in v8. I was wondering if installing the LESS module would complicate the v8 upgrade. Trying to decide if to install now or just wait.

Ondrej Machala commented on

Hi Joe,

In version 8 there will be general support of CSS preprocessors. In order to have 'Language' option visible you've got to register at least one CSS preprocessor. However we don't provide any CSS preprocessor in the default installation. Once the version 8 is released, there will be LESS preprocessor package available at Marketplace.

Joe Motacek commented on

I am playing with the Version 8 beta right now and I don't see the language option for the style sheet. What exactly does one need to do to turn it on?

Jakub Oczko commented on

Hi Chris,

as you mentioned, the SASS is not well supported as a managed library for .NET. We are plannig release separate module on the marketplace which will require installed ruby on your machine and admin access. This module will be suggested only for development enviromennt (not for production). This module will use the general support implemented in verison 8.

The main goal for this feature is the general support for additional CSS processing. You will be able to create your own pre-processor module.

Jakub

chris.haines-serenityholidays.co commented on

"Kentico CMS 8 will have general support for registering any CSS preprocessor."

I'm interested in how you are planning on supporting SASS, given that there is currently no complete, managed port of the SASS compiler.

Additionally, have you thought about Compass support too? Many folks who use SASS also use Compass.

Milan Kacurak commented on

I am really looking forward to this meaningful feature :)

Jeroen Fürst commented on

Very nice Jakub! We are definitely going to use this module in our projects :)