Prerender custom elements initial styles using JSDOM

Hi there,

I’ve stepped upon this article from Every Layout:

[…] it is possible to use a library like JSDOM or headless Chrome to run the code and embedded the necessary (initial) styles on the server
[…] With the static site generator, Eleventy, I was able to server-side render initial styles using JSDOM and a post-processing “transform” function.

The same technique (still with 11ty), is also illustrated here:

Any idea if that would be possible with Hugo?
A kind of “post-process” that would prerender custom elements styles during the builld?