- (Setup: http://codepen.io/hlfcoding/pen/vEzpVd, stopwatch, printout of this, all pens loaded.)
- Reason for this talk: better 'general knowledge of' (will be less lost) / 'fundamental knowledge how to' (will do it right).
- Format of the talk. Provide general outline. Q&A time after each point.
- History and personal history with CSS.
- How complexity has been introduced in places and resolved in others.
First topic because grammar establishes foundational conventions. Good warmup.
Show and discuss pros, cons for different markup techniques: http://codepen.io/hlfcoding/pen/dPeBjW
- Markup in the un-semantic style (first figure).
- Markup in the semantic style (second figure).
- Markup in a real example (third figure).
- Review figure captions.
- Mention OOCSS.
- The legacy of the document (object) model.
- These properties (their CSS2 values) have no usage caveats after IE9.
The display
property: http://codepen.io/hlfcoding/pen/myBGvq
- Distinguish block, inline-block, inline. Emphasize this importance.
- Mention vertical-align, but that it's only reliable / easy to understand for one-liners.
- Also touch on the table* properties.
- Note all examples are positioned statically.
The position
property: http://codepen.io/hlfcoding/pen/pvZeNM
- Explain static. Emphasize its use case.
- Explain relative, expanding on static.
- Explain absolute, expanding on relative. Discuss common use cases.
- Explain fixed.
- Explain z-index.
Floating (float
, clear
) properties:
- Gloss over the basics, that floats, along with 'clearfix', are used for columns. There's nothing new or obscure about CSS2 grids.
- http://tympanus.net/codrops/css_reference/float
- http://tympanus.net/codrops/css_reference/clear
- Effective for boxes that snap to an edge and then next to each other while still taking up layout space in the parent.
- Discuss pitfalls with the toolbar use case. Discuss the complexity around floats.
- Margins don't collapse, unlike with normal document flow.
- Floated elements automatically become
display: block
elements if they are inline. - Floated elements remain in the document flow and affect the flow of other elements around it. http://codepen.io/hlfcoding/pen/VYBWww
Mention overflow
.
Use a personal example (provide context): http://codepen.io/hlfcoding/pen/rhnkD
- Go over animation through use of
transition
,animation
,@keyframe
,transform
.- Note for performance we're transforming using
translate
instead of transitioningtop
andleft
.
- Note for performance we're transforming using
- Mention use of pseudo-elements for rendering cross-hairs.
- Note the use of other Sass language features like mixins, maps, loops, and color functions.
But don't forget the small details of the internals.
- Revisit the examples and note the conventions.
- Note variable scoping with old Sass versions.
- Note lack of precendence when using
@extend
. http://codepen.io/hlfcoding/pen/qEyPGw
http://codepen.io/hlfcoding/pen/JoBOyP
- Integrating feature detection is easier these days, most CSS features don't need fallbacks.
- The exception is with layouts and gestures. For example, use flex-box, but fall back to floats or tables.
- Simple responsive layout techniques:
- A single mobile breakpoint (two
@media
queries) and settingmin/max-width
can go a long way, especially since@media
is complex. - Support new media incrementally; keep vigilant and test.
- Note the visual design decisions made to keep the 'spirit' of the UI for smaller viewports.
- Note sometimes best results mean completely different layouts and additional elements and scripting.
- A single mobile breakpoint (two
- Reason for this talk.
- Imperfect model.
- Value of experimentation.
- Brief overview of resources.