peteboere / css-crush

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

If/else in CSS-Crush #73

Closed blickwert closed 9 years ago

blickwert commented 9 years ago

Hi Pete, is there a change to use a if/else statement in CSS Crush?

for example:

set {
 foo: small; /* small, medium or big */
 color-1: red;
 color-2: green;
}

@ifset foo(small) {
  p {
   background-color: $(color-1);
  }
}
@ifset foo(medium) {
  p {
    background-color: $(color-2);
 }
}
@ifset not foo {
  p {
   background-color: black;
 }
}

This feature would be great!

For example, in the SASS is possible in the following way : Link

Thanks Dave