Here's an excerpt from my theme's .info file:

stylesheets[all][] = css/basics.less
stylesheets[all][] = css/dropdown-blocks.less
stylesheets[all][] = css/main.less
conditional-stylesheets[if lte IE 7][all][] = css/ie7.less

All stylesheets specified with "stylesheets[]" are processed and linked as expected, but the conditional stylesheet is not -- IE7 loads the LESS source code.

Comments

adamdicarlo’s picture

Took a quick look into this and realized the conditional-stylesheets feature is provided by Zen to Zen subthemes.

Adding support in the LESS module for those stylesheets would be wonderful but it would definitely take some work....

corey.aufang’s picture

Version: 6.x-2.4 » 6.x-3.x-dev
Status: Active » Postponed

conditional-stylesheets is handled by the theme or the conditional_styles module (which zen copies their functionality from) and directly generates the link tags on the page.

This might be able to be hijacked by setting the Drupal var used to pass around the conditional styles and setting it with the processed file paths.

As long as we can make LESS runs before the hook_preprocess_page in the conditional_styles module and zen, we can hijack the variable and replace it with the processes conditional sheets

This will take more research.

I'm also postponing this till version 3.x as it will require refactoring of the main build function.

rbosscher’s picture

Is it possible in the 7.x-3.x version to have conditional style sheets and overwrite a variable?

so in main.less we have:


@color-bg: red;

h2 {
  color:@color-bg;
}

and in main-overwrite.less


@color-bg: blue;

and after overwriting the variable have the h2 element turn blue?

corey.aufang’s picture

Issue summary: View changes

Not as you have shown.

But you can use the variables hooks provided with the LESS module.

https://drupal.org/node/2139603 is a documentation page that lists the basic functionality.

There are two variable alter hooks which have documentation in the file less.api.php included with the module.

You can also modify variables that are added through the hooks or .info files on your theme's settings page.

corey.aufang’s picture

Status: Postponed » Closed (won't fix)

There will not be a fix for this in the 6.x-x.x branches. Sorry.