- From: Raphael via GitHub <sysbot+gh@w3.org>
- Date: Mon, 17 Jun 2024 06:43:18 +0000
- To: public-css-archive@w3.org
@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
```

--
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