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

[DataGrid] Replace style-components with @material-ui/styles #168

Merged
merged 31 commits into from Sep 10, 2020

Conversation

dtassone
Copy link
Member

@dtassone dtassone commented Aug 13, 2020

@dtassone dtassone marked this pull request as draft August 13, 2020 16:56
babel.config.js Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Please, only use @material-ui/core/styles until we refactor the styling approach, in v5. This disqualifies CSS modules as a viable option for v4 and until we figure that out.

@oliviertassinari oliviertassinari added the component: data grid This is the name of the generic UI component, not the React module! label Aug 13, 2020
@oliviertassinari oliviertassinari changed the title [CSS-Modules] Remove style-components, add css modules [DataGrid] Remove style-components, add css modules Aug 13, 2020
@dtassone dtassone marked this pull request as ready for review September 7, 2020 15:18
…tStyles.ts

Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

A first pass at the review

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

A summary of the propose changes:

  • Flatten CSS specificity as much as possible: make overrides easier.
  • Use unitless when possible: won't make a large difference, only to match current coding style.
  • Remove blank lines: won't make a large difference, only to match the current coding style.
  • Use MuiDataGrid- to prefix all applied class names.
  • Use Mui- to prefix artificial pseudo-classes.
  • Hardcoded color prevent customization, e.g. dark theme.
  • Use theme.typography variants over cherry-picking values

@oliviertassinari oliviertassinari added the new feature New feature or request label Sep 8, 2020
@oliviertassinari
Copy link
Member

I have updated the pull request's description to link all the related issues to the pull request.

@oliviertassinari oliviertassinari changed the title [DataGrid] Remove style-components, add css modules [DataGrid] Replace style-components with @material-ui/styles Sep 8, 2020
@oliviertassinari oliviertassinari removed their assignment Sep 8, 2020
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Great progress :)! I have started to continue the pull request to match the style of https://material-ui.com/components/tables/#simple-table. I will finish tomorrow.

@oliviertassinari
Copy link
Member

@dtassone Could you double-check my changes? A couple of things we can still do to improve the UI:

  1. Update the docs configuration to use @material-ui/core v4, not v5. I haven't looked where this happens with the documentation. It would fix:

Capture d’écran 2020-09-10 à 14 09 27

Capture d’écran 2020-09-10 à 14 09 21

  1. I think that we will need to push the reflection further on what's the correct behavior for the focus-visible/outline.

@dtassone
Copy link
Member Author

@dtassone Could you double-check my changes? A couple of things we can still do to improve the UI:

  1. Update the docs configuration to use @material-ui/core v4, not v5. I haven't looked where this happens with the documentation. It would fix:
Capture d’écran 2020-09-10 à 14 09 27 Capture d’écran 2020-09-10 à 14 09 21
  1. I think that we will need to push the reflection further on what's the correct behavior for the focus-visible/outline.

I don't think it's ideal to work on the same PR. It's not easy to see what has changed and understand why it has. It would have been better to create a feature branch on upstream and iterate on this one.

AFAIK we were using material ui core 4.

Not sure what happened with the number and the sort icon

@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 10, 2020

It would have been better to create a feature branch on upstream and iterate on this one.

I can still do that if you would like.

It's not easy to see what has changed and understand why it has

You can see the full diff along with detailed commits at 883c789...8640691.

Not sure what happened with the number and the sort icon

I have tried to explain it in the previous comment. It's an issue with the version imported of @material-ui/core (v4 on npm vs. v4 on git). It doesn't impact the end-user (outside of the documentation). We need to use the right version. I can work on it after.

@dtassone
Copy link
Member Author

dtassone commented Sep 10, 2020

It would have been better to create a feature branch on upstream and iterate on this one.

I can still do that if you would like.

Let's merge and create another PR for future changes

It's not easy to see what has changed and understand why it has

You can see the full diff along with detailed commits at 883c789...8640691.

I didn't know the trick! But not ideal to comment...

Not sure what happened with the number and the sort icon

I have tried to explain it in the previous comment. It's an issue with the version imported of @material-ui/core (v4 on npm vs. v4 on git). It doesn't impact the end-user (outside of the documentation). We need to use the right version. I can work on it after.

Hmm I see. I thought the component would use the npm modules, but if I understand well it uses the code in the repo, due to babel conf?

@dtassone dtassone merged commit 13b4a58 into mui:master Sep 10, 2020
@oliviertassinari
Copy link
Member

Let's merge and create another PR for future changes

Ok!

I didn't know the trick! But not ideal to comment...

True, only work for small changes, I think that after +-100 it starts to be questionable.

Hmm I see. I thought the component would use the npm modules, but if I understand well it uses the code in the repo, due to babel conf?

It has something to do with using the docs components from the mono-repo. I can't tell without investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
2 participants