-
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
Switch from @import to @use #7157
Conversation
Generate changelog in
|
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.
Hey @justinbhopper, thanks for re-introducing this! After a more thorough review, it looks like we still need to address some stylistic changes to elevation styles. Otherwise, the remainder here looks good, and I can approve once we address fixing the elevation classes.
@@ -1,8 +1,8 @@ | |||
// Copyright 2015 Palantir Technologies, Inc. All rights reserved. | |||
// Licensed under the Apache License, Version 2.0. | |||
|
|||
@import "color-aliases"; | |||
@import "mixins"; |
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.
It looks like updating @import "mixins"
here causes the border-shadow
mixin to not be available in certain component style files. Particularly, it causes the elevation shadows on Cards and wherever else we use the elevation classes specifically to become malformed.
Before | After |
---|---|
![]() |
![]() |
Before | After |
---|---|
![]() |
![]() |
/* `border-shadow` mixin appears in compiled CSS */
.bp5-elevation-4 {
box-shadow: border-shadow(.1), 0 4px 8px rgba(17, 20, 24, .2), 0 18px 46px 6px rgba(17, 20, 24, .2);
}
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.
@ggdouglas Great catch! Somehow, I missed this function usage.
In order to solve this, I had to remove the usage of border-shadow
in _variables.css
. This is because we can't import a reference to _mixins.scss
in this file without creating a circular dependency loop. Since border-shadow
is pretty straight forward, I figured it would be fine.
I triple-checked all the other functions and I feel pretty confident this was the only thing I missed. Famous last words? 🤣
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, I had also noticed the circular dependency between _variables.css
and _mixins.scss
. Substituting the mixin seems like a reasonable change to me. 👍
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.
Going to do one last visual regression pass here before merging, but generally this LGTM. Thanks for tackling this! 🙂
Fixes #7031
This PR re-introduces the changes from #7074 and includes fixes to issues mentioned in #7154.
In the original PR, some imports were missed for function calls in a few places. SASS compile did not complain because I guess it assumes they might be native CSS functions.
I have double-checked all function usage to make sure no other imports were missing, and I've compared the results of the docs-app locally to make sure the issues shown in #7154 are resolved.
cc: @ggdouglas
Checklist