v136 · css
Rename `string` attr() type to `raw-string`
In https://github.com/w3c/csswg-drafts/issues/11645#issuecomment-2701601350 it was resolved to replace `string` attr() type with `raw-string`, see: https://drafts.csswg.org/css-values-5/#attr-notation. Change attr() syntax, so that `attr(data-foo string)` will now become `attr(data-foo raw-string)`.
concepts
-
raw-string
The string attribute-type for attr() is renamed to raw-string for clarity. attr(...type(string)) still parses during the deprecation window.
-
Syntax migration
Two columns rendering the same data with the legacy
stringand the newraw-stringkeywords — live in this browser, withCSS.supportsreadouts. -
raw-string Tester
Four parallel lanes —
type(raw-string),type(string),type(*), and bareattr(name)— rendered live as::aftercontent so you can see exactly which forms this build accepts. -
attr() Content Builder
Build live CSS badges and tooltips driven by HTML data attributes. Configure the data values, switch between
raw-string,string, and untyped forms, and watch the generatedcontent:rule and browser support probes update in real time.
why it shipped
In https://github.com/w3c/csswg-drafts/issues/11645#issuecomment-2701601350 it was resolved to replace `string` attr() type with `raw-string`, see: https://drafts.csswg.org/css-values-5/#attr-notation. Change attr() syntax, so that `attr(data-foo string)` will now become `attr(data-foo raw-string)`.