Migrate Sass @import to @use#1497
Open
MalpenZibo wants to merge 2 commits intomasterfrom
Open
Conversation
Sass `@import` rules are deprecated and will be removed in Dart Sass 3.0.0. Consumers compiling these stylesheets with Dart Sass were seeing the deprecation warnings flood their build logs. This migrates all internal @import rules to the modern @use module system. Plain CSS @import rules (for .css files) remain since they are not deprecated. The legacy node-sass build is replaced with Dart Sass since libsass does not implement @use. The custom sass-importer.js used to strip the webpack-style `~` prefix is no longer needed because we switched to bare specifiers resolved via `--load-path=node_modules`, which works both for our own build and for consumer bundlers (Vite, sass-loader 10+).
- Replace `$x / 2` with `math.div($x, 2)` (asyncStatusIndicator, loadingSpinner, scrollView, toggle). - Replace `darken($c, 10%)` with `color.adjust($c, $lightness: -10%)` in Dropdown. - Bump sass-loader to ^16 and configure webpack with `api: 'modern'` so the styleguide build no longer hits the legacy JS API warning.
Member
|
Puoi generare una diff tra CSS prima e dopo come artifact per assicurarci che sia okay? |
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.
Summary
Silences all Sass deprecation warnings emitted by both the library's own builds and consumers (e.g.
gdsm's Vite + Dart Sass).@importrule deprecation: replaced internal@importwith@use ... as *acrosssrc/**/*.scss(plain CSS@importfor.cssfiles left in place — not deprecated).slash-divdeprecation: migrated$x / 2tomath.div($x, 2)inAsyncStatusIndicator,LoadingSpinner,ScrollView,Toggle.darken()deprecation: migrated tocolor.adjust($c, $lightness: -10%)inDropdown.legacy-js-apideprecation (styleguide build): bumpedsass-loaderto^16and configured webpack withapi: 'modern'.node-sass(libsass — does not implement@use) with Dart Sass for the package's ownnpm run build. Dropped the now-unneededsass-importer.js; bare specifiers are resolved via--load-path=node_modules, which works for both this build and consumer bundlers (Vite, sass-loader 10+).Test plan
npm run build— clean, zero deprecation warnings.npm run build-styleguidist— clean, zero warnings.npm run typecheckpasses.npm run prettier-checkpasses.masterare unrelated to this change.