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

bare CSS @import specifiers are not resolving and bundling correctly #1338

Open
thescientist13 opened this issue Dec 2, 2024 · 0 comments · May be fixed by #1342
Open

bare CSS @import specifiers are not resolving and bundling correctly #1338

thescientist13 opened this issue Dec 2, 2024 · 0 comments · May be fixed by #1342
Assignees
Labels
alpha.1 bug Something isn't working CLI v0.31.0
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Dec 2, 2024

Type of Change

Bug

Summary

Observed as part of testing for #1309 that when we try and leverage Spectrum's CSS files through an @import, e.g.

/* src/styles/theme.css */
@import url('../../node_modules/@spectrum-web-components/styles/all-large-dark.css');

This file will load
Screenshot 2024-12-02 at 5 05 27 PM

BUT, it will lead to errors on other files it references
Screenshot 2024-12-02 at 5 05 14 PM

Details

In theory I thought this was covered by #1257 but I guess we are not recursively handling @import statements within @import statements? Here's what the file looks like from unpkg
https://unpkg.com/browse/@spectrum-web-components/[email protected]/all-large-dark.css

Perhaps this is specific to @import in node_modules specifically though? Perhaps we should do something similar to #684 and prefix things as such?

/* src/styles/theme.css */
@import url('~@spectrum-web-components/styles/all-large-dark.css');

Or check if things do / don't have a ./ or ../ and automatically resolve that way?

@thescientist13 thescientist13 added bug Something isn't working CLI v0.31.0 labels Dec 2, 2024
@thescientist13 thescientist13 added this to the 1.0 milestone Dec 2, 2024
@thescientist13 thescientist13 changed the title nested @import of @import statements in CSS are not resolving nested @import of an @import statement in CSS is not resolving or bundling correctly Dec 2, 2024
@thescientist13 thescientist13 self-assigned this Dec 2, 2024
@thescientist13 thescientist13 changed the title nested @import of an @import statement in CSS is not resolving or bundling correctly bare CSS @import specifiers are not resolving and bundling correctly Dec 11, 2024
@thescientist13 thescientist13 moved this from 🔖 Ready to 🏗 In progress in [Greenwood] Phase 10 - Ecosystem Compat Dec 11, 2024
@thescientist13 thescientist13 moved this from 🏗 In progress to 👀 In review in [Greenwood] Phase 10 - Ecosystem Compat Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.1 bug Something isn't working CLI v0.31.0
Projects
Status: 👀 In review
Development

Successfully merging a pull request may close this issue.

1 participant