Skip to content
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

SASS deprecation warnings with version 1.77.7 - Mixed declarations #40621

Closed
3 tasks done
apepper opened this issue Jul 10, 2024 · 11 comments · Fixed by #40623
Closed
3 tasks done

SASS deprecation warnings with version 1.77.7 - Mixed declarations #40621

apepper opened this issue Jul 10, 2024 · 11 comments · Fixed by #40623

Comments

@apepper
Copy link

apepper commented Jul 10, 2024

Prerequisites

Describe the issue

Using the latest version of the sass package (1.77.7) there are deprecation warnings by sass. The previous sass version 1.77.6 worked fine.

Reduced test cases

  • Upgrade sass (npm i sass@latest)
  • Execute npm run css-compile

Expected:

npm run css-compile

> bootstrap@5.3.3 css-compile
> sass --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/

Actual:

npm run css-compile

> bootstrap@5.3.3 css-compile
> sass --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> scss/_reboot.scss
503 │     font-weight: $legend-font-weight;
    │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> scss/vendor/_rfs.scss
136 │ ┌     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
137 │ │       @content;
138 │ │     }
    │ └─── nested rule
    ╵
    scss/_reboot.scss 503:3          @import
    scss/bootstrap-reboot.scss 10:9  root stylesheet

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> scss/_reboot.scss
504 │     line-height: inherit;
    │     ^^^^^^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> scss/vendor/_rfs.scss
136 │ ┌     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
137 │ │       @content;
138 │ │     }
    │ └─── nested rule
    ╵
    scss/_reboot.scss 504:3          @import
    scss/bootstrap-reboot.scss 10:9  root stylesheet

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> scss/_reboot.scss
503 │     font-weight: $legend-font-weight;
    │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> scss/vendor/_rfs.scss
136 │ ┌     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
137 │ │       @content;
138 │ │     }
    │ └─── nested rule
    ╵
    scss/_reboot.scss 503:3   @import
    scss/bootstrap.scss 16:9  root stylesheet

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> scss/_reboot.scss
504 │     line-height: inherit;
    │     ^^^^^^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> scss/vendor/_rfs.scss
136 │ ┌     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
137 │ │       @content;
138 │ │     }
    │ └─── nested rule
    ╵
    scss/_reboot.scss 504:3   @import
    scss/bootstrap.scss 16:9  root stylesheet

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> scss/_type.scss
38  │       font-family: $display-font-family;
    │       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> scss/vendor/_rfs.scss
136 │ ┌     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
137 │ │       @content;
138 │ │     }
    │ └─── nested rule
    ╵
    scss/_type.scss 38:5      @import
    scss/bootstrap.scss 17:9  root stylesheet

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> scss/_type.scss
39  │       font-style: $display-font-style;
    │       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> scss/vendor/_rfs.scss
136 │ ┌     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
137 │ │       @content;
138 │ │     }
    │ └─── nested rule
    ╵
    scss/_type.scss 39:5      @import
    scss/bootstrap.scss 17:9  root stylesheet

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> scss/_type.scss
40  │       font-weight: $display-font-weight;
    │       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> scss/vendor/_rfs.scss
136 │ ┌     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
137 │ │       @content;
138 │ │     }
    │ └─── nested rule
    ╵
    scss/_type.scss 40:5      @import
    scss/bootstrap.scss 17:9  root stylesheet

Warning: 22 repetitive deprecation warnings omitted.
Run in verbose mode to see all warnings.

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

No response

What version of Bootstrap are you using?

Latest main branch

@ajiho
Copy link

ajiho commented Jul 10, 2024

I have also encountered this issue. My project, or adminlte, also requires some scss files that rely on bootstrap. If you want to eliminate this warning, I asked if you should release bootstrap 5.3.4 so that we can obtain scss files without warnings?

@martn001
Copy link

martn001 commented Jul 12, 2024

I have encountered the same issues with my Vue/Vuetify project. Currently, I am receiving more then 60 different deprecation warnings for the latest version of the Vuetify package ^3.6.12. 😅

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

  ┌──> node_modules/vuetify/lib/styles/tools/_typography.sass
3 │     font-weight: $font-weight
  │     ^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
  ╵
  ┌──> node_modules/vuetify/lib/styles/tools/_position.sass
3 │ ┌     &--#{$position}
4 │ │       position: #{$position} if($important, !important, null)
  │ └─── nested rule
  ╵
    node_modules/vuetify/lib/styles/tools/_typography.sass 3:3           typography()
    node_modules/vuetify/lib/components/VSystemBar/VSystemBar.sass 23:5  @content
    node_modules/vuetify/lib/styles/tools/_layer.scss 9:5                layer()
    node_modules/vuetify/lib/components/VSystemBar/VSystemBar.sass 4:1   @use
    plugin-vuetify:components/VSystemBar/VSystemBar.sass 2:1            root stylesheet

@euro
Copy link

euro commented Jul 12, 2024

FYI 1.77.8 of Dart Sass is out.
https://github.com/sass/dart-sass/releases/tag/1.77.8

@tang2087
Copy link

Getting same warning for my Nuxt project.

@Asmmmir
Copy link

Asmmmir commented Jul 13, 2024

I got latest version of bootstrap, but I still got warnings

schu added a commit to openmultiplechoice/openmultiplechoice that referenced this issue Jul 13, 2024
`npm build` currently shows the deprecation warning below, which is about to be
fixed in Bootstrap upstream, i.e. it should be gone with one of the next
updates.

twbs/bootstrap#40621

```
Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> node_modules/bootstrap/scss/_type.scss
38  │       font-family: $display-font-family;
    │       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> node_modules/bootstrap/scss/vendor/_rfs.scss
136 │ ┌     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
137 │ │       @content;
138 │ │     }
    │ └─── nested rule
    ╵
    node_modules/bootstrap/scss/_type.scss 38:5      @import
    node_modules/bootstrap/scss/bootstrap.scss 17:9  @import
    resources/scss/app.scss 15:9                     root stylesheet
```
@dkrnl
Copy link

dkrnl commented Jul 14, 2024

npm i sass@1.77.6 --save-exact

@du-disk
Copy link

du-disk commented Jul 14, 2024

i found same issue, how to fix please

@bobitza
Copy link

bobitza commented Jul 15, 2024

i found same issue, how to fix please

npm i sass@1.77.6 --save-exact

It's worked

@cotiga
Copy link

cotiga commented Jul 24, 2024

While waiting a fix... Edit the line in "package.json"
"sass": "^1.74",
by :
"sass": "1.77.6",
and do :
npm update

tagliala added a commit to diowa/ruby3-rails7-bootstrap-heroku that referenced this issue Jul 27, 2024
tsukumijima added a commit to tsukumijima/KonomiTV that referenced this issue Jul 31, 2024
今回は ncu --target minor -x vue,vuetify,typescript,sass -u で (更新するとまずい問題が発生するライブラリを除外しつつ) まとめて更新した
sass は 1.77.7 以降大量の Deprecation Warning が出るようになってしまい使い物にならない…
ref: twbs/bootstrap#40621
@kejedi
Copy link

kejedi commented Jul 31, 2024

downgrading from 1.77.8 to 1.74 does not resolve the issue

y'all REALLY want me to use tailwind huh

Edit: npm i sass@1.77.6 --save-exact works.

seod0209 added a commit to seod0209/seod0209.github.io that referenced this issue Aug 1, 2024
- DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

- twbs/bootstrap#40621 (comment)
seod0209 added a commit to seod0209/seod0209.github.io that referenced this issue Aug 1, 2024
- master to main

fix: error
- DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

- twbs/bootstrap#40621 (comment)

fix: does not have an alt attribute

feat: edit image route
seod0209 added a commit to seod0209/seod0209.github.io that referenced this issue Aug 1, 2024
- master to main

fix: error
- DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

- twbs/bootstrap#40621 (comment)

fix: does not have an alt attribute

feat: edit image route

feat: revert to master branch in ci

feat: edit git ignore
EGRrqq added a commit to protyagov/martspec that referenced this issue Aug 7, 2024
cause @latest(5.3.3) bootstrap doesnt support
breaking changes in sass 1.77.7 and 1.77.8
twbs/bootstrap#40621 (comment)
@jdavidbakr
Copy link

The issue appears to throw warnings but still builds for me ... but warnings are never fun to have. Hoping this gets an update soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.