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

Component <Grid /> margin: -8px #7920

Closed
wzalazar opened this issue Aug 26, 2017 · 4 comments
Closed

Component <Grid /> margin: -8px #7920

wzalazar opened this issue Aug 26, 2017 · 4 comments
Labels
component: Grid The React component.

Comments

@wzalazar
Copy link

wzalazar commented Aug 26, 2017

When I use component , given the following code it adds the below css rules

.MuiGrid-spacing-xs-16 {
    width: calc(100% + 16px);
    margin: -8px;
} 

My code

<Grid container direction={'row'} justify={'space-between'} align={'flex-start'}>
        <Grid>
          <OfferPreview />
        </Grid>
        <Grid>
          <OfferPreview />
        </Grid>
</Grid>

The result is that the container overlaping. Because the margin -8px affect also top and bottom.

The fix could be...

.MuiGrid-spacing-xs-16 {
    width: calc(100% + 16px);
    margin: 0 -8px;
} 

Version

  • Material-UI: 1.0.0-beta.5

screen shot 2017-08-26 at 1 54 20 am

@oliviertassinari
Copy link
Member

Is this a duplicate of #7466? Also, please provide a reproduction if not (could be codesandbox.io/webpackbin/etc.)

@oliviertassinari oliviertassinari added component: Grid The React component. waiting for 👍 Waiting for upvotes labels Aug 26, 2017
@wzalazar
Copy link
Author

maybe is related with #7466, but my bug is more specific with top and bottom.

Demo

https://codesandbox.io/s/7mzoqvwm0q

screen shot 2017-08-27 at 12 38 13 am

if you apply the fix, this is the result...

.MuiGrid-spacing-xs-16 {
    width: calc(100% + 16px);
    margin: 0 -8px;
} 

screen shot 2017-08-27 at 12 38 50 am

@oliviertassinari
Copy link
Member

Grid container > Grid > Grid container > div is not a valid Grid usage, please refer to the documentation. Also, here a more appropriate version: https://codesandbox.io/s/5kp1rmop2x.

@wzalazar
Copy link
Author

wzalazar commented Aug 27, 2017

you're right, I didn't put item property for my <Grid />.

My demo:

https://codesandbox.io/s/r58mqzzv2n

Thanks @oliviertassinari

@oliviertassinari oliviertassinari removed the waiting for 👍 Waiting for upvotes label Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Grid The React component.
Projects
None yet
Development

No branches or pull requests

2 participants