Menu Close

In 2024, CSS has introduced a suite of features that significantly enhance web design capabilities, offering developers more control and flexibility.

The “CSS Wrapped 2024” initiative by Chrome DevRel highlights 17 notable additions across components, interactions, and developer experience.

Components Enhancements

  • Field Sizing: The field-sizing property allows form elements like textarea, select, and input to automatically adjust their size based on content, eliminating the need for JavaScript workarounds.
  • Animate to height: auto: With the interpolate-size property, developers can smoothly transition elements to intrinsic sizes such as height: auto, min-content, and max-content, enabling more dynamic layouts.
  • Exclusive <details>: Enhancements to the <details> element now support exclusive behavior, allowing only one disclosure to be open at a time, which is particularly useful for accordion interfaces.
  • Styleable <details>: Developers can now apply custom styles to the <details> and <summary> elements, providing greater design flexibility.
  • Anchor Positioning: The new anchor positioning feature enables precise placement of elements relative to anchors, facilitating complex overlay designs.

Interaction Improvements

  • Custom Scrollbars: CSS now allows for the styling of scrollbars, enabling designs that align with the overall aesthetic of the website.
  • Cross-Document View Transitions: This feature facilitates seamless transitions between different documents, enhancing user experience during navigation.
  • Scroll-Driven Animations: Developers can create animations that respond to scroll events, adding interactivity and engagement to web pages.
  • Scroll Snap Events: New events provide better control over scroll snapping behavior, improving the precision of scroll interactions.

Developer Experience Enhancements

  • Backdrop Inheritance: This feature allows elements to inherit backdrop styles, ensuring consistent theming across components.
  • light-dark() Function: The light-dark() function enables responsive design adjustments based on the user’s theme preference, enhancing accessibility.
  • @property: This at-rule allows for the definition of custom properties with specific syntax and inheritance rules, improving CSS variable management.
  • Popover API: The Popover API provides a standardized way to create and manage popover elements, streamlining the development of interactive components.
  • @starting-style: This at-rule defines the initial styles of an element before any animations, ensuring consistent animation behavior.
  • ruby-align: Enhancements to the ruby-align property improve the rendering of East Asian typography, supporting better internationalization.
  • paint-order: The paint-order property allows developers to control the painting order of fill, stroke, and markers, providing finer control over SVG rendering.
  • CSSOM Nested Declarations: Support for nested declarations in the CSS Object Model (CSSOM) simplifies the manipulation of nested styles via JavaScript.

These advancements reflect the collaborative efforts of browser engineers, specification writers, and the developer community, marking a significant leap forward for CSS in 2024.

For a comprehensive overview and demos of these features, visit the CSS Wrapped 2024 page.

We #StandWithUkraine.
Learn how you can help too!

#Stand­With­Ukraine

We stand with our friends and colleagues in Ukraine. To support Ukraine in their time of need read below and also visit this page: Learn more

We don't know how long the war will last. But what we do know is that we can't stand aside and watch.

The fastest way you can help too is to support Ukraine financially. The National Bank of Ukraine (NBU) has opened a multi-currency account for that purpose. Learn more

This account accepts donations in US, Canadian and Australian dollars, euros, British pounds, Swiss francs, yuan and yen.

UA823000010000032302338301027

Also accepting cryptocurrency donations – the fastest way to help. Learn more

BTC – 357a3So9CbsNfBBgFYACGvxxS6tMaDoa1P

ETH, USDT (ERC-20) – 0x165CD37b4C644C2921454429E7F9358d18A45e14

If you want to volunteer in the army of Ukraine and help with deeds, then here are specific instructions how to do this: Learn more

Spread the word!