Comments (14)
You can also consider using more specific classes if you want more control over colors:
toolbar: {
sx: (theme) => ({
backgroundColor: "#455d7a",
color: theme.palette.info.main,
[`& .${pickersToolbarTextClasses.root}`]: {
color: theme.palette.info.main,
},
[`& .${pickersToolbarTextClasses.selected}`]: {
color: theme.palette.info.light,
},
}),
}
from mui-x.
got it ... here is an updated DEMO
Is this what you were looking for?
from mui-x.
To help us diagnose the issue efficiently, could you provide a stripped-down reproduction test case using the latest version? A live example would be fantastic! โจ
For your convenience, our documentation offers templates and guides on creating targeted examples: Support - Bug reproduction
Just a friendly reminder: clean, functional code with minimal dependencies is most helpful. Complex code can make it tougher to pinpoint the exact issue. Sometimes, simply going through the process of creating a minimal reproduction can even clarify the problem itself!
Thanks for your understanding! ๐๐ผ
from mui-x.
@michelengelen Thank you for your assistance. Here is the working example of what I did and what exactly I want.
https://codesandbox.io/p/sandbox/flamboyant-dubinsky-x3lvkn?file=%2Fsrc%2FDemo.tsx
from mui-x.
@michelengelen Exactly this is what I needed. Thank you very much for the help.
I have one more question like can I change the title to something else "Select date range" to something else?
from mui-x.
I don't think it is ... at the very least you would lose the ability to use translations ... @LukasTy is there a way to do this?
from mui-x.
@achoud444 Of course, all the labels are stored in the localization, which you can override.
For the picker toolbars, try specifying this on the LocalizationProvider
:
localeText={{
dateRangePickerToolbarTitle: "Root toolbar title",
}}
or on the Picker component if you want this change to apply to this specific Picker component:
localeText={{
toolbarTitle: "Picker toolbar title",
}}
from mui-x.
Awesome!!! Thank you very much both of you.
from mui-x.
I'm glad we could resolve your problems. ๐
I'm closing this issue as all the problems seem to have been resolved. ๐
P.S. Feel free to check the Translated components page and the linked translations interface for all available options.
from mui-x.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
@achoud444: 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.
from mui-x.
@LukasTy Right now the text is in Captial letters I want to make it in Small
What I can see ROOT TOOLBAR TITLE What I want
Root toolbar title`
localeText={{
dateRangePickerToolbarTitle: "Root toolbar title",
}}
from mui-x.
@achoud444 The uppercase style is coming from the Typography
component.
If you need to override this, try adding the following style to the toolbar.sx
:
[`> .${typographyClasses.root}`]: {
textTransform: "unset",
},
from mui-x.
@LukasTy @michelengelen I have a question if you can answer please
Is it better to use the sx property in MUI for styling components, or should I write the CSS in a separate file and override the CSS?
from mui-x.
Is it better to use the sx property in MUI for styling components, or should I write the CSS in a separate file and override the CSS?
@achoud444 I'd say that this is almost a "religious" question. ๐
If you prefer regular CSS declaration methodsโfeel free to use them, just be aware that you are responsible for adjusting classes if they ever change on the components. ๐
CSS-in-JS methods provide a more robust API and have the capability to purge unused properties (if you override the property, that is already set on a componentโit might be omitted in the final bundle).
You can learn about the performance topic of CSS-in-JS here.
Be aware that if a component is already styled
on our components, using sx will not impact the performance in a meaningful way, it's mostly a question for creating new components, where performance is better the closer we go to primitives.
P.S. MUI is working on Pigment CSS, which will mostly negate the performance problems, by extracting CSS at build time.
from mui-x.
Related Issues (20)
- [charts][docs] The AxisConfig API page is wrong
- [data grid] re-rendering / resetting filter on state change HOT 2
- [question] I am using the row grouping feature with mui premium. By default the total row count is calculated based on number of parent rows (top level rows). I need a way to set the page row count based on the number of child rows. Is there any way to do that? HOT 1
- Page row count to be set on child rows when row grouping is applied
- & .MuiDataGrid-columnHeaders is not working with @mui/x-data-grid-pro": ^7.1.1 HOT 1
- [charts] How to add min and max scaling on axis for bar charts to remove decimal scale values HOT 3
- DataGrid changing data is slow
- [question] How can i remove column sorting from datagridView ? (^6.19.6)
- MUI Datagrid sortComparator function signature is not available when using typescript
- [data grid] Row spanning with tree/grouping behavior HOT 1
- [charts] Pie chart overflow with legend HOT 5
- [data grid]: there is an issue with the design on the right side when dragging
- [data grid] When used Styled Datagrid, processRowUpdate does not fired.
- [charts] types not exported from ChartsTooltipTable HOT 7
- Leap year data grid date column filter cant be filled from left to right HOT 3
- [charts] Improve docs about how to pick the correct scaleType HOT 7
- [charts] Tooltips for points on the edge of the chart are not always shown with tooltip trigger item HOT 4
- X-Data-Grid-Pro/Premium Unusable with CDN HOT 1
- [fields] "Format" is still being used as MobileDatePicker input value, even after the dialog is closed HOT 1
- Y Axis Min/Max value breaks formatting 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.