--- url: "https://web.dev/blog/state-of-css-2022" titulek: "State of CSS 2022 | Blog | web.dev" h1: "State of CSS 2022 Stay organized with collections Save and categorize content based on your preferences." popis: "Web styling features of today and tomorrow, as seen at Google IO 2022, plus some extras." jazyk: "en" kanonicka: "https://web.dev/blog/state-of-css-2022" drobecky: ["Blog", "State of CSS 2022"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 00:56:26" znaku: 54191 slov: 7855 kodovani: "iso-8859-2" sha256: "82cc26c43f10385319448baf0f2f6416bb4d3560c44bc6bac0e03c24071d6645" --- State of CSS 2022 Stay organized with collections Save and categorize content based on your preferences. Web styling features of today and tomorrow, as seen at Google IO 2022, plus some extras. Adam Argyle The year 2022 is set to be one of CSS's greatest years, in both features and cooperative browser feature releases, with a collaborative goal to implement 14 features! Overview This post is the article form of [the talk](https://www.youtube.com/watch?v=Xy9ZXRRgpLk) given at Google IO 2022. It's not meant to be an in-depth guide on each feature, rather an introduction and brief overview to pique your interest, providing breadth instead of depth. If your interest is piqued, check the end of a section for resource links to more information. Table of contents Use the list below to jump to topics of interest: **Fresh in 2022** **2022 and beyond** 2022 Browser compatibility @scope @layer @nest subgrid @media (prefers-reduced-data) @container @custom-media hwb() Media query ranges lch, oklch, lab, oklab, display-p3, etc @property color-mix() scroll-start color-contrast() :snap-target Relative color syntax snapChanging() and snapChanged() Gradient color spaces toggle() accent-color anchor() inert Color fonts v1 Viewport unit variants :has() Browser compatibility A primary reason so many CSS features are set to cooperatively release is due to the efforts of [Interop 2022](/blog/interop-2022). Before studying the Interop efforts, it's important to look at [Compat 2021](/blog/compat2021)’s efforts. Compat 2021 The goals for 2021, driven by developer feedback via surveys, were to stabilize current features, improve the test suite and increase passing scores of browsers for five features: `sticky` positioning `aspect-ratio` sizing `flex` layout `grid` layout `transform` positioning and animation Test scores were raised across the board, demonstrating upgraded stability and reliability. Big congratulations to the teams here! Interop 2022 This year, browsers met together to discuss the features and priorities they intended to work on, uniting their efforts. They planned to deliver the following web features for developers: `@layer` Color spaces and functions Containment `` Form compatibility Scrolling Subgrid Typography Viewport units Web compat This is an exciting and ambitious list that I can't wait to see unfold. Fresh for 2022 Unsurprisingly, the state of CSS 2022 is dramatically impacted by the Interop 2022 work. Cascade layers Browser Support 99 99 97 15.4 [Source](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@layer) Before `@layer`, the discovered order of loaded stylesheets was very important, as styles loaded last can overwrite previously loaded styles. This led to meticulously managed entry stylesheets, where developers needed to load less important styles first and more important styles later. Entire methodologies exist to assist developers in managing this importance, such as [ITCSS](https://www.youtube.com/watch?v=1OKZOV-iLj4). With `@layer`, the entry file can pre-define layers, and their order, ahead of time. Then, as styles load, are loaded or defined, they can be placed within a layer, allowing a preservation of style override importance but without the meticulously managed loading orchestration. The video shows how the defined cascade layers allow for a more liberated and freestyle authoring and loading process, while still maintaining the cascade as needed. Chrome DevTools is helpful for visualizing which styles are coming from which layers: Resources [CSS Cascade 5 specification](https://www.w3.org/TR/css-cascade-5/#layering) [Cascade layers explainer](https://css.oddbird.net/layers/explainer/) [Cascade layers on MDN](https://developer.mozilla.org/docs/Web/CSS/@layer) [Una Kravets](https://twitter.com/Una): [Cascade Layers](https://developer.chrome.com/blog/cascade-layers) [Ahmad Shadeed](https://twitter.com/shadeed9): [Hello, CSS Cascade Layers](https://ishadeed.com/article/cascade-layers/) Subgrid Browser Support 117 117 71 16 [Source](https://developer.mozilla.org/docs/Web/CSS/Guides/Grid_layout/Subgrid) Before `subgrid`, a grid inside of another grid couldn't align itself to its parent cells or grid lines. Each grid layout was unique. Many designers place a single grid over their whole design and constantly align items within it, which couldn't be done in CSS. After `subgrid`, a child of a grid can adopt its parents’ columns or rows as its own, and align itself or children to them! In the following demo, the body element creates a classic grid of three columns: the middle column is called `main`, and the left and right columns [name their lines](https://rachelandrew.co.uk/archives/2017/06/01/breaking-out-with-css-grid-explained) `fullbleed`. Then, each element in the body, `