-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Probably generally related to #172
When using the fluid prop with a grid scoped inside a small container I start seeing horizontal scroll.
This because the CSS rules is like the following:
@media only screen and (min-width: 64em)
.fUrYXC {
width: 61rem;
}I think that this behavior should copy what other CSS frameworks like Bootstrap are doing for non-fluid layout, so using max-width:
.container, .container-sm {
max-width: 540px;
}Workaround
While waiting for a fix I'm using a fixed version of Grid component:
import { Grid as BaseGrid } from 'react-styled-flexboxgrid';
import gridConfig, { DIMENSION_NAMES } from 'react-styled-flexboxgrid/src/config';
const Grid = styled(BaseGrid)`
${p => !p.fluid && css`
${DIMENSION_NAMES.map(t =>
gridConfig(p).container[t] && gridConfig(p).media[t]`
width: 100%;
max-width: ${p => gridConfig(p).container[t]}rem;
`
)}
`}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels