-
Notifications
You must be signed in to change notification settings - Fork 30
Migrate dart-sass to modern Sass #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modernizes the Solid CSS framework by migrating from the deprecated node-sass to dart-sass (v1.97.0), implementing the modern Sass module system (@use/@forward instead of @import), and replacing the Grunt build system with npm scripts. This is a major version bump to 3.0.0 due to breaking changes in the Sass module system.
Key changes:
- Build tooling: Replaced Grunt + 7 plugins with npm scripts + Sass CLI + LightningCSS, reducing dependencies by 98% (370 → 21 packages) and eliminating 42 security vulnerabilities
- Sass modernization: Converted all files to use
@use/@forwardmodule system and replaced deprecated Sass functions (darken/lighten → color.adjust, / division → math.div, percentage → math.percentage, map-get → map.get) - Package improvements: Added modern exports configuration, .editorconfig, .nvmrc, enhanced keywords, and comprehensive CHANGELOG.md
Reviewed changes
Copilot reviewed 50 out of 52 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Major version bump, replaced node-sass with sass 1.97.0, removed Grunt dependencies, added new npm build scripts, enhanced package metadata |
| package-lock.json | New lockfile with minimal modern dependencies (21 vs 370 packages) |
| npm-shrinkwrap.json | Removed legacy shrinkwrap file |
| Gruntfile.js | Removed Grunt build configuration |
| CHANGELOG.md | Added comprehensive changelog following Keep a Changelog format |
| .nvmrc | Added Node version pinning (v22) |
| .editorconfig | Added editor configuration for consistent code style |
| .npmignore | Updated to use modern file exclusion patterns |
| _lib/solid.scss | Changed from @import to @forward for main entry point |
| _lib/*-helpers.scss | Converted aggregator files to use @forward instead of @import |
| _lib/*-utilities.scss | Converted aggregator files to use @forward instead of @import |
| _lib/*-components.scss | Converted aggregator files to use @forward instead of @import |
| _lib/*-base.scss | Converted aggregator files to use @forward instead of @import |
| _lib/solid-helpers/_mixins.scss | Added sass:map module, converted map-get/map-has-key to map.get/map.has-key, improved error messages |
| _lib/**/typography/*.scss | Added @use imports for solid-helpers, converted color functions |
| _lib/**/layout/*.scss | Added @use imports for solid-helpers |
| _lib/**/grid/*.scss | Added sass:math module, converted division and percentage functions |
| _lib/**/colors/*.scss | Added @use imports for solid-helpers |
| lib/solid-utilities/*.scss | Added @use imports, converted deprecated Sass functions (darken/lighten → color.adjust) |
| lib/solid-components/*.scss | Added @use imports, converted deprecated color functions, fixed indentation issues |
| lib/solid-base/*.scss | Added @use imports, converted deprecated color functions |
Files not reviewed (1)
- npm-shrinkwrap.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sehr1016
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid 👍
🚀 Migrate to Dart Sass and Modern Build System (v3.0.0)
Summary
This PR modernizes the Solid CSS framework by migrating from the deprecated node-sass to dart-sass, implementing the modern Sass module system, and replacing Grunt with npm scripts. This ensures compatibility with Node.js 22+ and eliminates all deprecation warnings.
🔴 Breaking Changes
@use/@forwardinstead of@import@usesyntax✨ What Changed
Dependencies
sass@1.97.0(dart-sass),lightningcss-cli@1.28.1node-sass,grunt,grunt-sass,grunt-dart-sass, all grunt pluginsSass Modernization
@import→@use/@forwardmodule systemsass:color,sass:map,sass:mathdarken()/lighten()→color.adjust($color, $lightness: ±X%)map-get()/map-has-key()→map.get()/map.has-key()/division →math.div()percentage()→math.percentage()Build System
Before: Grunt + 7 plugins + legacy Sass API
After: npm scripts + Sass CLI + LightningCSS
New Scripts:
Package Configuration
📊 Results
✅ Testing
📝 Migration Guide for Consumers
If you're using the pre-built CSS (most users):
No changes needed! Just update the package version.
If you're importing Sass files:
Before:
After:
If you're overriding variables:
Before:
After: