<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/web/best-of/2021" -->

---
title: Best web.dev posts of 2021 | daily.dev
description: The most upvoted web.dev posts of 2021, curated by the daily.dev community.
canonical: https://daily.dev/sources/web/best-of/2021
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/web/best-of/2021
og:type: website
og:site_name: daily.dev
og:title: Best web.dev posts of 2021 | daily.dev
og:description: The most upvoted web.dev posts of 2021, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of web.dev — 2021

1. 1  
[](/posts/how-to-use-https-for-local-development-cesyvvjre "How to use HTTPS for local development")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Jan 26, 2021  
### How to use HTTPS for local development  
Some APIs that won't work on a deployed HTTP site, will work on http://localhost. mkcert is a tool that helps you do this in a few commands. Never export or share the file rootCA-key.pem mkcert creates automatically when you run mkcert -install.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/9bc157b967bcfbd471955926fcc9d902)  
112  
7
2. 2  
[](/posts/state-of-css-2021-bhtrfsqgj "State of CSS 2021")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
2m read time • Dec 17, 2021  
### State of CSS 2021  
The State of CSS 2021 survey ran for the third year in a row. It reached over 8,000 developers worldwide. The survey also asked, "Which feature would you most like to be able to use in CSS today?" Container Queries was the overall "winner"

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/5d3b0cd98196d5396ad0b1dc01df9eb9)  
55  
1
3. 3  
[](/posts/introducing-open-web-docs-4mp6vput1 "Introducing Open Web Docs")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Jan 25, 2021  
### Introducing Open Web Docs  
Open Web Docs is a collective project between Google, Microsoft, Mozilla, Coil, W3C, Samsung, and Igalia. It is designed to support a community of technical writers around strategic creation and long-term maintenance of web platform technology documentation that is open and inclusive for all.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/33c8116f414a90f356f9a7163c179485)  
48  
1
4. 4  
[](/posts/new-progressive-web-app-training-now-available-un7efnqoz "New Progressive Web App training now available")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
2m read time • Jun 28, 2021  
### New Progressive Web App training now available  
New Progressive Web App training now available. Get started with Progressive Web Apps with our new six-part training, complete with new codelabs. May 20, 2021 Sam Richard Twitter GitHub GlitchBlog Glitch.co.uk. New material will be converted into easier-to-consume formats.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/6286fa5ddd86972c5966f2334ffca782)  
42  
3
5. 5  
[](/posts/building-a-sidenav-component-jr9xku0la "Building a sidenav component")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Jan 21, 2021  
### Building a sidenav component  
Sidenav is a responsive slide-out navigation system for the web. It has one sidebar and toggles only when at a "mobile" viewport of 540px or less. It is stateful, supports keyboard navigation, works with and without JavaScript, and works across browsers. Here's a video version of this post.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/1ce328c54d712b3d9c2931061d25ef7e)  
42  
2
6. 6  
[](/posts/css-for-web-vitals-a1sw38tiz "CSS for Web Vitals")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Jun 02, 2021  
### CSS for Web Vitals  
Cookie notices, particularly those placed at the top of the page, are a common example of this problem. Lighthouse only analyzes a page's performance up until the "page load" event. Cookie banners, ads, and other widgets sometimes do not load until after page load.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/f14f30e28ddbec27d3777ec068aee606)  
36  
4
7. 7  
[](/posts/webrtc-is-now-a-w3c-and-ietf-standard-eotnbd5rc "WebRTC is now a W3C and IETF standard")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Jan 27, 2021  
### WebRTC is now a W3C and IETF standard  
WebRTC is a platform giving browsers, mobile apps, and desktop apps real-time communication capabilities, typically used for video calling. Google initiated the idea to create WebRTC in 2009, as an alternative to Adobe Flash and desktop applications that couldn't run in the browser. In 2013, Mozilla and Google demonstrated video calling between their browsers.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/33c8116f414a90f356f9a7163c179485)  
25  
2
8. 8  
[](/posts/css-accent-color-2enrmb7nh "CSS accent-color")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
2m read time • Aug 11, 2021  
### CSS accent-color  
CSS accent-color brings your brand color to built-in HTML form inputs with one line of code. Currently, only four elements will tint via the accent- color property: checkbox, radio, range and progress. The spec does not limit the application of accent- Color to the four elements shown in this article.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/1dea9e6fee0640bb26cddd364cb8bc5c)  
21
9. 9  
[](/posts/introducing-aurora-nqp5oyfpx "Introducing Aurora")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
6m read time • Jun 15, 2021  
### Introducing Aurora  
Aurora is a collaboration between Chrome and open-source web frameworks & tools. It aims to deliver the best user experience possible for production apps regardless of the browser you're rendering in. By bridging the gap between browsers and frameworks, it enables high-quality to be a side-effect of building for the web.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/77a8e95f0a6ff671a236bc0bc4ef02b5)  
20  
1
10. 10  
[](/posts/security-headers-quick-reference-mraoguztk "Security headers quick reference")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• May 18, 2021  
### Security headers quick reference  
This article lists the most important security headers you can use to protect your website. Use it to understand web-based security features, learn how to implement them on your website, and as a reference for when you need a reminder. Before diving into security headers, learn about known threats on the web and why you'd want to use these security headers.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/cac4369c8dde87d5cd503bbfa4a60054)  
20
11. 11  
[](/posts/introducing-libsquoosh-buykiwfse "Introducing libSquoosh")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
2m read time • Jun 09, 2021  
### Introducing libSquoosh  
Squoosh.app is a PWA that compresses images for you in the browser. It supports many old and new image formats and processes them client-side through WebAssembly. This means your pictures stay safely on your own computer rather than being sent to a server somewhere, and that Squoosh works even when offline.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/e5a329cd8884ca47c7d25aedf91a05fa)  
16
12. 12  
[](/posts/pwas-as-url-handlers-aynhdu72d "PWAs as URL Handlers")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Jun 03, 2021  
### PWAs as URL Handlers  
PWA as URL Handlers is part of the capabilities project and is currently in development. Let installed PWA handle URLs for a more integrated experience. The feature is limited to desktop operating systems like Windows, macOS, and Linux. The origin trial is expected to end in Chromium 97 (January 26, 2022)

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/36ebfb9e95ad4e70a17a8eca810bb3ae)  
15  
1
13. 13  
[](/posts/javascript-what-is-the-meaning-of-this---zcnur6am "JavaScript: What is the meaning of this?")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Mar 08, 2021  
### JavaScript: What is the meaning of this?  
This article is kinda like a big if (…) … else if (…), so you can go straight to the first section that matches the code you're looking at. If the function is defined as an arrow function, the value of this is always the same as this in the parent scope. This pattern is really useful when using instance methods as event listeners in components (such as React components, or web components)

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/58abf5ab4670cdeeca1b990d199dec9c)  
15
14. 14  
[](/posts/building-a-switch-component-z2cfvomdh "Building a switch component")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
13m read time • Aug 11, 2021  
### Building a switch component  
A switch functions similar to a checkbox but explicitly represents on and off states. It has the advantage of not needing CSS or JavaScript to be fully functional and accessible. Loading CSS brings support for right-to-left languages, verticality, animation and more. The top-level class, .gui-switch contains custom properties used throughout the component children.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/ecf396bc888c340b3f1d859c9f4cd049)  
14  
1
15. 15  
[](/posts/building-split-text-animations-nlyr18iyk "Building split text animations")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Apr 21, 2021  
### Building split text animations  
Building split text animations A foundational overview of how to build split letter and word animations. Write CSS transitions and animations for letters and words. Orchestrate the conditionals and utilities on page load. Write JavaScript utility functions for splitting strings into elements. Try the demo. If you prefer video, here's a YouTube version of this post.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/6e6595746f44325eed93534349656dab)  
14  
2
16. 16  
[](/posts/deep-copying-in-javascript-using-structuredclone-xtlg7xldx "Deep-copying in JavaScript using structuredClone")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
5m read time • Dec 16, 2021  
### Deep-copying in JavaScript using structuredClone  
The Platform now ships with structuredClone() , a built-in function for deep-copying. Changes to deeply nested values will be visible in the copy as well as the original. A deep copy copies an object’s properties one by one, but invokes itself recursively when it finds a reference to another object.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/9ed060747123af67eb665946bac8ce56)  
11  
1
17. 17  
[](/posts/building-a-settings-component-tycusj2io "Building a Settings component")  
[![web's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/177a1962a8a945468271068795ff0134)](/sources/[source]/best-of/[year])  
• Mar 17, 2021  
### Building a Settings component  
Building a Settings component A foundational overview of how to build a settings component of sliders and checkboxes. The CSS snippets below assume PostCSS with PostCSS Preset Env. The most complex layout ended up being the macro layout, the logical layout system between <main> and <form>

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/7f9132fe7d505b058c251987ad62d44d)  
10  
1

[See all web.dev archives](/sources/web/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/web/best-of/2021#page","url":"https://daily.dev/sources/web/best-of/2021","name":"Best web.dev Posts of 2021","description":"The most upvoted web.dev posts of 2021, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/web/best-of/2021#items","numberOfItems":17,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/how-to-use-https-for-local-development-cesyvvjre","name":"How to use HTTPS for local development"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/state-of-css-2021-bhtrfsqgj","name":"State of CSS 2021"},{"@type":"ListItem","position":3,"url":"https://daily.dev/posts/introducing-open-web-docs-4mp6vput1","name":"Introducing Open Web Docs"},{"@type":"ListItem","position":4,"url":"https://daily.dev/posts/new-progressive-web-app-training-now-available-un7efnqoz","name":"New Progressive Web App training now available"},{"@type":"ListItem","position":5,"url":"https://daily.dev/posts/building-a-sidenav-component-jr9xku0la","name":"Building a sidenav component"},{"@type":"ListItem","position":6,"url":"https://daily.dev/posts/css-for-web-vitals-a1sw38tiz","name":"CSS for Web Vitals"},{"@type":"ListItem","position":7,"url":"https://daily.dev/posts/webrtc-is-now-a-w3c-and-ietf-standard-eotnbd5rc","name":"WebRTC is now a W3C and IETF standard"},{"@type":"ListItem","position":8,"url":"https://daily.dev/posts/css-accent-color-2enrmb7nh","name":"CSS accent-color"},{"@type":"ListItem","position":9,"url":"https://daily.dev/posts/introducing-aurora-nqp5oyfpx","name":"Introducing Aurora"},{"@type":"ListItem","position":10,"url":"https://daily.dev/posts/security-headers-quick-reference-mraoguztk","name":"Security headers quick reference"},{"@type":"ListItem","position":11,"url":"https://daily.dev/posts/introducing-libsquoosh-buykiwfse","name":"Introducing libSquoosh"},{"@type":"ListItem","position":12,"url":"https://daily.dev/posts/pwas-as-url-handlers-aynhdu72d","name":"PWAs as URL Handlers"},{"@type":"ListItem","position":13,"url":"https://daily.dev/posts/javascript-what-is-the-meaning-of-this---zcnur6am","name":"JavaScript: What is the meaning of this?"},{"@type":"ListItem","position":14,"url":"https://daily.dev/posts/building-a-switch-component-z2cfvomdh","name":"Building a switch component"},{"@type":"ListItem","position":15,"url":"https://daily.dev/posts/building-split-text-animations-nlyr18iyk","name":"Building split text animations"},{"@type":"ListItem","position":16,"url":"https://daily.dev/posts/deep-copying-in-javascript-using-structuredclone-xtlg7xldx","name":"Deep-copying in JavaScript using structuredClone"},{"@type":"ListItem","position":17,"url":"https://daily.dev/posts/building-a-settings-component-tycusj2io","name":"Building a Settings component"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"web.dev","item":"https://daily.dev/sources/web"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/web/best-of"},{"@type":"ListItem","position":5,"name":"2021"}]}]}
```

