CSS attr() gets an upgrade
Briefly

Chrome 133, launching on February 4, introduces a powerful enhancement to the attr() function in CSS. This update allows developers to use attr() more flexibly, enabling it to work with any CSS property and parse values into various data types beyond just strings. Examples include changing text color based on a data attribute or dynamically setting view transition names from element IDs. With this feature, web developers can create more responsive and interactive designs by directly linking CSS styles to HTML attributes.
A feature shipping in Chrome 133 allows the attr() function to be used with any CSS property, enhancing its flexibility and data type parsing capabilities.
The new attr() lets developers extract values from HTML attributes and assign them directly to CSS properties, making styling more dynamic and responsive.
Read at Bram.us
[
|
]