Friday, 15 June 2012

css - Structure optimization using less -



css - Structure optimization using less -

i'm working on less project, start become bit big, every time i'm trying compile run out of memory.

this current structure:

style.less colors.less icons.less styles style1 style2 style3

now,

colors.less list of colors , classes icons.less list of icons , classes style.less main file, included , compiled styles folder containing difference every different style

my question (well, more suggestion question) is:

how can optimize construction don't run out of memory anymore when trying compile?

the process following:

colors.less , icons.less contains arrays color, icons , classes, nil more.

i have both colors.less , icons.less included style1.less,style2.less,style3.less, create loop trough colors.

finally, i'll import style.less (the main one) create loop trough icons , add together mixins create final result. problem can't compile run out of memory.

i'm pretty sure there's wrong on construction or way can increment memory (i'm compile using brunch -> this link official website)

any suggestion really appreciated.

thanks lot.

ps: more information, ask.

a partial answer, there's way rid of loops: color , icon info can defined mixins calls, here's mini example:

.colors() { // "array" of colors .-(maroon, #800000); .-(red, #ff0000); .-(orange, #ffa500); .-(yellow, #ffff00); } // generate color classes: .some-prefix { .colors(); .-(@name, @color) { &.@{name} { color: contrast(@color); background: @color; // etc. } } }

same icons...

css less brunch

No comments:

Post a Comment