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

[material-ui][breakpoints] Add ultra-wide breakpoint #42860

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

AlexJSully
Copy link

@AlexJSully AlexJSully commented Jul 6, 2024

Added an ultra-wide breakpoint to be used within the Material-UI . The uw (ultra-wide) breakpoint is set to 2560px.

The intent behind this new breakpoint is to enable the <Grid /> component to be more responsive on ultra-wide monitors. This provides a distinct layout experience for users with ultra-wide screens, different from the xl breakpoint.

The uw naming was chosen over xxl to maintain consistency with the two-letter format used for other breakpoints and to clearly distinguish it from the xl breakpoint.

@AlexJSully AlexJSully marked this pull request as ready for review July 6, 2024 02:11
@AlexJSully AlexJSully marked this pull request as draft July 6, 2024 02:13
@AlexJSully AlexJSully changed the title [material-ui][Breakpoints] Added ultra-wide breakpoint [material-ui] Added ultra-wide breakpoint Jul 6, 2024
@AlexJSully AlexJSully marked this pull request as ready for review July 6, 2024 02:34
@AlexJSully AlexJSully marked this pull request as draft July 6, 2024 16:01
@AlexJSully AlexJSully changed the title [material-ui] Added ultra-wide breakpoint [material-ui][breakpoints] Added ultra-wide breakpoint Jul 6, 2024
@AlexJSully AlexJSully marked this pull request as ready for review July 6, 2024 17:39
@aarongarciah aarongarciah changed the title [material-ui][breakpoints] Added ultra-wide breakpoint [material-ui][breakpoints] Add ultra-wide breakpoint Jul 8, 2024
@zannager zannager added component: Grid The React component. package: material-ui Specific to @mui/material labels Jul 8, 2024
@zannager zannager requested a review from siriwatknp July 8, 2024 13:53
@AlexJSully
Copy link
Author

AlexJSully commented Jul 16, 2024

Note

This comment is out of date, please see comment below

Hi @siriwatknp & @brijeshb42 (sorry if tagged wrong people, just look at Git file history). I have a question regarding the Pigment CSS package which is causing this PR to fail in the CI / test-dev.

Essentially, the <Hidden /> component in the HiddenCss from PigmentHidden.tsx is grabbing the breakpoint from the Pigment-CSS package over the local breakpoint that I've updated with the new uw breakpoint.

Error:

  Error: src/PigmentHidden/PigmentHidden.tsx(173,11): error TS2769: No overload matches this call.
    Overload 1 of 2, '(props: PolymorphicComponentProps<HiddenBaseProps, undefined, object>): Element', gave the following error.
      Type '{ children?: ReactNode; implementation?: "js" | "css" | undefined; initialWidth?: Breakpoint | undefined; lgDown?: boolean | undefined; lgUp?: boolean | undefined; ... 11 more ...; className: string; }' is not assignable to type 'Omit<Substitute<HiddenBaseProps, object>, "as" | "component">'.
        Types of property 'only' are incompatible.
          Type 'import("/home/runner/work/material-ui/material-ui/packages/mui-system/src/createTheme/createBreakpoints").Breakpoint | import("/home/runner/work/material-ui/material-ui/packages/mui-system/src/createTheme/createBreakpoints").Breakpoint[] | undefined' is not assignable to type 'import("/home/runner/work/material-ui/material-ui/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@pigment-css/react/build/theme-DUGebxRn").a | import("/home/runner/work/material-ui/material-ui/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/no...'.
            Type '"uw"' is not assignable to type 'Breakpoint | Breakpoint[] | undefined'.
    Overload 2 of 2, '(props: HiddenBaseProps): ReactNode', gave the following error.
      Type '{ children?: ReactNode; implementation?: "js" | "css" | undefined; initialWidth?: Breakpoint | undefined; lgDown?: boolean | undefined; lgUp?: boolean | undefined; ... 11 more ...; className: string; }' is not assignable to type 'HiddenBaseProps'.
        Types of property 'only' are incompatible.
          Type 'import("/home/runner/work/material-ui/material-ui/packages/mui-system/src/createTheme/createBreakpoints").Breakpoint | import("/home/runner/work/material-ui/material-ui/packages/mui-system/src/createTheme/createBreakpoints").Breakpoint[] | undefined' is not assignable to type 'import("/home/runner/work/material-ui/material-ui/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@pigment-css/react/build/theme-DUGebxRn").a | import("/home/runner/work/material-ui/material-ui/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/no...'.
  buildTypes.mjs

I've tried to update the Pigment CSS package with the new uw breakpoint (draft PR #178) but that package depends on this package having the new breakpoint while this package depends on that package having the uw breakpoint which leads to a loop of each package depending on the other having this breakpoint, leading to this PR failing its CI build and the pigment CSS failing its unit tests.

Any advice on how to resolve this issue?

@AlexJSully
Copy link
Author

Hi @siriwatknp & @brijeshb42 . In hopes to fix the failing CI / test-dev, the following PR in pigment-css is created to hopefully address the above issue: #178

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 25, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 25, 2024
@siriwatknp
Copy link
Member

Thanks for submitting the PR. Even though this is a nice improvement but it comes with a cost for traversing the breakpoints especially in the sx prop.

This won't matter much with Pigment CSS integration but I'd hold this until v7 because ultra-wide customization is not a major use cases.

@siriwatknp siriwatknp added v7.x on hold There is a blocker, we need to wait package: system Specific to @mui/system and removed component: Grid The React component. package: material-ui Specific to @mui/material labels Aug 23, 2024
@AlexJSully
Copy link
Author

Thanks for submitting the PR. Even though this is a nice improvement but it comes with a cost for traversing the breakpoints especially in the sx prop.

This won't matter much with Pigment CSS integration but I'd hold this until v7 because ultra-wide customization is not a major use cases.

@siriwatknp Thank you for your feedback and considering the PR! I'm happy to keep this PR on hold until v7 and would be more than willing to help with any necessary adjustments or updates when you're ready to revisit this feature. Feel free to ping me whenever the time comes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold There is a blocker, we need to wait package: system Specific to @mui/system v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants