Re: [csswg-drafts] [css-values] Add `valid-empty`-like value (for CSS Custom Properties) (#10441)

@Loirooriol Another thing I noticed when registering a custom property with CSS and JS when defining an `intitial-value` with a single space → 

```css
@property --foo {
  syntax: "*";
  inherits: false;
  initial-value: ; /* Single space here …*/
}
```

```js
window.CSS.registerProperty({
  name: "--meow",
  syntax: "*",
  inherits: false,
  initialValue: " ", /* Single space here …*/
});
```

When getting the value of the custom props we get different value behavior.

```js
const styles = window.getComputedStyle(document.documentElement);
console.log(styles.getPropertyValue("--foo")?.length); // => 0
console.log(styles.getPropertyValue("--meow")?.length); // → 1
```

![Screenie_2024-06-17-C2ieNg5D@2x](https://github.com/w3c/csswg-drafts/assets/527631/620167ef-54a9-411a-be40-8f9af905a8d2)


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


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

Received on Monday, 17 June 2024 06:43:18 UTC