# Prerender custom elements initial styles using JSDOM

**URL:** <https://discourse.gohugo.io/t/prerender-custom-elements-initial-styles-using-jsdom/32608>\
**Category:** support\
**Created:** [April 29, 2021, 9:14am UTC](https://discourse.gohugo.io/t/prerender-custom-elements-initial-styles-using-jsdom/32608 "2021-04-29T09:14:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaaax](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/yaaax/32/14897_2.png) [@yaaax](https://discourse.gohugo.io/u/yaaax)\
**Post date:** [April 29, 2021, 9:14am UTC](https://discourse.gohugo.io/t/prerender-custom-elements-initial-styles-using-jsdom/32608/1 "2021-04-29T09:14:10Z")

</div>

Hi there,

I’ve stepped upon this article from Every Layout:

> **[Eschewing Shadow DOM](https://every-layout.dev/blog/eschewing-shadow-dom/#performance)**
>
> An article from the Every Layout blog.

> […] 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](https://www.11ty.io/), 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:

- [Server Side Rendering | Duet Design System](https://www.duetds.com/server-side-rendering/)
- [GitHub - jagreehal/11ty-stenciljs-ssr-example: Example of using server rendered Stencil components in 11ty](https://github.com/jagreehal/11ty-stenciljs-ssr-example)

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