Skip to content

getCss doesn't bundle styles from component when using nested layouts #33

Closed
@rijkvanzanten

Description

@rijkvanzanten

I have a single root.webc layout that defines the <head>, and uses @raw to render just the body:

<!doctype html>
<html>
  <head>
    <!-- other meta tags / links -->
    <style @raw="getCss(page.url)"></style>
  </head>
  <body @raw="content"></body>
</html>

When using this layout directly from a page, the styles of components are correctly bundled to the <style> tag in the head. However, when I use a nested layout, like a home.webc which in turn uses the root layout like:

---
layout: root.webc
---

<header>...</header>

<main @raw="content"></main>

<my-styled-webc-component></my-styled-webc-component>

<footer>...</footer>

styles of the styled webc component aren't bundled to the head anymore, but are instead left nested under the components tag.

Reproduction

See https://github.com/rijkvanzanten/webc-style-bundle-repro

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions