Links
Nesting in CSS
The ability to use nesting in CSS has been around for well over 10 years now. If you’ve used LESS or SASS, then you’re probably no stranger to how it works. But you’ve never been able to achieve this natively in the browser without a CSS preprocessor, until recently! In this article, we’ll see how the CSS Nesting module works, examples of how to use it, and tradeoffs you should consider with this new feature.
Responsive type scales with composable CSS utilities
If you’ve ever attempted to create responsive type that seamlessly adapts and scales between pre-determined sizes within a type scale based on viewport or container widths, you may have wrestled with JavaScript or wrangled with CSS calculators. But with the help of
calc()
,clamp()
, and a somewhat wonky use of CSS vars, we can simplify this process and tap into the dynamism that modern CSS affords. We can create truly fluid type scales, with composable and responsive type utilities that let your type resize and adapt to the viewport or container width.
Expert CSS: The CPU Hack
This is some seriously wild stuff. Jane finds a way to create a CPU using only CSS, and then demonstrates it by building CSS-only Conway's game of life and Breakout! My jaw is on the floor.
Fun with stroke-dasharray
The
stroke-dasharray
attribute in SVG is more flexible compared to the dashed style in CSS. While there are numerous articles and examples about its usages, including line animations, pie charts, circular progress bars, or even hamburger menu icons, there's still something new to explore.
The Ultimate Low-Quality Image Placeholder Technique
Largest Contentful Paint candidates are penalised for upscaling and also for low entropy. By understanding how the upscaling algorithm works, and how to calculate target filesizes from input dimensions, we can generate the smallest possible legitimate LCP image which can be used as a low-quality placeholder while we wait for our full-resolution image to arrive. The best of both worlds.
Videos
Accessibility Is Easy: Except for When It Isn’t
You get a long way to making your web site or application accessible by keeping things simple. Instead of creating components from scratch, with all the extra complications that it entails along the way, you could easily use a native HTML element that takes care of things for you automatically. But sometimes it's not as simple as that. Not everything that you might need to build on your site has a ready-made solution in the form of an HTML element or a recognised and documented pattern. Sometimes, things can get a little more tricky.
Sponsor
Sponsored by Cloud Four
Thanks to Cloud Four for sponsoring this week’s newsletter! They solve complex responsive web design and development challenges for ecommerce, healthcare, fashion, B2B, SaaS, and nonprofit organizations.
If you’d like to help with the costs of running Friday Front-End, you can back our Patreon for as little as a dollar a month.