Re: [csswg-drafts] [css-variables] Are custom properties strings? (#8533)

Fwiw, storing custom property values with the original source string was specified in a6ee408.

But since this issue is still open, I am asking if there should be any special handling when the custom property value includes an unclosed block or function. For example:

```js
const sheet = new CSSStyleSheet
sheet.insertRule('style {}')
const styleRule = sheet.cssRules[0]
styleRule.style.setProperty('--custom', 'fn(')
styleRule.style.getPropertyValue('--custom'); // ??? (1)
styleRule.cssText; // ??? (2)
```

Firefox appends the missing `)` in (1) and (2), while preserving the (trimmed) original source string.

I do not think the round trip requirement for serializing CSS declaration values is also specified as applying for serializing CSS rules, is it?

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8533#issuecomment-3107877238 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 23 July 2025 12:37:17 UTC