“CSS: The Definitive Guide, 4th Edition” Release and Contents
Published 7 years, 1 month pastCSS: The Definitive Guide, 4th Edition is wending its way to the reading public, and I have some updates on that.
The O’Reilly catalog still says October 2017, but for the physical copy, Barnes & Noble and Amazon are now listing a release date of November 5th, 2017, so we seem to have just missed that October release window I was hoping to hit. But not by much! The DRM-free version at eBooks is apparently available now, as are Nook and Kindle versions.
For those of you with access to O’Reilly’s Safari subscription service, there’s an older version of the book currently available. Apparently, so many people have joined the queue to get it that the content-update process breaks. (Our production editor was impressed.) O’Reilly’s engineering staff is aware of the problem and working on it, so hopefully by the time you read this, the problem will be resolved and the final copy online. If not, our apologies, and thanks for your patience.
If you’re wondering if this edition is for you, absolutely it is! But I would say that, wouldn’t I? As would my co-author Estelle. To help you decide, here’s the Table of Contents with a few brief notes on the new things contained therein (chapters marked ALL NEW! are chapters that didn’t exist at all in the 3rd Edition):
- CSS and Documents – a brief overview of what CSS is for, how to apply it (including via HTTP headers!), basic syntax, media and feature queries
- Selectors – all the selectors as of mid-2017, including
:not()
, validity pseudo-classes, the case-insensitivity modifier in attribute selectors, and more - Specificity and the Cascade – probably the least-changed chapter, this lays out the cascade in some detail
- Values and Units – adds viewport units,
ch
(which does not actually mean “one character”),calc()
, and various new color syntaxes like HSL and #RRGGBBAA patterns - Fonts – includes a lot about
@font-face
and the process of loading custom fonts, in addition to the classics like weight, style, variant, family, etc. - Text Properties – adds a fair amount of material on non-horizontal writing and alignment, writing modes, hyphenation, and so forth
- Basic Visual Formatting – this is another chapter that didn’t change a huge amount from the 3rd Edition, though it does touch on the new values for
display
- Padding, Borders, Outlines, and Margins – to all the existing details on those basic topics, we’ve added
border-radius
and all the properties that affect image borders - Colors, Backgrounds, and Gradients – there are all the new background-related properties like
background-size
andbackground-clip
, handling multiple background images, and the wonder world of linear and radial gradients, explained in more detail than anyone probably thought reasonable, plus there’s a section onbox-shadow
- Floating and Shapes – floating hasn’t changed much, but the section on Float Shapes is all new and pretty nifty, if I do say so myself
- Positioning – this got a section on sticky positioning to go along with the classic positioning material
- Flexible Box Layout – ALL NEW! – the ins and outs, the nitty-gritty, the pros and cons of Flexbox
- Grid Layout – ALL NEW! – Grid is here and it’s hot; this chapter explores it in up-to-the-minute detail
- Table Layout in CSS – the third of the minimally-updated chapters, this discusses how data tables are laid out
- Lists and Generated Content – a surprisingly large amount of new material in this chapter, pretty much all centered around
@counter-style
and its capabilities and how you can create emoji counting systems - Transforms – ALL NEW! – rotating, scaling, translating, 3D effects, and more, all with a minimum of matrix math
- Transitions – ALL NEW! – state-based animations and how to define them, introducing some of the basic animation concepts along the way
- Animation – ALL NEW! – stateless animations, which can happen at any time, for any reason you choose to define, made possible through
@keyframes
and a bevy of new properties - Blending, Filtering, Compositing, and Masking – ALL NEW! – all (okay, almost all) the nifty things you used to do in Photoshop, now available natively in browsers, so you can do grayscale images that pop color on hover or click without having to produce two separate images
- Media-Dependent Styles – this was almost ALL NEW!, but it’s a radically reworked chapter from the 3rd Edition with fewer bits about printing, no bits on audio, and a whole lot of details about media queries
And then the Appendices:
- Animatable Properties – a list of CSS2.1 properties that are animatable, with a note on exactly what can be animated
- Basic Property Reference – a compact table of properties, their default values, and the complete value syntax
- Color Equivalence Table – the 148 color names defined in CSS Color Level 4 with their equivalents in RGB decimal, RGB percentage, HSL, and hexadecimal formats
Whew! After all that, you might be thinking that, much like Emacs, this book has everything. And I’d like to say that it does, but… it doesn’t. For example, I decided fairly late in the process to drop multicolumn properties. It was a tough decision, but when I started testing browser support and looking at the state of the specification, it felt too unstable to include. I’ve rushed explanations in past editions, and usually regretted it. (Although, fun fact: the 2nd Edition contains the only known documentation of the CSS Working Group’s multi-hour discussion on how the old clip
property was supposed to work.) So I put multicolumn off for the next edition.
Still, there are far far far more examples of things added in than things left out, enough to make this edition twice as long as the previous. There’s been a lot of growth in CSS over the past decade, and I think Estelle and I have brought together something that will get you up to speed on very nearly all of it. For those of you eagerly waiting on a copy, we really hope you enjoy the result!