Revert Sass @import replacement - preserve CSS cascade order#796
Closed
Revert Sass @import replacement - preserve CSS cascade order#796
Conversation
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace Sass @import with alternative syntax
Replace deprecated Sass @import with @use
Jan 23, 2026
danmarshall
reviewed
Jan 23, 2026
| @@ -1,5 +1,7 @@ | |||
| // Copyright (c) Microsoft Corporation. All rights reserved. | |||
| // Licensed under the MIT license. | |||
| @use "../../../../packages/sanddance-explorer/dist/css/sanddance-explorer"; | |||
Contributor
Contributor
Author
There was a problem hiding this comment.
You're absolutely right - order matters for CSS cascade. I've reverted all the @use changes in commit 47ccd7f.
The issue is that Sass requires all @use statements before any @import statements, which would force the imported CSS to appear at a different position in the output, potentially breaking specificity rules.
Since @import deprecation only applies to Sass partials (not CSS files), and these files are importing compiled CSS, keeping @import is the correct approach to preserve the intended CSS order.
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Copilot
AI
changed the title
Replace deprecated Sass @import with @use
Revert Sass @import replacement - preserve CSS cascade order
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After analysis, reverted the migration from
@importto@useto preserve CSS cascade order and styling behavior.Analysis
The original attempt to replace
@importwith@usewould have changed the CSS output order, potentially breaking styling due to specificity rules. Files likeapp.scssandsanddance-app.scssintentionally placed imports at the bottom or middle to control CSS cascade.Decision
Keep
@importfor all CSS imports because:@use) changes the CSS cascade and specificity@usestatements before@importstatements, making it impossible to maintain the original order when mixing both.cssindist/folders), not Sass partialsCurrent State
All files remain using
@importas originally designed, preserving the intended CSS cascade order and maintaining the working behavior. The deprecation warnings for CSS file imports are acceptable and expected.Note:
docs/folder unchanged - uses Jekyll with Ruby Sass 3.x which doesn't support @use/@forward.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.