Style it till it works
Understand CSS, it's limits, and hack around them
Develop or use tools to manage complexity
Ability to move things and have them still look right
Change the look of elements without changing HTML
Be able to predict how an element is styled
Readable code
Classnames example 'col-sm-4 m-b-lg'
classnames used for appearance
large, column, how many columnsappearance now determined in either HTML or CSSclasses contain element names
Default hacks on most elements
Overloads the existing term 'block' to mean 'component'
Repeats styling in class name, since a BEM 'block' or BEM 'element' often duplicate actual elements.
Assumes non 1:1 item / element mismatch
Appearance controlled in class names
Duplication
Can't predict a class name an element will use
Hacks everywhere
What do we mean by hacks?
Noisy code
Cognitive overhead
Twitter is company with massive resources
and huge financial incentive to make its products
work for users on unmaintained browsers.
Abandon complexity
Use an element name if it exists
People will be able to guess it
section, button, footer, q, label, nav
If an element doesn't exist, add a class
.avatar, .feature, .status-badge, .breadcrumbs
Keeps visual control in stylesheet
No need to add HTML
Small overhead in compiled code is worth it
bs-docs-footer-links text-muted
footer .links
Every ☒ in your design is a block element.
Decide how you want the block to flow and let flex do the work
Mobile
Desktop
CSS nth child, Flex row-reverse
How do I put my product features beside each other?
.features, specify width, put them beside each other
Hence style things relative to their component
Flex means you shouldn't need to use these
If you are adding blocks that aren't in your design - containers, wrappers etc. - you are performing some kind of hack. This should evaluated.
Higher signal-noise
Visual appearance is 100% in stylesheet
Know where in stylesheet to look
'footer .links'All styling is deliberate
not side effects of hackscertsimple.com