News for hackers. Stuff that matters.
Re:Fix CSS by writing it in JavaScript by ttty on Tuesday November 25, 2014 @12:48PM (#8658708)
What if component A and component B need that button? You will comp-a,comp-b{.button{}}? Will you save in comp-a-and-comp-b.scss? What if you need in comp-c and comp-d? As you can see your button is not tight to that comp.

I prefer to have a button class, for example in react that when instanced renders all the time the same. It boundles it's css within, just like this lib.

Re:Fix CSS by writing it in JavaScript by nawitus on Tuesday November 25, 2014 @12:57PM (#8658754)
You could use the namespace feature of Less for that:

http://lesscss.org/features/#features-overview-feature-names...

I haven't personally used it, though.

Another solution would be have a "button.less" like this:

  comp-a, comp-b, comp-c {
    .button {
    }
  }
Re:Fix CSS by writing it in JavaScript by talmand on Tuesday November 25, 2014 @02:21PM (#8659189)
There's nothing stopping you from doing any of that with CSS today, especially if you use SASS or LESS.
Re:Fix CSS by writing it in JavaScript by Offler on Wednesday November 26, 2014 @04:25AM (#8661645)
SASS and LESS are CSS DSLs, you are doing limited programming with CSS, at that stage you may as well do programming in a Turing complete language like JS and reduce the number of tools in your tool chain.