Live data from Hacker News

OOCSS + Sass = The best way to CSS

ianstormtaylor.com

1–10 of 57 posts

Re: OOCSS + Sass = The best way to CSS

#6
Love the way that works. The only problem with it is that a another, non-related, CSS class still needs to be used. If the element doesn't call for another class you could select the elements directly, but that kinda defeats the point of OOCSS.

Re: OOCSS + Sass = The best way to CSS

#7
post #3

tl;dr Somebody discovered the power of mixins I don't see how SASS is doing something unique here that other preprocessors can't do as well.

Placeholder classes are new in SASS 3.2, so the blog post is explaining how to do them and what problem they solve.

It's not unique, but it has been an awfully long time coming. See: https://github.com/nex3/sass/pull/236

Re: OOCSS + Sass = The best way to CSS

#8
post #3

tl;dr Somebody discovered the power of mixins I don't see how SASS is doing something unique here that other preprocessors can't do as well.

The @extend directive, especially with placeholders, is very powerful and allows you to not repeat yourself in compiled CSS as well.

Re: OOCSS + Sass = The best way to CSS

#9

Again isnt this what SASS is for?

SASS pre-3.2 didn't have the idea of classes that exist at compile time just to be extended. Without the placeholder directive you'd have unused classes polluting your CSS, which goes against the DRY ideals of OOCSS.

It's a complete no-brainer, and I was a little surprised to see SASS didn't have it last year when I was looking into it. Better late than never though!

Re: OOCSS + Sass = The best way to CSS

#10

Love the way that works. The only problem with it is that a another, non-related, CSS class still needs to be used. If the element doesn't call for another class you could select the elements directly, but that kinda defeats the point of OOCSS.

True. I'm just advocating for removing the pattern-level classes. The component-level and context-level classes should still remain. Component-level would be `.dropdown` and context-level would be `.user-dropdown` or `.explore-page .dropdown`. Those should be selected and javascript'ed.

But that way all of the purely presentational classes are kept completely in the CSS where they belong.

Post reply on HN