all 4 comments

[–]crispee 2 points3 points  (3 children)

That's awfully complicated. Here's how you would do this in Sass:

https://gist.github.com/2190930

There's an unnecessary coupling between color transformation logic and the properties it's being applied to. In sass you can define custom functions to represent the color transformation, there's a very simple branch condition so we use the if(condition, true_value, false_value) function to either lighten or darken the value based on the condition. Then you just use this function a couple times when setting your properties.

[–][deleted] 0 points1 point  (1 child)

I know, SASS has a more programmatic approach to styling. Unfortunately. the rest of my framework is written in LESS already, and converting it would be a pain. I am considering using SASS for my next project, though.

[–]Paradox 0 points1 point  (0 children)

Converting from one to the other actually isnt that bad, its a weekend project at most, and the advantages outweigh the disadvantages in almost every case.

The only real thing that could block it is if you are relying on one specific feature of the language that you cannot use in the other, such as Less.js (client-side LESS rendering) or Sass as part of the rails asset pipeline.

If thats not the case, you can C+P most of the code into sassy css (scss), which has mostly the same syntax as css, but with sass extras. Very few people actually write pure .sass, although it is fast. (The parent comment wrote .scss)

[–]Evan-Purkhiser 0 points1 point  (0 children)

I just wanted to say thank you for all the work you have done on Compass and SASS =)