Refactor Sass inline if() to @if blocks to get ready for native CSS if()#689
Refactor Sass inline if() to @if blocks to get ready for native CSS if()#689adamkudrna merged 2 commits intomasterfrom
if() to @if blocks to get ready for native CSS if()#689Conversation
87b1d57 to
490c41b
Compare
|
It's great we are getting rid of deprecation warnings, but I would like to point out that clients are polluted with |
There was a problem hiding this comment.
Pull request overview
Refactors Sass code to remove deprecated inline if() usage in preparation for native CSS if(), aiming to eliminate Sass deprecation warnings during builds.
Changes:
- Replace Sass inline
if()calls with@ifblocks in utility/theme generation mixins. - Introduce a computed fallback string variable in collections to simplify conditional
var()fallback output. - Update Playwright dotenv parsing to pass
quiet: truetodotenv.config().
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/playwright/env/parseDotEnvFile.ts | Changes dotenv config invocation (adds quiet: true). |
| src/styles/tools/_utilities.scss | Replaces inline if() used for utility class modifiers with @if. |
| src/styles/tools/_collections.scss | Replaces inline if() usage for modifiers/state and var() fallback with @if blocks and precomputed strings. |
| src/styles/_utilities.scss | Replaces inline if() breakpoint infix logic with @if. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@bedrich-schindler I am also after |
…SS `if()` After this change, there should be no more warnings in the console about the `if()` syntax.
490c41b to
95394a0
Compare
I see. But when I build our internal project (RADES), it throws errors like this: There is bunch of similar warnings. I tried latest sass in RUI, checked configuration, but I have no glue why it does not throw error. But we need to somehow solve this. I though you created this issue as a result of work on assigned RADES issue where you should get rid of those errors. To sum this up, I am approving this, but I would ask you to solve mixed-decls prior to release (in different PR, of course). |
@bedrich-schindler I know. All you need is to turn off the warning suppression in the project (not here): -silenceDeprecations: ['mixed-decls'],And it's gone. However, to get rid of the |
It is not true in few latest minor versions of sass where this cannot be silenced anymore. We had to reconfigure sass to set |
After this change, logs should be free of the similar warnings: