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

  1. raw-string

    The string attribute-type for attr() is renamed to raw-string for clarity. attr(...type(string)) still parses during the deprecation window.

  2. Syntax migration

    Two columns rendering the same data with the legacy string and the new raw-string keywords — live in this browser, with CSS.supports readouts.

  3. raw-string Tester

    Four parallel lanes — type(raw-string), type(string), type(*), and bare attr(name) — rendered live as ::after content so you can see exactly which forms this build accepts.

  4. 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 generated content: 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)`.

references