Una Kravets 1/21/2025

New capabilities for attr()

Read Original

The article details new, powerful capabilities for the CSS attr() function, shipping in Chrome 133. It now supports typed values like colors, numbers, and percentages, allowing developers to use HTML attribute data directly in CSS properties beyond the `content` property. This enables more semantic, dynamic styling without inline styles or JavaScript, as demonstrated with a product card color selector example.

New capabilities for attr()

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week