silent classes #38

Closed
PavelDemyanenko opened this Issue Oct 16, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@PavelDemyanenko

Hi, how about rewritting code in this direction? https://speakerdeck.com/u/anotheruiguy/p/sass-32-silent-classes

@csswizardry

This comment has been minimized.

Show comment
Hide comment
@csswizardry

csswizardry Oct 16, 2012

Owner

I don’t really agree with that methodology on the whole; it will still lead to bloated CSS (more so than OOCSS) because your abstractions have become 1:1 with your HTML. A class like .media can be applied to many different types of markup but if we were to use silent classes then we’d need to pick a new, unique name for every occurrence of what would previously have just been .media.

If you take a look at my talk Big CSS from this point onward (and slide 25 in particular) you can see how using the same class over and over means it can be applied to many different things without necessarily needing a second ‘semantic’ class.

There might be scope for invisible classes, sure, and I shall cross those bridges when I come to them, but for now classes reused in the HTML are more flexible than having to constantly assign new names to them in the CSS…

Cheers for all your feedback!

H

Owner

csswizardry commented Oct 16, 2012

I don’t really agree with that methodology on the whole; it will still lead to bloated CSS (more so than OOCSS) because your abstractions have become 1:1 with your HTML. A class like .media can be applied to many different types of markup but if we were to use silent classes then we’d need to pick a new, unique name for every occurrence of what would previously have just been .media.

If you take a look at my talk Big CSS from this point onward (and slide 25 in particular) you can see how using the same class over and over means it can be applied to many different things without necessarily needing a second ‘semantic’ class.

There might be scope for invisible classes, sure, and I shall cross those bridges when I come to them, but for now classes reused in the HTML are more flexible than having to constantly assign new names to them in the CSS…

Cheers for all your feedback!

H

@PavelDemyanenko

This comment has been minimized.

Show comment
Hide comment

Ok, thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment