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

[docs] Improve theme augmentation documentation #14115

Open
1 task done
MiguelG97 opened this issue Aug 5, 2024 · 8 comments
Open
1 task done

[docs] Improve theme augmentation documentation #14115

MiguelG97 opened this issue Aug 5, 2024 · 8 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature typescript

Comments

@MiguelG97
Copy link

MiguelG97 commented Aug 5, 2024

Latest version

  • I have tested the latest version

Steps to reproduce

Link to live example: (required)

Steps:
import { createTheme } from '@mui/material/styles';

const theme = createTheme({
  mixins: {
    MuiDataGrid: {
      // Pinned columns sections
      pinnedBackground: '#340606',
      // Headers, and top & bottom fixed rows
      containerBackground: '#343434',
    },
  },
});

The createTheme does not contain a field for MuiDataGrid

Current behavior

The createTheme does not contain a field for MuiDataGrid

Expected behavior

intellisense enable and field available

Context

import { createTheme } from '@mui/material/styles';

const theme = createTheme({
  mixins: {
    MuiDataGrid: {
      // Pinned columns sections
      pinnedBackground: '#340606',
      // Headers, and top & bottom fixed rows
      containerBackground: '#343434',
    },
  },
});

MuiDataGrid field is not enable nor available

Your environment

"@mui/material": "^5.16.6",
"@mui/styled-engine-sc": "^6.0.0-alpha.18",
"@mui/x-data-grid": "^7.12.0",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",

Search keywords: MuiDataGrid

@MiguelG97 MiguelG97 added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 5, 2024
@github-actions github-actions bot added the component: data grid This is the name of the generic UI component, not the React module! label Aug 5, 2024
@MiguelG97
Copy link
Author

MiguelG97 commented Aug 5, 2024

apparently doing this import fixed the issue:

import type {} from "@mui/x-data-grid/themeAugmentation";

reference:
https://stackoverflow.com/questions/69608945/fix-typescript-error-when-customizing-muidatagrid-in-createtheme

However, I don't think we should need to do that extra step as is either not documented

@oliviertassinari
Copy link
Member

It's about https://mui.com/x/react-data-grid/getting-started/#typescript?

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 5, 2024

Actually, per mui/material-ui#40996, I think that we should update the docs in MUI X and remove all mentions of TypeScript v3: https://github.com/search?q=org%3Amui+%22TypeScript+3.x%22&type=code.

Seeing this:

SCR-20240805-unot

triggered me.

Moved to #14239

@flaviendelangle
Copy link
Member

If someone changes how we phrase the theme augmentation, please do the same for the other X components 🙏

@michelengelen michelengelen changed the title MuiDataGrid - createTheme intellisense [data grid] createTheme intellisense Aug 6, 2024
@michelengelen
Copy link
Member

I'll add this to the board, so we don't lose track of this!
@samuelsycamore FYI

@michelengelen michelengelen added docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer bug 🐛 Something doesn't work labels Aug 6, 2024
Copy link

github-actions bot commented Aug 6, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@MiguelG97: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@MiguelG97
Copy link
Author

MiguelG97 commented Aug 6, 2024

I see, my bad.
I believe it would help if you guys include this:
https://mui.com/x/react-data-grid/getting-started/#typescript

in the "datagrid > style" section too

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 6, 2024

I believe it would help if you guys include this:

https://mui.com/x/react-data-grid/style/#theme-header-and-pinned-sections right, yeah, this sounds wise 👍. I think that we can consider this the root problem. So updating this docs to also cover TypeScript should do it.

@LukasTy LukasTy changed the title [data grid] createTheme intellisense [docs] Improve theme augmentation documentation Sep 3, 2024
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! docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature typescript
Projects
None yet
Development

No branches or pull requests

4 participants