3 ms·
As someone who helps beginners learn CSS regularly at my job, my biggest qualm with MDN is that they tend to leave out the why. Check out this page: https://de
by lelandfe 4y ago
As someone who helps beginners learn CSS regularly at my job, my biggest qualm with MDN is that they tend to leave out the why.
Check out this page: https://developer.mozilla.org/en-US/docs/Web/CSS/margin-block https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bloc...
> The `margin-block` CSS shorthand property defines the logical block start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
Whew, that's a lot.
Setting aside how inside baseball the terms "logical block" and "physical margin" are, this description fails to tell the reader why they would want to use this property. Why use this, instead of `margin`? It's nowhere on the page. Typically, that reasoning lays buried in the distant and forbidden "Guides" section (which MDN's search doesn't index).
To find our reasoning, you must go to Guides, under CSS expand "CSS building blocks," then finally click "Handling different text directions": https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Handling_different_text_directions https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_...
“But look, you found the explanation for `margin-block`, didn’t you?”
“Yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying 'Beware of the Leopard.'”
- blakblakarak 4y agoThis is a good resource for beginner too: https://tympanus.net/codrops/css_reference/ https://tympanus.net/codrops/css_reference/
- marcosdumay 4y agoYou can't expect long documentation for beginners to be inline on the reference pages. Just start teaching the beginners you help how to find the guides.
- lelandfe 4y agoThe guides are written for beginners. But an explanation of why does not need to be. It could even be included in that intro paragraph with just a sentence or two, with a link out to the guide for more. > how to find the guides I'll let you know when I learn how to find the guides. I didn't even know that one existed until I scoured the site.
- marcosdumay 4y agoThere are a lot of guides. If you go to the more general references on the hierarchy (indexed at the left side), you will find small explanations on the why with links for the guides. What you won't find are general details on the more specific references. Unfortunately, search engines prefer the specific ones, so you will have to backtrack by yourself.