Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set an oklch background color with JavaScript #3691

Open
rossrobino opened this issue Mar 6, 2024 · 0 comments
Open

Cannot set an oklch background color with JavaScript #3691

rossrobino opened this issue Mar 6, 2024 · 0 comments

Comments

@rossrobino
Copy link

Basic info:

  • Node.js version: 18.18.0
  • jsdom version: 24.0.0

Minimal reproduction case

https://stackblitz.com/edit/stackblitz-starters-bth55h?file=index.js

import { JSDOM } from 'jsdom';

const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);

const p = dom.window.document.querySelector('p');

// this works
// p.style.backgroundColor = "green";

// this does not
p.style.backgroundColor = 'oklch(76% .23 150)';

console.log(dom.serialize());

// <!DOCTYPE html><html><head></head><body><p>Hello world</p></body></html>

How does similar code behave in browsers?

Sets the style attribute to "background-color: oklch(76% .23 150);"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant