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

Drop node-sass support #41112

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Dec 19, 2024

Warning

This PR is heavily draft. It prepares the modifications for when we'll drop node-sass support

Description

This PR drops node-sass support.
Thanks to this drop, we can also make modifications to remove the deprecation warning from the recent Dart Sass versions.

Sub-tasks

  • Drop dedicated node-sass GitHub workflow
  • Replace RGBA with rgba
  • Bump sass → 1.79.x
    • Deprecation Warning: blue() is deprecated. Suggestion: color.channel($color, "blue", $space: rgb) More info: https://sass-lang.com/d/color-functions (same thing for red() and green()) → 1816145
  • Bump sass → 1.80.x
  • Bump sass → 1.81.x
  • Bump sass → 1.82.x
  • Bump sass → 1.83.x
  • Check the diff between dist/css/bootstrap.css from the main branch and this one

  • Check if we need to do something about rfs repository (and vendor dir here)

  • Hugo documentation build

    The transpiler to use, either libsass (default) or dartsass
    See https://gohugo.io/hugo-pipes/transpile-sass-to-css/#dart-sass

    See also TESTING Docs: switch to dart sass #39700

    • Make it work locally (macOS)
    • Make it work with Netlify
  • Check the documentation to remove node-sass specific content (if any)

  • Add somewhere in the documentation that Bootstrap doesn't support node-sass anymore

  • After the merge of this PR, update the examples repository

Type of changes

  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • (N/A) I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

Closes #40962
Closes #40849

@julien-deramond julien-deramond force-pushed the main-jd-drop-node-sass-support branch from 898c14a to 1816145 Compare December 19, 2024 09:35
@julien-deramond julien-deramond force-pushed the main-jd-drop-node-sass-support branch from 1816145 to f232df5 Compare December 19, 2024 13:59
@@ -46,7 +46,7 @@
}
}
@include color-mode(dark, true) {
--custom-color: #{mix($indigo, $blue, 50%)};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the mix($indigo, $blue, 50%) because color.mix($indigo, $blue, 50%) doesn't return a value as an hex string, but a color that should be transformed to a hex string. I don't think it's necessary to add such complexity for now. Let's see at the end of the PR if we reintroduce something like that.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the mix($indigo, $blue, 50%) is not appropriate in this as css and bootstrap has feature of colour-mix which include the change or mix in colour using hex string but you can't use colour.mix to change colour into hex string

@@ -75,7 +75,7 @@
"js-test-jquery": "cross-env JQUERY=true npm run js-test-karma",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel js-lint css-lint lockfile-lint",
"docs": "npm-run-all docs-build docs-lint",
"docs-build": "hugo --cleanDestinationDir --printUnusedTemplates",
"docs-build": "PATH=$(npm config get prefix)/bin:$PATH hugo --cleanDestinationDir --printUnusedTemplates",
Copy link
Member Author

@julien-deramond julien-deramond Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change the path because, otherwise, hugo (via the npm command) will use the sass binary installed from our package.json that doesn't support sass --embedded -> sass --embedded is unavailable in pure JS mode..
Following https://gohugo.io/functions/resources/tocss/#dart-sass, I've installed on my computer sass that supports sass --embedded so the script must use this version instead of the one in node_modules/.bin.
This temp solution makes it work when running npm run docs and npm run start locally on macOS after having installed globally sass with brew install sass/sass/sass.

If there's no other solution, we might need to modify the contributing guidelines to add this extra step and link to https://gohugo.io/functions/resources/tocss/#installing-in-a-development-environment

@julien-deramond julien-deramond force-pushed the main-jd-drop-node-sass-support branch from 906f9b8 to 8ec183e Compare December 22, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dart-sass 1.80.0+ throwing a lot of deprecations New deprecations in Sass 1.79
2 participants