TrestleAdmin / trestle

A modern, responsive admin framework for Ruby on Rails
https://trestle.io
GNU Lesser General Public License v3.0
1.97k stars 177 forks source link

Fix deprecation warnings in Sass build #505

Closed spohlenz closed 2 months ago

spohlenz commented 2 months ago

Previous warnings:

WARNING in ./frontend/css/index.scss (./frontend/css/index.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./frontend/css/index.scss)
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 13, column 21 of file:///Users/sam/Projects/Trestle/trestle/frontend/css/core/_theme.scss:13:21:
hue() is deprecated. Suggestion:

color.channel($color, "hue", $space: hsl)

More info: https://sass-lang.com/d/color-functions

13 |     --#{$color}-h: #{hue($value)};

frontend/css/core/_theme.scss 14:22  @import
frontend/css/index.scss 59:9         root stylesheet

 @ ./frontend/css/index.scss
 @ ./frontend/index.js 2:0-26

WARNING in ./frontend/css/index.scss (./frontend/css/index.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./frontend/css/index.scss)
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 14, column 21 of file:///Users/sam/Projects/Trestle/trestle/frontend/css/core/_theme.scss:14:21:
saturation() is deprecated. Suggestion:

color.channel($color, "saturation", $space: hsl)

More info: https://sass-lang.com/d/color-functions

14 |     --#{$color}-s: #{saturation($value)};

frontend/css/core/_theme.scss 15:22  @import
frontend/css/index.scss 59:9         root stylesheet

 @ ./frontend/css/index.scss
 @ ./frontend/index.js 2:0-26

WARNING in ./frontend/css/index.scss (./frontend/css/index.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./frontend/css/index.scss)
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 15, column 21 of file:///Users/sam/Projects/Trestle/trestle/frontend/css/core/_theme.scss:15:21:
lightness() is deprecated. Suggestion:

color.channel($color, "lightness", $space: hsl)

More info: https://sass-lang.com/d/color-functions

15 |     --#{$color}-l: #{lightness($value)};

frontend/css/core/_theme.scss 16:22  @import
frontend/css/index.scss 59:9         root stylesheet

 @ ./frontend/css/index.scss
 @ ./frontend/index.js 2:0-26

WARNING in ./frontend/css/index.scss (./frontend/css/index.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./frontend/css/index.scss)
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 20, column 4 of file:///Users/sam/Projects/Trestle/trestle/frontend/css/components/_scopes.scss:20:4:
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

20 |     background: #fafafa;

frontend/css/components/_scopes.scss 21:5  @import
frontend/css/index.scss 48:9               root stylesheet

 @ ./frontend/css/index.scss
 @ ./frontend/index.js 2:0-26

WARNING in ./frontend/css/index.scss (./frontend/css/index.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./frontend/css/index.scss)
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 20, column 4 of file:///Users/sam/Projects/Trestle/trestle/frontend/css/components/_scopes.scss:20:4:
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

20 |     background: #fafafa;

frontend/css/components/_scopes.scss 21:5  @import
frontend/css/index.scss 48:9               root stylesheet

 @ ./frontend/css/index.scss
 @ ./frontend/index.js 2:0-26
coveralls commented 2 months ago

Coverage Status

coverage: 91.41%. remained the same when pulling e1cee8c4e76f4dbb53f3c5158fe8e81e9690250c on sass-deprecation-warnings into 88198cef7dadf428c3985a97774055e296d22d10 on main.