Hello HN, Are there any treatments of the topic of web front-end software design? I'm looking for something similar to "Design Patterns" (http://en.wikipedia.org/wiki/Design_Patterns) but for web front-end HTML/CSS.
I've read Duckett's book (Amazon bestseller) and its just syntax. Also, I've read the Atomic CSS design and BEM methodologies, and while those come close to what I want, I'm looking for a more detailed treatment.
To give an obvious example of what I'm looking for- I would say, use margins to separate multiple instances of same components (among other uses). I wonder if there are books that deal with similar, but non-obvious topics.
I'll try to share some tips - hopefully this is the kinda thing you're after - i recognize some of it might not be on topic.
* use html partials to reduce complexity
* think about cachability and rendering needs - sometimes a simple display feature can have huge ramifications on code required and complexity
* semantic markup is optional, but definetly helps break up a sea of divs, and is good for people who use screen readers
* decouple your HTML from your CSS - if something is to be blue or big, it should be from the CSS, not because it has a "big" or 'blue" class. (see: csszengarden.com)
* scss & co are really useful, but be careful to not go overboard.
* don't assume what fonts your users have - linux, mac, win all differ. if unsure, check all 3 platforms rendering
* load JS at the bottom of the page to prevent render blocking (vs. in the head)
* always test browser size reflow & zoom rendering
* always test css,html, js validations
* test design in grayscale/color blindness simulations
* be aware of browser compatibility and vendor prefixing needs - its not cookie cutter.
* flexbox is new on the block, but it's dreamy to work with and is great for layout (shoutout to flexboxin5.com for helping me)
* code comments, such as those that highlight return values, or why something is X, are hugely helpful
* check for unused CSS - there are a number of scripts/browser extensions/sites that can tell you what CSS is never used, and help you remove it.
* same for JS - make sure you still need / use it all
* html/css is rarely (for me) polished at first pass. Iteration is instrumental at arriving to clean, maintainable code.