abelljs / abell

A Low-Level, Framework Agnostic, Highly Flexible Static-Site-Generator to help you build Static Sites on a smaller learning curve 🌀
https://abelljs.org
MIT License
420 stars 36 forks source link

Scoped CSS is not applied on build-time generated HTML #144

Open saurabhdaware opened 2 years ago

saurabhdaware commented 2 years ago

Describe the bug

Scoped CSS doesn't work with generated HTML (See the stackblitz example below)

To Reproduce

https://stackblitz.com/edit/abell-rqqnss?file=index.abell,_navbar.abell

Expected behavior

The scoped CSS should be applied on all HTML written inside that component irrespective of how it is generated.

Specs:

Additional context

Currently we're looking for HTML tags in the code and injecting the hash which is used for scoping.

Because we're looking for HTML tags before the evaluation, it is only getting applied where we have well defined HTML tags. But for HTML that is generated on build time, that injection of hash doesn't happen.