# Replace sass-rails with dartsass-rails and migrate SCSS imports to @use #1109
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.
Overview
This PR replaces the
sass-railsgem withdartsass-railsto resolve compatibility issues with the current Rails setup, updates the main SCSS entry to address Dart Sass deprecation / ordering warnings, and adds a PostCSS plugin to handle CSS property deprecations.Changes
gem "sass-rails", ">= 6"withgem "dartsass-rails"inGemfileGemfile.lockwith the new dependencyapp/javascript/stylesheets/application.scss:@importusages with@use "<path>" as *;(minimal, non-breaking)@userules are at the top (required by Dart Sass)react-toastify/dist/ReactToastify.min.css) after the@useblockpostcss.config.js:color-adjustproperty withprint-color-adjustWhy
sass-railsproduced build errors with the current Ruby / Rails environment.dartsass-railsuses Dart Sass and resolves the initial compatibility failures.@import; migrating to@useremoves deprecation warnings and prevents future breakage.color-adjustare addressed with automatic property replacement.What I verified
node_modulesis in the load path.@useordering error. The PostCSS plugin silencescolor-adjustwarnings.npx vite buildfailed due to a missing entry unrelated to these changes; SCSS-related errors no longer occur.