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

[pigment-css][Grid] Spacing isn't working as expected #44042

Closed
Mike-Ro opened this issue Oct 8, 2024 · 6 comments
Closed

[pigment-css][Grid] Spacing isn't working as expected #44042

Mike-Ro opened this issue Oct 8, 2024 · 6 comments
Assignees
Labels
component: Grid The React component. package: pigment-css Specific to @pigment-css/*

Comments

@Mike-Ro
Copy link

Mike-Ro commented Oct 8, 2024

Steps to reproduce

Hi everyone!

I’m following the documentation here: https://mui.com/material-ui/migration/migrating-to-pigment-css/#migrating-layout-components, and I’ve written this code:

// src/app/page.js
import Grid from '@mui/material-pigment-css/Grid';

export default function page() {
  return (
    <Grid container spacing={2}>
      <Grid>1</Grid>
      <Grid>2</Grid>
    </Grid>
  );
}

The spacing is being converted to 2px. Is that how it’s supposed to work?

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

Libs:

"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/material-pigment-css": "^6.1.2",
"@mui/system": "^6.1.2",
"@pigment-css/nextjs-plugin": "^0.0.24",

Search keywords: pigmentcss

@Mike-Ro Mike-Ro added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 8, 2024
@DiegoAndai DiegoAndai self-assigned this Oct 8, 2024
@zannager zannager added component: Grid The React component. package: pigment-css Specific to @pigment-css/* labels Oct 9, 2024
@DiegoAndai DiegoAndai changed the title How to use spacing in @mui/material-pigment-css/Grid? [pigment-css][Grid] Spacing isn't working as expected Oct 9, 2024
@DiegoAndai
Copy link
Member

Hey @Mike-Ro, thanks for the report. I can confirm this is a bug. We'll be working on it.

@DiegoAndai DiegoAndai added regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 9, 2024
@DiegoAndai DiegoAndai moved this to In progress in Material UI Oct 9, 2024
@DiegoAndai DiegoAndai moved this from In progress to Selected in Material UI Oct 14, 2024
@DiegoAndai DiegoAndai removed the status in Material UI Oct 14, 2024
@DiegoAndai DiegoAndai moved this to Selected in Material UI Oct 14, 2024
@DiegoAndai DiegoAndai moved this from Selected to In progress in Material UI Oct 16, 2024
@DiegoAndai
Copy link
Member

Hey @Mike-Ro, sorry for the delay. May I ask you to share your nextjs.config.js content? (I assume you're using next as you have "@pigment-css/nextjs-plugin")

@DiegoAndai
Copy link
Member

DiegoAndai commented Oct 16, 2024

I've retested, and the Grid is working as expected. I added a test to cover this: #44132

It won't work if a function is provided to the theme's spacing. This is because, after #43389, when spacing is a function, the spacing CSS variables are not generated, which is the Grid's (and Stack's) implementation. In this case, the spacing value will be used directly (2px for spacing={2}), as is reported here. Is this your case @Mike-Ro?

@DiegoAndai DiegoAndai added status: waiting for author Issue with insufficient information and removed regression A bug, but worse labels Oct 16, 2024
@DiegoAndai DiegoAndai moved this from In progress to Waiting for response in Material UI Oct 16, 2024
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

@github-project-automation github-project-automation bot moved this from Waiting for response to Done in Material UI Oct 25, 2024
@Mike-Ro
Copy link
Author

Mike-Ro commented Oct 28, 2024

@DiegoAndai yes, thanks!

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Oct 28, 2024
@github-actions github-actions bot reopened this Oct 28, 2024
@Mike-Ro Mike-Ro closed this as completed Oct 28, 2024
@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 28, 2024
Copy link

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.

Note

@Mike-Ro 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Grid The React component. package: pigment-css Specific to @pigment-css/*
Projects
Status: Done
Development

No branches or pull requests

3 participants