question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set Grid.props.columns={12} to 100% of width

See original GitHub issue

Steps

<Grid columns={12}>
  <Grid.Row>
    <Grid.Column width={3}>...</Grid.Column>
    <Grid.Column width={6}>...</Grid.Column>
    <Grid.Column width={3}>...</Grid.Column>
  </Grid.Row>
</Grid>

Expected Result

I expect that the columns will now be 100% width, since 12 should be the full amount of columns. (3 + 6 + 3 = 12).

Actual Result

Eventhough i set Grid.props.columns to 12, the full with is still calculated to be 16, so the 12 columns are not 100% of the width, but instead 75% of the width.

Version

0.68.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
brianespinosacommented, Feb 20, 2018

@jacknevitt you’ll want to ask that question on the core SUI project for more clarity on that decision. This React project is intended to replicate markup/functionality of that core project in a React way.

0reactions
brianespinosacommented, Mar 2, 2018

@webberwang Please open a new issue with what you are trying to accomplish.

For anyone else landing here:

The width of your Grid column are either defined by setting the columns count on Grid or setting the width (out of 16) individually on a Grid.Column. The Grid component also accepts some other responsive values to columns like “equal”.

Grid.Row will also accept the same values as Grid if you want to control columns differently by row.

Mixing control between Grid/Grid.Row and Grid.Column is not advised. You need to decide to control width per column, or via the parent row or grid.

If you feel like you need to have a different grid system with a different count of columns and gutter widths, you’ll need to build your own CSS with build tools for SUI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto-Sizing Columns in CSS Grid: `auto-fill` vs `auto-fit`
The columns are defined using the repeat() function and have a minimum width of 100px, and a maximum set to 1fr , so...
Read more >
grid-template-columns - CSS: Cascading Style Sheets | MDN
The grid-template-columns CSS property defines the line names and track ... #grid { display: grid; width: 100%; grid-template-columns: 50px ...
Read more >
How would I make one container in a grid change to 100% ...
I have tried the below code but my element-2 is not expanding to width: 100% . My CSS is: .container{ display: grid; grid-template-columns: ......
Read more >
Grid system
container-fluid for width: 100% across all viewport and device sizes. Rows are wrappers for columns. Each column has horizontal padding (called a gutter)...
Read more >
React Suite Grid Props
It defines the layout as covering 100% of the width of the parent component. It is true by default. <Grid.Row> Props:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found