Skip to content

Fix dart sass 2 migration#2

Open
ashpsl wants to merge 5 commits intofoundation:masterfrom
ashpsl:fix-dart-sass-2-migration
Open

Fix dart sass 2 migration#2
ashpsl wants to merge 5 commits intofoundation:masterfrom
ashpsl:fix-dart-sass-2-migration

Conversation

@ashpsl
Copy link

@ashpsl ashpsl commented Feb 26, 2026

Key Changes

  1. Vendor Dependency Updates
    Sassy-Lists Compatibility: Patching the included sassy-lists vendor files to support Dart Sass 2. This includes adding @use sass:list and updating internal function calls to be module-aware.

  2. Sass Module System Migration
    Replaced @import with @use: Updated core components and settings files to use the Sass module system. This ensures better encapsulation and avoids global namespace pollution.
    Explicit Namespacing: Updated references to variables and mixins to use their respective namespaces (e.g., migrating from global access to util.rem-calc() or grid.$grid-column-count).

  3. Circular Dependency Resolution
    Math & Unit Modules: Resolved a circular dependency between the math and unit utility modules.
    Improved Math Calculations: Replaced deprecated division syntax with modern math functions (e.g., math.div logic) to ensure compatibility with Dart Sass 2's strict math rules.

  4. Namespace & Scoping Fixes
    Grid Module Scoping: Standardized the use of $grid-column-count within the grid modules. Fixed instances where row.$grid-column-count was incorrectly referenced instead of the local grid namespace.
    Private Variable Visibility: Refactored variables previously starting with a hyphen (e.g., $-zf-bp-value). In Dart Sass 2 modules, variables starting with - or _ are private and cannot be accessed across files or globally. These were updated to public variables where cross-module access was required.

  5. Syntax Modernization
    Wrapped specific styles in nested blocks where necessary to comply with new Sass nesting and scoping rules (e.g., flex-grid-column logic).

Testing Performed

I temporarily added @include foundation-everything; to the main file and ran the build with every possible combination of parameters for the foundation-everything mixin. The project now builds with zero errors and zero deprecation warnings under Dart Sass 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant