Skip to content

Global styles not supporting composed selectors like :is() #501

Closed
@HerrCraziDev

Description

@HerrCraziDev

Problem

Using the global attribute on a style block will prevent any use of composed CSS selectors inside it. Markup as simple as the following will trigger the error.

<style global>
    article :is(h1, h2) {
        font-family: "EB Garamond";
    }
</style>

Output

<redacted>/src/layouts/article.svelte:47:21 :global(...) must contain a single selector
 45 |      }
 46 |  
 47 |      :global(article) :global(:is(h1), :global(h2)) {
                            ^
 48 |          font-family: "EB Garamond";
 49 |      }

I would expect :global(article h1) :global(article h2) to be a more correct preprocessed output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions