larryq (38) [Avatar] Offline
#1
I know the book is CSS-focused, but I wondered if you'll discuss CSS meta-languages such as Less or Sass and how they fit into the ecosystem. Many developers like me, CSS novices, use one or the other in our day-to-day work and I'm not sure if it's important that we know how the end-result CSS is generated or if there are steps we can take higher up the food chain to ensure good CSS in the end.
tempusfugit (128) [Avatar] Offline
#2
After Into the Future of CSS a nudge towards PostCSS (which lets you focus on just the features you actually use) would make more sense ...
Keith J Grant (27) [Avatar] Offline
#3
I’m not going to spend much time on them, no. Honestly, that topic could be a whole book in itself (Manning actually has one on Sass and Compass already).

My focus is more on the core principles that will help you make sense of CSS. Processors provide tooling to reduce boilerplate and streamline your work, but they don’t fundamentally change those core principles.

That said, I’m not about to pretend processors don’t exist (I use Less, Sass, and PostCSS myself, each in various projects). I’ll make brief mention of them in a few places where it is relevant to help you connect the dots between the two... Two such places I know for sure are Chapter 7 (Positioning & Stacking Contexts) and Chapter 9 (Modular CSS). If you’ve purchased the MEAP, I’d welcome any feedback or questions on these issues once those chapters are made available smilie
Keith J Grant (27) [Avatar] Offline
#4
...If you are interested, I’m going to be giving a talk at Connect Tech (http://connect-js.com/) next month called “CSS From the Future” -- it’s a look ahead at some various ideas that are being worked on in the CSS specification. Over the next several years, most of the features we use in Less or Sass might be making their way into native CSS (and a couple of them already have).
larryq (38) [Avatar] Offline
#5
Sounds good, thanks Keith.
428149 (29) [Avatar] Offline
#6
I didn't realise that the book didn't include these basic topics: I wouldn't have bought it if I had known. I specifically bought a MEAP book on the assumption that it would be up-to-date.

Without either SASS, Less or PostCSS it's impossible to use CSS code which is less than about eight years old because of the lack of support. Your chapter on Flexbox, for example, contains no discussion of the various conflicting syntaxes, no discussion of browser support and no way to get around these obvious problems (i.e., use Post CSS).

No other Manning titles cover these topics properly ('SASS and Compass' is obsolete).
Keith J Grant (27) [Avatar] Offline
#7
Thanks for your thoughts. I understand the frustration.

Be sure to check out page 121. I discuss the problem of vendor prefixes and recommend the use of Autoprefixer (the PostCSS plugin) to take care of the problem for you. I haven't had to worry about the conflicting Flexbox syntaxes in ages because this does all the work for me. You shouldn’t have to worry about them, either smilie. If something in this section is unclear, or could use better emphasis, I’d love to hear your thoughts on that.

I’m glad you’re looking for a CSS book that is up to date; that's exactly my goal here. The vendor prefix problem is fading—you’d be amazed how much of your code works without them these days. The world of CSS is undergoing a lot of changes now. Preprocessors will remain a key part of the landscape, but I think going forward they will be less important than they have been in recent years. Many of the benefits they offer are making their way into the native language.

My goal is to teach the core language, and bring you up to speed on the changing landscape. SASS, Less, and PostCSS are great, but you need to fundamentally understand the CSS they produce. In JavaScript, a framework is helpful (even essential), but unless you understand vanilla JavaScript, it can only do so much for you. I think it’s the same with CSS. And, I think once you have a solid handle on CSS, the preprocessors are easy to pick up.
Keith J Grant (27) [Avatar] Offline
#8
Also, I haven’t written the Introduction yet, but in it I will mention browser support. Everything in by book is supported in IE10 and up, as well as all the evergreen browsers, unless otherwise stated. I think that by the time the book goes to print, this will be more than enough for most projects.
428149 (29) [Avatar] Offline
#9
>>Thanks for your thoughts. I understand the frustration.

>>Be sure to check out page 121. I discuss the problem of vendor prefixes and recommend the use of Autoprefixer (the PostCSS plugin) to take care of the problem for you. I haven't had to worry about the conflicting Flexbox syntaxes in ages because this does all the work for me. You shouldn’t have to worry about them, either smilie. If something in this section is unclear, or could use better emphasis, I’d love to hear your thoughts on that.

This mentions Autoprefixer, but doesn't explain how to use PostCSS or explain how central these tools are to the use of Flexbox or any other modern features of CSS.

>>I’m glad you’re looking for a CSS book that is up to date; that's exactly my goal here. The vendor prefix problem is fading—you’d be amazed how much of your code works without them these days.

According to caniuse.com, the definitive guide to browser compatibility, 15% of browsers can't make sense of the code you present without prefixes. No competent web designer would try to get away with a product which created garbage for 15% of his users. Being 'amazed' that it works for the other 85% isn't acceptable, any more than it would be acceptable for a car manufacturer to sell cars that worked 85% of the time.

>> I think going forward they will be less important than they have been in recent years. Many of the benefits they offer are making their way into the native language.

It makes no difference what the situation will be in 10 years' time. Browsers which are only 6 years old can't use modern-day Flexbox without pre-processing.

Nor is it the case that you are focusing on the 'core issues' of CSS. You waste an entire chapter talking about grid layout, which will be impossible to use until - say 2027 - when all browsers in the wild use it.

I would seriously consider a major update to the book. Cut out the material which would be useful for Star Trek web designers and focus on material which is needed in 2017 to create functional websites.
Keith J Grant (27) [Avatar] Offline
#10
I’m happy to say, there will be an Appendix on Preprocessors in the book. Writing it now! I'll cover Sass and PostCSS (plus a brief mention of Less)