peteboere / css-crush

CSS preprocessor.
http://the-echoplex.net/csscrush
MIT License
537 stars 51 forks source link

Allow for @ifset <name>(<value>) checks. #74

Closed MrAdamCook closed 9 years ago

MrAdamCook commented 9 years ago

This will fix issue #73 and help @unetics with #70.

@set bar true;

@ifset bar(true) {
  p {
    margin-bottom: 5px;
  }
}

This will work alongside the original @ifset, aswell as the optional @ifset not.

MrAdamCook commented 9 years ago

Also looking to extend this further to allow for @ifelseset. But having a few issues with the subpatterns used within the regular expression.

I can get it working with a single @ifelseset, but if you wanted more, it currently fails. Here is the regex for it. Do you have any suggestions?

peteboere commented 9 years ago

Thanks @MrAdamCook / @thesigngroup, I quite like this syntax, I'll pull it down and try it out.