mdn / sprints

Archived: MDN Web Docs issues are tracked in the content repository.
https://github.com/mdn/content
Creative Commons Zero v1.0 Universal
149 stars 142 forks source link

Learning CSS Rewrite 2.11 Organising your CSS #652

Closed rachelandrew closed 5 years ago

rachelandrew commented 5 years ago

Individual tasks for the rewrite of the learning CSS section. This one for the 11th part of the CSS Building Blocks section.

This covers the things that are in “making CSS readable” but also perhaps should mention things like the different methodologies people might come across. Not in an in-depth way but showing perhaps a couple of examples of something like BEM and so on.

https://docs.google.com/document/d/1vN0gWLZe_IweWJnYi9q1eMBUsaxdafxfu-ed383nPI8/edit?usp=sharing

rachelandrew commented 5 years ago

@chrisdavidmills First draft is here https://developer.mozilla.org/en-US/docs/User:chrisdavidmills/CSS_Learn/Organizing_your_CSS

chrisdavidmills commented 5 years ago

Hey there,

This is looking pretty good. I have some brief feedback below, but not much:

rachelandrew commented 5 years ago

I don't know what "CSS Flags" is I'm afraid. A search just gets me flag icons.

I can link to tutorials, however I'm not a BEM expert (I actually don't like it as a technique at all) so I couldn't be sure what I was linking to was actually any good.

chrisdavidmills commented 5 years ago

I don't know what "CSS Flags" is I'm afraid. A search just gets me flag icons.

Oops, sorry! It was something that I remember Doug Bowman going on about years ago, and I've used it ever since. It is the idea of separating your CSS fileout into different sections, like you already say, but in the comment separators including some kind of short character sequence that won't appear in the syntax, so you can search for that character sequence and jump between the start of each section.

I use || for my sequence, so for example:

/* || General styles */

...

/* || Typography */

...

/* || etc. */

...

I can link to tutorials, however I'm not a BEM expert (I actually don't like it as a technique at all) so I couldn't be sure what I was linking to was actually any good.

I'm not a fan either — seems way too verbose and confusing for my liking. https://css-tricks.com/bem-101/ looks OK for a bit of a light intro. I don't like the stuff on the official BEM web site — too much of it, and not very helpful for beginners, imo.

rachelandrew commented 5 years ago

OK, I have added some more examples through the commenting section, I've not referred to these as CSS Flags as this sounds like something official that there should be docs about, rather than just something someone mentioned once. Also added a link to the BEM 101 page.