I have a site with the LESS module installed. The main theme CSS, main.css.less uses @import "lib.less" to define a set of variables that I use for different text colours, etc.

Now, I want to create a sub-theme. This subtheme is identical to the main theme except lib.less contains different colour values for some of the variables. I set it up in the normal Drupal 6 manner. Again, I want to keep the styles, just change the colours by getting the main lib.less to be overriden by my subtheme's lib.less.

When the subtheme pulls in main.css.less from the main theme, it also pulls the main theme's lib.less, even though in my subtheme I have a different lib.less. I have also tried adding this to my subtheme info:

stylesheets[all][] = css/lib.less

To try and get it to recognise the subtheme's LESS variables, but it always brings in the main theme lib.less. Any ideas?

1 Answer 1


I am looking for a cleaner answer to this as well but I have found I need to create a main.css.less file in the subtheme and copy all the references which use the new subthemes variables (lib.less) and then they work.

Without copying the main.css.less into the subtheme the new variables don't work.

Maybe this is the correct way, but it doesn't feel right to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.