-1

Is compiled scss using compass keeping the order of declarations?

Is compass (because I guess it's the way compass works that decides that) guaranteeing the order of properties?

Of course it matters only for cases where 2 or more definitions have the same "syntaxic" weight, like:

.a {
  .b.c {
    /*stuff*/
  }
  .b.d {
    /*stuff with same weight*/
  }
}

(considering elements .a .b)

This above is just an example, I would like to know if order is going to be kept in the general case.

lajarre
  • 4,910
  • 6
  • 42
  • 69

1 Answers1

1

Yes it does.

It's not explicitly written in documentation, but you can trust Sass for keeping the order you established. Not respecting this order would have been a real headache for every Sass user, as we all know that the order is extremely important in CSS.

Sass is open source. Ten of thousands people use it, and nobody never complains about this issue, which would have been the strongest one ever found. It's so obvious that nobody thought to add it in documentation, I guess.

You can see an example with your case:

.a .b.c {
  /*stuff*/
}
.a .b.d {
  /*stuff with same weight*/
}
zessx
  • 68,042
  • 28
  • 135
  • 158
  • I'm asking about the general case – lajarre Jan 15 '15 at 15:36
  • Is does, for every case. It would have no sense to not keep the order used by the author (we could never tell what would be the output CSS). It's not explicitly written in documentation, but you can trust Sass for keeping the order you etablished. – zessx Jan 15 '15 at 15:39
  • Sincerely I don't see who/what I should trust but the documentation, where I didn't find this information. But if you believe it's true, please put that as your real answer, thanks – lajarre Jan 15 '15 at 15:43
  • Because Sass is open source, ten of thousands people use it, and nobody never complains about this issue, which would have been the strongest one ever found. It's so obvious that nobody thought to add it in documentation, I guess. – zessx Jan 15 '15 at 15:45
  • Ok that's much more credible indeed! Seems a good empirical way to see things. But please replace your answer with that! Sorry if I wasn't clear in my question on the fact that I'm not looking for the compilation of a specific example (I changed the wording now), but your answer as-is is useless... – lajarre Jan 15 '15 at 15:52