im-richard / Scaffold

Extend, combine and compress CSS
http://github.com/IAMRichardT/Scaffold/wiki
161 stars 19 forks source link

Two variables can't have the same value #33

Open karellm opened 14 years ago

karellm commented 14 years ago

All is in the title... it defeats the purpose of variables...

jumpfightgo commented 13 years ago

I noticed that too. For example:

This is the code at the start of the project...

@variables font {
  heading:arial;
  highlight:comic sans;
  body:georgia;
}

Then my boss comes over and says "don't use that stupid font, make all the highlights arial instead of comic sans", so I change to...

@variables font {
  heading:arial;
  highlight:arial;
  body:georgia;
}

And now none of my font specifications work. That's kind of a show-stopper unfortunately.

Aldie commented 13 years ago

Got the same bug here.

Aldie commented 13 years ago

I fixed this by rewriting this function in Variables.php - removed the array_flip (which causes the bug, and sorting by key)

private function _sort_array_by_key_length($array)
{
    uksort($array,array($this,'_sort'));
    return $array;
}