Friday Frontend: Delightful CSS Quick Hits Edition
Tags: fridayfrontend, css, javascript, webdev
Published: 2019-08-16 16:51:21

---
title: Friday Frontend: Delightful CSS Quick Hits Edition
published: true
tags: friday-frontend, css, javascript, webdev
canonical_url: https://zendev.com/2019/08/16/delightful-css-quick-hits-edition.html
---

Happy Friday! I’m back home, frying in a heatwave and slowly recovering from jetlag. :P At least there were some cool articles this week!

In particular, I want to draw your attention to the first couple of CSS articles - they’re both so simple in concept, but the first solves a lot of common UI issues very simply while the latter enables a delightful effect. There’s also some great JavaScript articles, a super exciting announcement about native lazy loading in the browser, and a wonderful article on engineering lessons learned from non-technical people. Enjoy!

Best,  
KBall from ZenDev

P.S. Quick reminder that I recently launched [a coaching program](https://zendev.com/coaching.html) for anyone who wants some more 1-on-1 help. I’m happy to work on your technical skills, but also things like communication, career growth, and managing overwhelm. If you think you might be interested, [book a free intro cal](http://bit.ly/kb-coaching-intro)l and let’s talk about it!

#### CSS & SCSS

##### [CSS :empty Selector](https://dev.to/samanthaming/css-empty-selector-b6f)

A simple but under-utilized pseudoselector, the `:empty` selector can make your life easier in a number of ways. This is a delightfully easy read that first explains how the selector works, and then highlights quite a few common UI problems it can solve for you.

  

##### [Staggered CSS Transitions](https://css-tricks.com/staggered-css-transitions/)

What a fun little effect! Using the `transition-delay` property to create staggered CSS animations. Love it!

  

##### [CSS Units Explained](https://alligator.io/css/css-units-explained/)

Solid overview of CSS units. There’s more here than I realized! For example, did you know that `mm` (millimeters) and `in`(inches) are valid CSS units? Doesn’t make much sense for the web, but when you consider print stylesheets… very interesting. The other pair that I hadn’t known about were `vmin` and `vmax` for using the smallest or largest dimension of the viewport. Some very interesting potential here…

  

##### [Handling Unused CSS In SASS To Improve Performance](https://www.smashingmagazine.com/2019/08/handling-unused-css-sass-performance/)

Warning: This is a long article, with a lot to wrap your head around. And for the stated goal (removing unused CSS from a generated spreadsheet) tools like uncss are both simpler and probably better. However. This is a fascinating exploration of meta-programming and dynamic inclusions of different CSS files using SCSS, and got my head spinning about different ways to use this approach when building frameworks, libraries, and toolkits. Worth a readthrough if that type of thing is your jam.

  

##### [The Differing Perspectives on CSS-in-JS](https://css-tricks.com/the-differing-perspectives-on-css-in-js/?ref=heydesigner)

Chris Coyier drawing together the manifold opinions of a number of experts in the field to start fleshing out a little bit more of a roadmap for when CSS-in-JS makes sense and when it doesn’t. This is a fraught topic and he does a great job of bringing a range of perspectives to it.

  

#### JavaScript

##### [First-Class Functions in JavaScript](https://nick.scialli.me/first-class-functions-in-javascript/)

First class functions (functions that can be passed as arguments to other functions) to me is one of the most powerful concepts in functional programming and moving up in your skill as a developer. They’re included in pretty much every modern language, and JavaScript makes them so beautifully simple to use. This post does a good job of both explaining the concept and showing an example of how they can be useful.

  

##### [JavaScript Promise combinators: .all(), .race(), .allSettled()](https://2ality.com/2019/08/promise-combinators.html)

A great look at the different ways you can combine promises. Digs into the thinking behind them, does some looks at implementation, and highlights uses. A great read for leveling up your skills working with promises and asynchronicity.

  

##### [All the New ES2019 Tips and Tricks](https://css-tricks.com/all-the-new-es2019-tips-and-tricks/)

An update on the latest features in the JavaScript language. Sure, you may already have been using these via babel, but they’re official now and that means browser support is getting good. If you use a service like polyfill.io,you can ship polyfills only to browsers that need them, and take advantage of both lower bundle size & highly optimized browser implementations where they exist.

  

##### [Modern React testing, part 1: best practices](https://blog.sapegin.me/all/react-testing-1-best-practices/)

I like this article (and the next one in the series [here](https://blog.sapegin.me/all/react-testing-2-jest-and-enzyme/)) because they not only dig into the ‘how to’ but also the ‘why to’ test in particular ways, and explore some of the ways in which testing UIs is different than testing backend services, and thus might have different things you chose to optimize for.

  

##### [Getting More Out of Vue Async Components](https://logaretm.com/blog/getting-more-out-of-vue-async-components/)

An interesting exercise looking at a range of ways of exploiting asynchronous loading to code split & load code as needed. Often this conversation stops and starts with asynchronous components, but they go much deeper than that.

  

#### Other Awesomeness

##### [Native lazy-loading for the web](https://web.dev/native-lazy-loading)

I’m super excited about this! Browser-level lazyloading for images, iframes and more via a simple HTML attribute. Currently shipping only in Chrome, but digging into the [whatwg issue](https://github.com/whatwg/html/issues/2806) there is significant engagement from the Webkit team so I imagine Safari will not be far behind, which at least gets to the vast majority of mobile browsers where this is of the biggest value. 

  

##### [Time to First Byte: What It Is and Why It Matters](https://csswizardry.com/2019/08/time-to-first-byte-what-it-is-and-why-it-matters/)

Interesting look into an aspect of performance I haven’t seen discussed much by front-end devs - the pure latency before even a single byte gets back to the client’s browser. Looks at all the factors that can go into that and digs into some new tools available to start breaking this down and improving it. 

  

##### [Building a Full-Stack Serverless Application with Cloudflare Workers](https://css-tricks.com/building-a-full-stack-serverless-application-with-cloudflare-workers/)

This is kind of a trip to read… the author builds what looks code-wise like a relatively traditional node server application. It has routes that run functions that render HTML, etc… but despite the relative familiarity it will run on Cloudflare’s globally distributed CDN using their ‘workers’ serverless platform. Getting you a ‘traditional’ looking app that is 100% serverless, I would expect lightning fast, and extremely inexpensive to run. And all you do is write JavaScript. Mind. Blown.

  

##### [All the best engineering advice I stole from non-technical people](https://medium.com/@bellmar/all-the-best-engineering-advice-i-stole-from-non-technical-people-eb7f90ca2f5f)

This is a paywalled medium piece (which I usually try to avoid in this newsletter), but if you’re just looking at 1 they should let you through and it is just too good to skip. Incredible insights that can be applied to engineering, problem solving, or just life in general.

  

* * *

#### Happy Friday!

That's it for this week's Friday Frontend newsletter. If you enjoyed this, you should probably [follow me on Twitter](https://twitter.com/kbal11) or join my mailing list. Sign up to get these newsletters straight to your inbox every Friday! Sign up here: [https://zendev.com/friday-frontend.html](https://zendev.com/friday-frontend.html)