Skip to content

Instantly share code, notes, and snippets.

@thamas
Last active May 13, 2016 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thamas/56cf8715024c95425283f1929cc2bf80 to your computer and use it in GitHub Desktop.
Save thamas/56cf8715024c95425283f1929cc2bf80 to your computer and use it in GitHub Desktop.
Digest of the presentation The Back(side) of the Class by Stephen Hay

Stephen Hay: The Back(side) of the Class

Video: https://vimeo.com/134190982

Have you ever been taught that “modularizing” CSS via an endless number of “reusable” object-like “classes” is the “proper” way to use CSS on “large-scale websites”, or have you taught others that these are “best practices”? Do you think there’s a difference between the term “large-scale websites” and “enterprise websites”? When I say “inheritance” and “specificity”, do you feel dirty?
If you answered yes to the above questions, then you, my friend, are going to absolutely hate this session.
Slides: http://slideshare.net/stephenhay/the-backsideoftheclass
About Stephen: http://the-haystack.com
More about CSS Day: http://cssday.nl or https://twitter.com/cssdayconf

"Bem smacss itcss acss"
Note from me: LOL :D

The problems resolved by different methodologies / frameworks are not necessarily your problems!

We're trying to approach CSS as if it were a programming language.
Note from me: So true!

If you want do staff that a programming language does, use a programming language. And thas's exactly what we do with preprocessors.

Most of the problems class-based methods solve are problems that we caused in the first place.

Obviously these methodologies are not good for everyone because if they were than we would only one them.

We "need" an increasing number of tools, frameworks, methods and dependencies to do our jobs.

I want to write some CSS: http://take.ms/SKu1i

We want a magical methodology that works for every project.

All of us ar right, respectively.

Because my name is Stephen, and I've added these classes to client projects because it would help the client. … This is something I just feel dirty even showing this to you…

These problems we're having are real problems, and tools and methodologies do help solve some of them. It's our job to think critically about which problems we're trying to solve, and which tools and methods are necessary to that specific purpose. In other words, there are no best practices.
Note from me: OK there are no general solutions which good for everyone. But there are ways of working which could help. Eg. write your code as consistent as possible (decide and use!) and comment your code (the "why", not the "what")…

Inheritance is powerful. Are you sure you don't want it?
Note from me: separation of general styles and component styles (decoration) + using variables can help to use inheritance in a good way(?)

I start a project. This project gonna be the best project that I have done ever! It's going to be the cleanest code… people are gonna smell how clean it is from miles away. And they're gonna say "Wow, you are the best!". And than you start working and someone says: "Hey, you know, what about this deadline, the client wants to see this. And here is another deadline…" Ohh, shit…! Aaaaa!
Note from me: Yeah, the real world. :D

Recently worked on a Drupal project. You know what Drupal does? … When you are logged in it adds an invisible div to everything. So there goes your whole nth child stuff.
Note from me: Haha, beacuse I'm a Drupal guy, I have seen problems related to this "you have more divs when logged in" thing so many times… :D

Embrance the caos. The web is messy. Projects are messy. Development is messy. And that's okay. What is right for this project?

Mentions the shame.css from Harry Roberts too.

You always put in comments: "We're gonna change this later". Do you ever change it? No. You never go back and change it.

So thanks! Have a nice day!
Note from me: Haha! :D

Start simply! What if we start our projects withnothing but plain CSS and only added tools and methodologies when absolutely necessary and not as default?

Respect the content, seek independence.
Try to divorce it from technologies…

What if we change the method in a project from BEM to something else in a maintenance phase ? We revrite all of our css but we have to change all the classes in our html too. Becouse technology mixed into the content… Note from me: this is not word by word just a summary of this part of the talk

http://alistapart.com/aricle/axiomatic-css-and-lobotomized-owls
It is preparing to what the web is. A space whre you do'nt exactly know what's going to happen. You domn't know what the comntent managers goint to put in all times.

Refactoring is a good thing
None odf us write perfect code the very first time
Note from me: Oh, I like refactoring! Money for refactoring should be in every projects' budget!

Documentation
… for people.
Note from me: Yes! Yes! Yes! Burt I prefer intensive code comments.

There is no particulear "right" way to write CSS.
Note from me: check my two slides here: :)
https://speakerdeck.com/thamas/futureproof-styling-in-drupal-8?slide=46
https://speakerdeck.com/thamas/futureproof-styling-in-drupal-8?slide=47

Keep things simple.
Respect the content.
Think critically.

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