I'm working with the Symfony 1.4 and I'm running into a bit of a problem using the LESS CSS preprocessor.
Let's say that I have 2 Less files with color specific variables. They are called blue.less
and red.less
.
Here they are:
Blue.less
@mainBorder: blue;
@pulldownBackground: blue;
Red.less
@mainBorder: red;
@pulldownBackground: red;
Now let's say that I have a layout.less file that will look something like this:
// Colored line under Nav
.main {
border: 1px solid @mainBorder;
.pullDown { background: @pullDownBackground; }
}
If I want to use one of the color variable files, I need to declare it at the top of the layout.less file like this:
@import 'red.less';
Since the @import
statement has to reference a specific file, how would I be able to dynamically pass blue.less
to the @import statement whenever I wanted to change the color scheme?
Would there be a way to dynamically declare which of the color specific LESS files will be passed to that import statement with PHP and the Symfony framework?
Or can this problem be solved without server-side code?