Skip to content

BUG: spurious deprecation warnings in scss code #979

@arikorn

Description

@arikorn

Compiling Sass code that uses CoreUI emits "deprecation warnings" for alert-variant() and avatar() mixins even if the code isn't used.

Steps to reproduce:

  1. import coreui in a scss file. For example: @use '@coreui/coreui/scss/coreui'
  2. Compile with Sass

The solution is to move the deprecation @include inside the css rule: the warning is then only emitted if the deprecated mixin is used. I will submit a PR shortly.

Sample output (Bitfocus Companion webui compilation):

transforming (1684) ../node_modules/lodash-es/_copySymbols.jsWarning: alert-variant() has been deprecated as of v4.3.0. It will be removed entirely in v6.0.0.
../../../@coreui/coreui/scss/mixins/_deprecate.scss 10:5 deprecate()
../../../@coreui/coreui/scss/mixins/_alert.scss 4:1 @forward
../../../@coreui/coreui/scss/_mixins.scss 28:1 @forward
../../../@coreui/coreui/scss/coreui.scss 8:1 @use
../../../../webui/src/scss/_variables.scss 9:1 @use
../../../../webui/src/App.scss 3:1 root stylesheet

Warning: avatar() has been deprecated as of v5.1.0. It will be removed entirely in v6.0.0.
../../../@coreui/coreui/scss/mixins/_deprecate.scss 10:5 deprecate()
../../../@coreui/coreui/scss/mixins/_avatar.scss 4:1 @forward
../../../@coreui/coreui/scss/_mixins.scss 29:1 @forward
../../../@coreui/coreui/scss/coreui.scss 8:1 @use
../../../../webui/src/scss/_variables.scss 9:1 @use
../../../../webui/src/App.scss 3:1 root stylesheet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions