feat: replace scss imports with @use#615
Conversation
Summary of ChangesHello @Franiac, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request modernizes the project's SCSS codebase by migrating from the deprecated Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request modernizes the SCSS by replacing the @import rule with @use. While this is a good practice for SCSS files, I've noticed that @use has been incorrectly applied to plain CSS files. The @use rule is specifically for Sass files; for CSS files, the standard @import should be used. I've provided suggestions to correct this in the relevant files.
87a18c5 to
387cbe2
Compare
spike-rabbit
left a comment
There was a problem hiding this comment.
Thanks a lot for your contribution 🚀 , and sorry for the long response time. I was recently very busy with our main project.
spike-rabbit
left a comment
There was a problem hiding this comment.
Code is perfect 💯 .
Can you please squash all your commits into one.
Since you renamed one variable please also add a breaking change note. We anyway will do a major release soon so the breaking change is not a problem.
I think we should actually use a feat instead of fix. It is not really a bug you are fixing here.
In case you don't write to write the message on your own, just copy mine:
feat: replace scss @import with @use
BREAKING CHANGE: $disable-row-text-color scss variable was renamed to $datatable-disable-row-text-color. This only affects the material and bootstrap theme.
spike-rabbit
left a comment
There was a problem hiding this comment.
After seeing the compiler error, maybe just convert rows.scss and / ghost.scss to mixins/functions. Then they can also be properly scoped for a theme.
|
Did the mixin thing, looks way cleaner (no double variable declarations) and works. I hope I did that correctly. I also renamed a second variable Since I merged main into my branch between the commits to be up2date, I cannot squash my commits. I recommend just squashing when merging the PR, that should then work. And I just want to thank you for maintaining the project. I updated a very old Angular 8 app to 21, updated from swimlane/ngx-datatable to siemens and it just worked. I am super happy about it because first I looked at swimlane, realized it is abandoned and thought "shit, I have to replace the entire datatable component". You saved me a lot of work. |
4200a17 to
e669198
Compare
|
Seem like this actually changed some styling. In case you did not figure out already: Then you can server the PW report with Haha, we had basically the same issue as you with the swimlane version. In general we plan to also go beyond basic maintenance and really fix some annoying issues. |
|
I have to do some debugging to see what's causing the differences. Looks like a slight change in font color in the paging part. |
|
I figured it out and relized an extremely dangerous thing that the current e2e test would not even catch: I changed Like we attempred with ghost.scss and rows.scss we would need to go with: So basically I would have destroyed every custom theme that users defined in styles.scss. I really really dislike the !default approach and I think I now know why I never saw it before in my life (I am a 41 year old dev, so I saw "some" stuff). I am switching more and more towards CSS variables because those can be also set at runtime which is a major benefit over compiled SCSS variables. So what do you think? I mean it wouldn't be a big thing to include all the variables in the Maybe we should introduce an e2e test that builds a user-theme that defines some variables in |
|
I checked the docs again and found this: https://siemens-com.gitbook.io/ngx-datatable/readme/themes So basically that tells users to theme their tables with the mentioned CSS classes, not by overriding SCSS variables, which makes the whole !default declarations irrelevant. Nobody would go into the material.scss in order to get a list of SCSS variables to override and theme their table that way. So a very basic question would be: Do we really need |
|
The theming is one of the things which will get some changes. At least for our theme we had to do a lot of deep overrides which we want to replace. But I think for now just marginal changes are fine. Removing Once we started working on a theming overhaul, we will also introduce proper testing. But for now getting rid of the compiler warnings is fine. |
spike-rabbit
left a comment
There was a problem hiding this comment.
I guess since those are anyway mixins you can move them inside the "theme".
Please do the same for the ghost ones as well. I guess after that one I can merge.
|
We should be good now 😄 |
BREAKING CHANGE: Renamed SCSS variables: - `$disable-row-text-color` to `$datatable-disable-row-text-color` - `$datatble-ghost-cell-animation-duration` to `$datatable-ghost-cell-animation-duration` This only affects the material and bootstrap theme.
5a4b578 to
30dcb7f
Compare
spike-rabbit
left a comment
There was a problem hiding this comment.
Thank you a lot again ❤️ . Now everything should be fine. I just squashed your commits and will merge them now.
|
Well, that took way more effort than I anticipated 😄 But I am glad the project exists and I can help. There are several compile warnings still. I'll take a look at those, too. |
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
Issue #613
What is the new behavior?
@useinstead of@importfor scss referencesindex.cssdoes not exist anymoreDoes this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications:
Both changes only affect the material and bootstrap theme.
Other information: