Jump to content

- - - - -

Problem With @import - Less

LESS child theme

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 krafit



  • Members

  • 15 posts

Posted 31 October 2012 - 09:23 AM


I'm doing my first steps with LESS and tried to split my styles into different files.
But importing into my style.less seems not to work as it's supposed to be. (Probably I'm too dumb to see the mistake)

As long as my LESS-Code (do you say 'code'?) is in the style.less everything is perfectly fine, but as soon as I put it in a file in the subfolder '/less/' of my childtheme it's not taking effect anymore.

I tried
@import with a relative path

Please Login or Register to see this Hidden Content

- it seems to cause a error while compiling, so the page isn't loading anymore.

and I tried an absolute path

Please Login or Register to see this Hidden Content

- the page loads correctly but my style changes don't take effect + I can't find them in the compiled CSS-File.

( + I tried both ' and " )

Thank you very much in advance.

#2 Simon_P



  • Administrators

  • 8388607 posts

Posted 31 October 2012 - 11:53 AM

You cant @import less files.

Add your less code to style.less file in the child theme dir, this gets auto compiled.

The /less/ folder is for less file overrides, if you place a dropdowns.less file in there, it will load this instead of the dropdowns.les file in the core framework.

If you really want to stick with your downloads.less filename, you will have to use a filter to add it to the LESS included files.