Comments (3)
@RyleySill93 have you checked the examples here https://mui.com/x/react-data-grid/style/#using-the-sx-prop? You can use the sx
prop to control the styling on various parts of the grid.
from mui-x.
@DanailH Yup - the problem is I'm dynamically applying styles using the getRowClassName
prop. So I can't just blanket override the Mui-hovered
class with backgroundColor: #fff
for example - I'm looking for Mui-hovered
and MuiDataGrid-row:hover
to have no effect.
The following almost works
"&.MuiDataGrid-root .MuiDataGrid-row:hover": {
backgroundColor: "inherit",
},
"&.MuiDataGrid-root .Mui-hovered": {
backgroundColor: "inherit",
},
But I get this behavior where the dynamically styled rows (getRowClassName
is returning a class which styles the rows with a darker background color) are overridden:
Screen.Recording.2023-11-02.at.2.54.44.PM.mov
This is the state when being hovered:
The effect I'm looking for is the styling of background-color: #f7f6f4
which is being applied by the MuiDataGrid-odd
class isn't overridden by the hover state.
from mui-x.
From the sound of it, this looks like a specific styling case you have, not a bug with the data grid itself. If it is the background you want to overwrite you can always set it to transparent
, not inherit. Also, I don't see what the problem is with overwriting the hover styles since you are already adding custom classes to the row via getRowClassName
.
from mui-x.
Related Issues (20)
- [data grid] Noisy warning, Accessing element.ref was removed in React 19 HOT 3
- [data grid] Detail panel for focused row is "sticky" when scrolling HOT 1
- [charts] Support multiple values for border radius on bar charts
- [pickers] Add a default AM or PM to the time picker HOT 3
- [data grid] Custom Columns: How to improve usability of the Date Picker in a narrow column HOT 6
- [data grid] Unable to override default props/styling for Header HOT 2
- [pickers][DatePicker] change borderRadius of selected day for dateCalendar HOT 10
- [charts] Can we have horizontal Gauge Chart? HOT 7
- [data grid] Row grouping does not work with nested row values HOT 10
- [data grid] Different field in view and edit mode cell HOT 2
- [data grid] GridToolbar filter 'is any of' selection is showing outlined input instead of regular input HOT 1
- [data grid] How to disable collapse button for DataGrid Master detail conditionally? HOT 8
- [charts] Improve interaction for mobile user
- [data grid] Use multiple tabs instead of package for mock data set HOT 1
- [data grid] consider providing defaults for rows and columns prop HOT 1
- [charts] Add keyboard navigation and support for screen readers
- [data grid] `isLastColumn` parameter is not set to `true` for last column when `disableVirtualization={true}` HOT 2
- [pickers][DateCalendar] Change months with custom header? HOT 2
- [pickers] DateTimePicker doesn't show time picker HOT 3
- [data grid] Export to Excel default Date format is "dd.mm.yyyy" and it's too difficult to override for the entire system HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mui-x.