1. Class selectors,
2. BEM naming conventions,
3. Listing css properties,
4. the impact of nesting
Slide 3
Slide 3 text
Performant selectors
Slide 4
Slide 4 text
.selector {…}
Slide 5
Slide 5 text
…
Slide 6
Slide 6 text
The difference between the
best & worse case scenario
targeting class selectors
is surprisingly small
Slide 7
Slide 7 text
Δ = 50ms
Slide 8
Slide 8 text
“The focus should be on
scalable CSS.”
- Nicole Sullivan
Slide 9
Slide 9 text
Readability
Slide 10
Slide 10 text
Specificity > Brevity
Slide 11
Slide 11 text
vs.
.profile-loading-indicator
.loading
Slide 12
Slide 12 text
BEM
Slide 13
Slide 13 text
Block__element--Modifier
Slide 14
Slide 14 text
Slide 15
Slide 15 text
.grid__col .grid__col--centered
Slide 16
Slide 16 text
No content
Slide 17
Slide 17 text
“Follow the rules of
semantics—make classes
descriptive and not reliable
on appearance of the given
element.”
- &yeT StyleGuide
Slide 18
Slide 18 text
listing properties
Slide 19
Slide 19 text
our compiled CSS shows
re-ordered CSS properties
Slide 20
Slide 20 text
SO, we should base how we
order them in our css files
on what's easiest to search
for, read, and debug.
Slide 21
Slide 21 text
a. Display properties (or things that affect
the box model of an element or object)
B. Type (things that affect how fonts are
displayed and positioned & their
corresponding Visual Styles)
c. Decorative properties (properties that
are specific to decoration on structural
[non-typographic elements)
D. Animations and/or element transitions