im-richard / Scaffold

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

Properties can't use Variables #39

Open pdclark opened 13 years ago

pdclark commented 13 years ago

Because Properties hooks into pre_process and Variables hooks into process, custom properties such as image-replace are unable to take variables.

Switching Properties to process and Variables to pre_process resolves the issue, but I don't know if that has any adverse effects.

Example:

@variables img {
  someimage: /test.jpg;
}

#test {
  image-replace: url(img.someimage); 
  /* returns url(img.someimage), not url(/test.jpg) */
  /* parses to: background:url(/test.jpg) no-repeat 0 0;height:0;padding-top:0px;width:0px; ... */
  /* Because image is not found, so no dimensions are set, THEN the variable gets replaced after image-replace has run */ 

  /* With hook order switched dimentions are filled in: */
  /* background:url(/test.jpg) no-repeat 0 0;height:0;padding-top:460px;width:320px; ... */
}
balupton commented 13 years ago

This has been resolved in balupton's fork - I suggest you use that one http://github.com/balupton/Scaffold until the changes are pulled.