Skip to content

Handling of :global broken in Astro 7 #60

Description

@someonewithpc

Astro Info

Astro                    v7.0.3
Vite                     v8.1.0
Node                     v24.15.0
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

With the following Sass in a scoped <style> block:

article  :global(> *) {
  flex-shrink: 0;
  flex-basis: 100%;
  scroll-snap-align: center;
}

With Astro 7, the rules inside :global get silently lost, while it works in Astro 6. For it to work in Astro 7, it must be rewritten as

article > :global(*) {
  flex-shrink: 0;
  flex-basis: 100%;
  scroll-snap-align: center;
}

What's the expected result?

Same behaviour in Astro 6 and Astro 7

Link to Minimal Reproducible Example

https://github.com/someonewithpc/astro-global-combinator-repro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions