Skip to content

Dart Sass Compatibility #28

@vish288

Description

@vish288

I work on a project which recently migrated from node-sass to dart-sass for compilation and dart-sass doesn't like usage of !global and so there are warnings that prop up for using bem-constructor as follows.

DEPRECATION WARNING: As of Dart Sass 2.0.0, !global assignments won't be able to
declare new variables. Consider adding `$_bem-log: null` at the top level.


27 │ $_bem-log: () !global;
   │ ^^^^^^^^^^^^^^^^^^^^^

    node_modules/sass-bem-constructor/dist/_sass-bem-constructor.scss 27:1  @import
    src/client/scss/_import.scss 7:9                                   @import
    stdin 1:9                                                               root stylesheet

DEPRECATION WARNING: As of Dart Sass 2.0.0, !global assignments won't be able to
declare new variables. Consider adding `$_bem-current-context: null` at the top level.

   ╷
40 │ $_bem-current-context: () !global;
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
    node_modules/sass-bem-constructor/dist/_sass-bem-constructor.scss 40:1  @import
    src/client/scss/_import.scss 7:9                                   @import
    stdin 1:9                                                               root stylesheet

since the constructor is imported by every module as part of the base setup. This warning shows up twice per module in the project. ( so a looooottttt 🤕 ). Suggestions on fixing this would be welcome. I can submit an updated PR to replace them with null if that would solve the issue and make this repo in compliance with dart-sass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions