sass / embedded-host-node

A Node.js library that will communicate with Embedded Dart Sass using the Embedded Sass protocol
MIT License
143 stars 26 forks source link

Using it in Svelte component but class are removed #325

Closed leobenkel closed 1 month ago

leobenkel commented 1 month ago

Hello,

I have a component that looks like:

<div class="foo">
    <slot></slot>
</div>

<style lang="scss">
    :global(.foo) {
        color: red;
        p {
            background-color: yellow;
        }
    }
</style>

but it seems the .foo p is removed since it is not used but the things coming in from <slot> will have <p>. How do i make it keep the CSS?

leobenkel commented 1 month ago

https://github.com/sveltejs/kit/issues/10572#issuecomment-1681424395

Using :global() everywhere fixes it