denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
98.1k stars 5.4k forks source link

Implement `CSSStyleSheet` API #13898

Open lucacasonato opened 2 years ago

lucacasonato commented 2 years ago

It would be awesome to be able to use CSSStyleSheet server side to easily manipulate and generate style sheets using the same API as the browser.

https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet

https://andreubotella.com/csswg-auto-build/cssom-1/

surma commented 2 years ago

A Built-In CSS Parser/Generator would be 10/10

zhmushan commented 2 years ago

https://github.com/servo/rust-cssparser Could we use this crate?

cryptographix commented 2 years ago

Maybe could use prior work by @littledivy https://github.com/deno-front-end/css-parser

There's a branch with port to servo WIP

andrewbrey commented 2 years ago

To toss another related project into your field of view, there's https://github.com/parcel-bundler/parcel-css as well :+1:

devongovett commented 2 years ago

Parcel CSS uses rust-cssparser under the hood, and provides parsing/serializing support for all rules/properties on top. I've been meaning to implement CSSOM. All the pieces are there, just need to put them together. Would be cool to collaborate with Deno on that!

timreichen commented 2 years ago

Any updates on this?