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

Deprecation warnings about SASS darken() #1541

Open
djvill opened this issue Sep 25, 2024 · 5 comments · May be fixed by #1548
Open

Deprecation warnings about SASS darken() #1541

djvill opened this issue Sep 25, 2024 · 5 comments · May be fixed by #1548
Labels
bug status: needs discussion Issues that need more discussion before they can be properly triaged.

Comments

@djvill
Copy link

djvill commented Sep 25, 2024

Describe the bug
When I build my site locally, I get deprecation warnings about SASS darken(). (See https://sass-lang.com/documentation/breaking-changes/color-functions/.) These warnings point to just-the-docs SASS files; none of my custom SASS files include darken().

To Reproduce
Steps to reproduce the behavior:

# Clone repo
git clone https://github.com/djvill/APLS
cd APLS
git checkout -b test 74b9e6b
# Install gems
echo 'source "https://rubygems.org"' > Gemfile ; echo 'gem "just-the-docs"' >> Gemfile
bundle install
# Switch from remote_theme for GitHub to theme for local
sed -i -e 's/remote_theme:/# remote_theme:/g' -e 's/# theme:/theme:/g' _config.yml
# Build locally
bundle exec jekyll serve

Site builds correctly, but bash output includes a whole bunch of deprecation warnings:

DEPRECATION WARNING: darken() is deprecated. Suggestions:

color.scale($color, $lightness: -5.7954545455%)
color.adjust($color, $lightness: -5%)

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

   ╷
58 │     background-color: darken(#dcdcdc, 5%);
   │                       ^^^^^^^^^^^^^^^^^^^
   ╵
    ..\..\..\..\just-the-docs-0.10.0\_sass\buttons.scss 58:23   @import
    modules.scss 11:9                                           @import
    C:\Users\DAV49\tmp\assets\css\just-the-docs-light.scss 6:9  root stylesheet
WARNING: 25 repetitive deprecation warnings omitted.

Expected behavior
Site builds locally without warnings.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10x64
  • Shell: GNU bash, version 5.2.26(1)-release
  • Browser: Chrome 129.0.6668.59 (Official Build) (64-bit) (cohort: Stable)

Additional context
This issue doesn't occur when I build the just-the-docs site locally, so it must be something with how my site is configured. It also didn't occur with just-the-docs version 0.7.0

@djvill djvill added the bug label Sep 25, 2024
@mattxwang
Copy link
Member

Hi @djvill, thanks for submitting an issue! I appreciate its thoroughness - makes it very easy to reproduce :)

To confirm, in a recent version of sass (1.79.0), they have deprecated the darken() function in favour of color.adjust or color.scale. We should make the switch over too, and I can cut a release shortly to do so.

In the meantime, if you urgently need to silence the deprecation warnings, your best bet is to freeze your sass version to 1.78.0 in your Gemfile.lock. I'll try to get another releaese out this weekend.

@djvill
Copy link
Author

djvill commented Sep 27, 2024

Thanks @mattxwang!

@peterennis
Copy link

just ran into this also:

peter@adaept:~/aesite$ gem info just-the-docs

*** LOCAL GEMS ***

just-the-docs (0.10.0)
    Authors: Patrick Marsceill, Matthew Wang
    Homepage: https://github.com/just-the-docs/just-the-docs
    License: MIT
    Installed at: /home/peter/gems

    A modern, highly customizable, and responsive Jekyll theme for
    documentation with built-in search.
peter@adaept:~/aesite$

image

@mattxwang mattxwang added the status: ready to implement Issues that can be actively worked on, and need an implementation! label Oct 9, 2024
@mattxwang mattxwang linked a pull request Oct 9, 2024 that will close this issue
@mattxwang
Copy link
Member

Ah - okay, slightly bad news. Users of the github-pages gem may not have access to the color module, since they don't use dart-sass. Here's the upstream issue: jekyll/jekyll#9686

I will have to think about a way to resolve this issue in the general case. I think it's unlikely I will push a fix very quickly (especially as my bandwidth has been awful recently). My suggestion is to either:

  • pin your version of sass-embedded to a version that doesn't have this warning (e.g. 1.78.0 downwards)
  • add to your _config.yml
sass:
  quiet_deps: true

Sorry for the confusion! Unfortunately, a general solution is slightly out of my hands unless we drop support for pages-gem. I'll keep this issue and the associated PR #1548 with my findings. Thanks!

@mattxwang mattxwang added status: needs discussion Issues that need more discussion before they can be properly triaged. and removed status: ready to implement Issues that can be actively worked on, and need an implementation! labels Oct 9, 2024
@djvill
Copy link
Author

djvill commented Oct 9, 2024

Hi @mattxwang, just following up to mention that pinning my sass-embedded to 1.78.0 (specifically for my system, 1.78.0-x64-mingw-ucrt) in Gemfile.lock did the trick for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: needs discussion Issues that need more discussion before they can be properly triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants