Replace deprecated sass if statements with new syntax (Second Attempt)#1192
Open
brentswisher wants to merge 2 commits intodevelopfrom
Open
Replace deprecated sass if statements with new syntax (Second Attempt)#1192brentswisher wants to merge 2 commits intodevelopfrom
brentswisher wants to merge 2 commits intodevelopfrom
Conversation
🦋 Changeset detectedLatest commit: 4b5942b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
size-limit report 📦
|
df9a7d6 to
9a4e6d0
Compare
The new sass if syntax does not play well with prettier right now, the trailingComma: 'es5' setting specifically causes it to add a comma in the middle of multi-line sass if statements, breaking the functionality
daneah
approved these changes
Feb 7, 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.
This change: (check at least one)
Is this a breaking change? (check one)
Is the: (complete all)
What does this change address?
Because we are using an older deprecated version of the sass
ifsyntax, we are currently getting warnings like this when building the styles:While the old version is still functional, these build warnings also propagate down to consuming apps, and are quite noisy and annoying.
How does this change work?
Uses the sass migrator tool to update the
ifstatements to the new syntax, fixing the warnings.This is a followup of #1184 which had to be reverted due to unexpected style impacts.
The issue in #1184 was that prettier does not understand how to correctly format multi-line if statements in the new sass syntax yet. So it was formatting this:
into this, with an extra comma:
When it then compiled to CSS, the CSS blocks that rely on the functions/mixins would compile as empty blocks, breaking the styles.
While It looks like this was reported and fixed for single line if statement here: prettier/prettier#18465, it is still an issue for multi-line statements. I will file a bug with them next week, but in the mean time I added prettier-ignore comments around the new usages.