A first look at container-query-polyfill, a polyfill for CSS Container Queries

Surma has been working on container-query-polyfill, a lightweight polyfill for CSS Container Queries. Let’s take a look at how it works and how it differs from cqfill … What Unlike cqfill —which was covered here before— this Polyfill for Container Queries: Does not require you to declare a separate Custom Property –css-contain that duplicates the …

My Custom CSS Reset

Josh W. Comeau shares (and explains) his CSS Reset. /* Josh’s Custom CSS Reset https://www.joshwcomeau.com/css/custom-css-reset/ */ *, *::before, *::after { box-sizing: border-box; } * { margin: 0; } html, body { height: 100%; } body { line-height: 1.5; -webkit-font-smoothing: antialiased; } img, picture, video, canvas, svg { display: block; max-width: 100%; } input, button, textarea, …

A Guide To Modern CSS Colors With RGB, HSL, HWB, LAB And LCH

Michelle Barker shares advice on the not-so-obvious things you have to keep in mind when handling colors in CSS today. There’s more to color on the web than meets the eye, and it’s about to get a lot more interesting! Today, we’ll take a look at the best ways to use colors in a design …

CSS Full-Height Slideshow with Centered Slides thanks to grid-auto-rows

Recently I saw this tweet float by: CSS experts, I need your help! 👇 I need a container that vertically centers its children and that can be scrollable if necessary. It should be a single container. Not 2. <div class="container"> <item>Vertically centered</item> <item>Vertically centered</item></div> — Álvaro Trigo 🐦🔥 (@IMAC2) September 24, 2021 Now that sounds …

Practical CSS Subgrid Video Tutorials

With CSS Subgrid already being supported in Firefox (ever since version 71), and Chromium recently having started work on it, it might be the perfect time to start learning about CSS Subgrid. That’s exactly what Kevin J Powell thought too, with his “October Subgrid Awareness Month”, so he created a bunch of videos on the …

No-JS Fingerprinting

No-JS Fingerprinting is a POC that you can do fingerprinting — a way of uniquely identifying browsers — without the need for JavaScript. Fingerprinting is a way of identifying browsers without the use of cookies or data storage. Created using properties like language and installed fonts, your fingerprint stays the same even if your browser …

Divtober Speedrun

October is the month of “Divtober”, where artists are challenged to draw different things using CSS and a single HTML element. Each day they get a theme to work with. You can find some nice works on CodePen, all tagged #divtober. Here’s a small selection: See the Pen Single div CSS chili garlic sauce by …

100 Bytes of CSS to look great everywhere

Interesting little CSS snippet by Shawn Wang. This should be simple drop-in css to look good on most displays It’s an enhancement that builds on top of the User-Agent provided styles to make your content more easily consumable by limiting line-length, centring the content column, adding some whitespace, bumping up the font-size, etc. html { …

Media Queries Level 4: Media Query Range Contexts (Media Query Ranges)

A media feature like width can take its value from a range. When used, we prefix these with min- or max- to express “minimum condition” or “maximum condition” constraints. @media (min-width: 300px) and (max-width: 750px) { … } In CSS Media Queries Level 4 these type of Media Features can now be written as a …

On Using Custom Properties

On Twitter, John Allsopp recently shared that Flexbox is the greatest thing that happed to CSS. I quickly chimed in with my personal favourite. To me the single greatest addition to CSS over the past 20 years is Custom Properties. They’ve opened up a ton of possibilities, and make us CSS Authors way more productive. …