-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[node-build-scripts] feat: use non-legacy Sass compiler, remove node-sass #5904
Conversation
export svg inliner, remove math from variablesBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
@@ -46,11 +55,13 @@ $pt-font-size-large: $pt-grid-size * 1.6 !default; | |||
$pt-font-size-small: $pt-grid-size * 1.2 !default; | |||
|
|||
// a little bit extra to ensure the height comes out to just over 18px (and browser rounds to 18px) | |||
$pt-line-height: math.div($pt-grid-size * 1.8, $pt-font-size) + 0.0001 !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooc why did you have to drop the math.div
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get-sass-vars actually interprets and evaluates math for us (kind of surprising when you think about it). when I switched to postcss-simple-vars, we lost that evaluation step. But I think I can actually move back to get-sass-vars; see my other comment
@@ -2,7 +2,7 @@ | |||
// Licensed under the Apache License, Version 2.0. | |||
|
|||
@import "../../common/variables"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooc should these change to @use
at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, at some point...
@@ -54,7 +54,7 @@ Blueprint provides variables for colors in Sass, Less, and JavaScript. | |||
Example in Sass: | |||
|
|||
```scss | |||
@import "~@blueprintjs/core/lib/scss/variables"; | |||
@import "@blueprintjs/core/lib/scss/variables"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we be recommending @use "@blueprintjs/core/lib/scss/variables" as bp
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change the recommendation once we switch to @use
in this repo
export const DEFAULT_FLAG = "!default"; | ||
|
||
/** | ||
* Parses Sass source file contents for variables using "postcss-simple-vars" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on second thought, we might be able to stick with get-sass-vars instead of switching to this custom implementation. I think at some point during the long history of this PR, I got convinced that we had to migrate away from that library because of our custom functions, but I think it can continue to work for us. and it seems to be maintained well enough (last update was Jan 2023).
@@ -46,11 +55,13 @@ $pt-font-size-large: $pt-grid-size * 1.6 !default; | |||
$pt-font-size-small: $pt-grid-size * 1.2 !default; | |||
|
|||
// a little bit extra to ensure the height comes out to just over 18px (and browser rounds to 18px) | |||
$pt-line-height: math.div($pt-grid-size * 1.8, $pt-font-size) + 0.0001 !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get-sass-vars actually interprets and evaluates math for us (kind of surprising when you think about it). when I switched to postcss-simple-vars, we lost that evaluation step. But I think I can actually move back to get-sass-vars; see my other comment
Fix math referenceBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Fixes #5334
Changes proposed in this pull request:
This PR completely revamps the
sass-compile
script in@blueprintjs/node-build-scripts
:~
syntax for importing node modules (which seems to be webpack-specific via sass-loader), we now specify dart-sassincludePaths
to includenodes_modules
pathsThis will unblock upgrading to Node v19.x 🎉
Implementation notes
Not done in this PR
This PR does not migrate from Sass
@import
to@use
. That will happen in another PR.Reviewers should focus on:
No regressions in CSS APIs for the following components:
Screenshot