Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Astro.glob applies is:global styles #5037

Closed
1 task
isaac-mcfadyen opened this issue Oct 10, 2022 · 1 comment
Closed
1 task

Astro.glob applies is:global styles #5037

isaac-mcfadyen opened this issue Oct 10, 2022 · 1 comment

Comments

@isaac-mcfadyen
Copy link
Contributor

isaac-mcfadyen commented Oct 10, 2022

What version of astro are you using?

1.4.4

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

yarn

What operating system are you using?

macOS

Describe the Bug

When using Astro.glob() with .astro files (so for example, await Astro.glob("/src/pages/news/*.astro"))

  • any is:global styles used on any component within that Astro file (even imported components) are immediately applied
  • even if the import is not used (i.e. all you do is console.log it), the styles are still applied

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ysxamc?file=src/pages/index.astro

Participation

  • I am willing to submit a pull request for this issue.
@matthewp
Copy link
Contributor

This is a duplicate of #3816

A known limitation of Astro.glob. We're going to be working on an alternative API to fix this problem when you only want the metadata about a page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants