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

[DatePicker] Remove dead dom node #24162

Closed
damir-sirola opened this issue Aug 27, 2019 · 6 comments · Fixed by #24533
Closed

[DatePicker] Remove dead dom node #24162

damir-sirola opened this issue Aug 27, 2019 · 6 comments · Fixed by #24533
Assignees
Labels
component: date picker This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@damir-sirola
Copy link
Contributor

Unable to modify styling on MuiPickersDay because the Typography styling overrides it

Environment

Tech Version
@material-ui/pickers 3.2.4
material-ui 4.3.3
React 16.9.0
Browser N/A
Peer library N/A

Steps to reproduce

  1. Modify theme by setting some styling overrides for Typography body2
  2. Modify theme by setting some styling overrides for MuiPickersDay

For example

const overrides = {
    MuiTypography: {
        body2: {
            fontWeight: 300
        }
    }
    MuiPickerDay: {
        day: {
            fontWeight: 500
        }
    }
}

Expected behavior

I expect styling defined in MuiPickersDay override to be applied

Actual behavior

Styles specified in Typography are applied because they're stronger than MuiPickersDay.day

Live example

@MikaHamalainen

This comment has been minimized.

@mfferreira

This comment has been minimized.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 9, 2020

@damir-sirola Do you have a reproduction? I can't observe the issue. We can't help without.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 15, 2020

It seems that we can lighten the rendering of the day component:

diff --git a/packages/material-ui-lab/src/PickersDay/PickersDay.tsx b/packages/material-ui-lab/src/PickersDay/PickersDay.tsx
index e74ef05239..271e2563e8 100644
--- a/packages/material-ui-lab/src/PickersDay/PickersDay.tsx
+++ b/packages/material-ui-lab/src/PickersDay/PickersDay.tsx
@@ -62,9 +62,6 @@ export const styles = (theme: Theme) =>
         border: `1px solid ${theme.palette.text.secondary}`,
       },
     },
-    dayLabel: {
-      // need for overrides
-    },
     selected: {},
     disabled: {},
   });
@@ -236,7 +233,7 @@ const PickersDay = React.forwardRef(function PickersDay<TDate>(
       onClick={handleClick}
       {...other}
     >
-      <span className={classes.dayLabel}>{utils.format(day, 'dayOfMonth')}</span>
+      {utils.format(day, 'dayOfMonth')}
     </ButtonBase>
   );
 });

It will also help with mui/mui-x#4602.

Does anyone want to work on it? :)

@sebastian-budka-mir

This comment has been minimized.

@oliviertassinari oliviertassinari changed the title Typography styling is stronger than Picker styling overrides [DatePicker] Remove dead dom node Dec 28, 2020
@oliviertassinari oliviertassinari transferred this issue from mui/material-ui-pickers Dec 28, 2020
@oliviertassinari oliviertassinari added component: date picker This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. labels Dec 28, 2020
@mxsph
Copy link
Contributor

mxsph commented Jan 21, 2021

I've started to work on this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date picker This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants