Skip to content

Deprecation Warning [color-functions]: color.red() is deprecated. #684

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

Open
siddhsql opened this issue Mar 1, 2025 · 0 comments
Open

Deprecation Warning [color-functions]: color.red() is deprecated. #684

siddhsql opened this issue Mar 1, 2025 · 0 comments

Comments

@siddhsql
Copy link

siddhsql commented Mar 1, 2025

i am trying to use the snackbar in my project. i copied over the styles at https://github.com/hperrin/svelte-material-ui/blob/master/packages/site/src/routes/demo/snackbar/_Colors.scss in my app (as i understand they are not included in the library - please correct me if i am wrong and don't need to define them in my app.scss). in my app.scss:

@use '@material/snackbar/mixins' as snackbar;

this gives me following warnings in sveltekit:

Deprecation Warning [color-functions]: color.red() is deprecated. Suggestion:

color.channel($color, "red", $space: rgb)

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

╷
44 │ $red: _linear-channel-value(color.red($color));
│ ^^^^^^^^^^^^^^^^^
╵
../../../@material/theme/_theme-color.scss 44:31 luminance()
../../../@material/theme/_theme-color.scss 54:13 contrast()
../../../@material/theme/_theme-color.scss 73:19 tone()
../../../@material/theme/_theme-color.scss 86:14 contrast-tone()
../../../@material/theme/_theme-color.scss 137:17 @use
../../../@material/theme/_theme.scss 32:1 @use
../../../@material/elevation/_elevation.scss 29:1 @use
../../../@material/button/_button-base.scss 26:1 https://github.com/forward
../../../@material/button/_button-theme.scss 23:1 @use
../../../@material/snackbar/_mixins.scss 25:1 @use
../../../../src/app.scss 5:1 root stylesheet

Deprecation Warning [color-functions]: color.green() is deprecated. Suggestion:

color.channel($color, "green", $space: rgb)

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

can anyone tell me how to fix them? thanks for your help.

EDIT: the real problem i am trying to solve is how to get the colored backgrounds with snackbar as illustrated in the demo in this page. i tried applying the demo-error class but it does not change the background color to red.

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

No branches or pull requests

1 participant