What is meant by “Screen” as a class name goal?

Skip to first unread message


Oct 23, 2013, 9:56:52 AM10/23/13
to object-or...@googlegroups.com
Hello, All!

I’m putting together a presentation on Modular CSS and have been reviewing the docs for OOCSS on GitHub. Under the question “Is this semantic? …” on the FAQ page in the Wiki, it reads:

OOCSS can be written in a semantic or non-semantic way, it is up to you to create modules like errorMod rather than bigRedModule. I’ve chosen class names with a few goals in mind (in no particular order).
  • Brevity – every byte counts, so I kept classes as short as possible
  • Clarity – expected behavior/style should be immediately obvious
  • Semantic – what an object is matters more than what it looks like. How will it be used in the site?
  • Generic – the name should be true for most sites. Overly specific names reduce the number of use cases or cause semantic classes to be used in a non-semantic way.
  • Screen – Different views might be provided by mobile or print stylesheets, however they override the default screen view, so the classes chosen are screen specific when there was a conflict. This simplifies development.
The code and docs are a framework, an example of OOCSS. I can’t predict what you are going to put in leftCol. I could call it navigation, but that may not be true for your site. Sometimes these important goals are in opposition to one another. In those cases I’ve fallen back on pragmatism and made a judgement call. Nothing can replace a clever developer making the right choice in a given situation.

The fifth point “Screen” is what I still don’t fully understand. 

  • Are we saying that all the classes have been written within the context of the desktop screen?
  • Or are we saying that we should name a class in such a way so that we reference the screen context within the namespace? 

If it is context, is this still relevant now with Responsive Web Design? Or should we update this to read “View” or “Context”. If you are using a Mobile First approach, you may vary well author your styles with an initial context of a handheld device and then override them with desktop styles.

If it including the intended Screen as a reference within the class name, then maybe we should clarify this point on the FAQ.

I just want to clarify this particular point so that I can present the information accurately.



Reply all
Reply to author
0 new messages