# Using Modern CSS attr() with Typed Values for Layout and Animation

DevFeed: [Using Modern CSS attr() with Typed Values for Layout and Animation](<https://devfeed.tech/articles/first-look-at-the-modern-attr-45354.md>)

Original publisher: [Read original article](<https://ishadeed.com/article/modern-attr/>)

Author: Ahmad Shadeed

Published: 2025-04-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ahmad Shadeed](<https://devfeed.tech/sources/ahmad-shadeed.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>), [HTML](<https://devfeed.tech/topics/html.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [Availability](<https://devfeed.tech/topics/availability.md>)

Tags: [animation](<https://devfeed.tech/tags/animation.md>), [attr](<https://devfeed.tech/tags/attr.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [css](<https://devfeed.tech/tags/css.md>), [css-grid](<https://devfeed.tech/tags/css-grid.md>), [feature-detection](<https://devfeed.tech/tags/feature-detection.md>), [html](<https://devfeed.tech/tags/html.md>), [mdn](<https://devfeed.tech/tags/mdn.md>)

## AI overview

A practical guide to modern CSS attr(), focusing on its ability to parse HTML attribute values into typed CSS values. It covers browser support, feature detection, CSS Grid column assignment, textarea row sizing, and animation delays.

## Source excerpt

Intro You might have used the function in CSS before to get the text content for a pseudo-element. The result is as follows: CSS is awesome There is nothing new or groundbreaking here, it's useful for some cases. However, when we want to use a value other than text, it will not work. In the following HTML, I added attribute to the element. And then used the attribute in CSS. It's not working because the function only supports text values.