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

Fix SASS warnings due to deprecated functions #6839

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Nov 4, 2024

Migrate from SASS' global darken function, which is deprecated, to the sass:color's module color.adjust function.

This solves two warnings reported by SASS:

DEPRECATION WARNING: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use color.adjust instead.

More info and automated migrator: https://sass-lang.com/d/import

   ╷
28 │ $link-hover-color: darken($link-color, 15%);
   │                    ^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
    lms/static/styles/moodle_pages/moodle_pages.scss 28:20  root stylesheet

DEPRECATION WARNING: darken() is deprecated. Suggestions:

color.scale($color, $lightness: -30%)
color.adjust($color, $lightness: -15%)

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

   ╷
28 │ $link-hover-color: darken($link-color, 15%);
   │                    ^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
    lms/static/styles/moodle_pages/moodle_pages.scss 28:20  root stylesheet

The migration from darken to color.adjust is documented here https://sass-lang.com/documentation/modules/color/#darken. I used that to decide what parameters to pass to color.adjust.

@acelaya acelaya merged commit 0e99465 into main Nov 5, 2024
9 checks passed
@acelaya acelaya deleted the sass-warnings branch November 5, 2024 09:22
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

Successfully merging this pull request may close these issues.

2 participants