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

Way to fit column to content? #1012

Open
RichardJECooke opened this issue Jun 1, 2022 · 6 comments
Open

Way to fit column to content? #1012

RichardJECooke opened this issue Jun 1, 2022 · 6 comments

Comments

@RichardJECooke
Copy link

Bulma has is-narrow CSS class to fit a column to its content, and then the other columns autosize.

It would be great if Pure could have this too. Because Bulma breaks too many other things sadly.

@magikstm
Copy link
Contributor

Could you possibly share a fiddle or a small demo?

@anshul137
Copy link

Is the issue still open? I would like to take it up if that is the case.

@redonkulus
Copy link
Contributor

redonkulus commented Oct 5, 2022

Looks like we were looking for more information about the use case before decide to implement it or not.

@mildred
Copy link

mildred commented Jan 5, 2023

Bootstrap has a col-auto class if I'm not mistaken. The idea is to set flex-basis: auto

edit: the col-auto class shrink the container to fit the content and col without a column size grows the content to fill the available space.

@mildred
Copy link

mildred commented Jan 5, 2023

Example with bootstrap: https://jsfiddle.net/pgoLkz38/1/

<style>
div {
  border: 1px solid black;
}
</style>
<nav class="row">
  <div class="col-2">
    a
  </div>
  <div class="col-2">
    b
  </div>
  <div class="col">
    c
  </div>
  <div class="col-auto">
    dddd
  </div>
</nav>

@ileadu
Copy link

ileadu commented Apr 2, 2023

Could you possibly share a fiddle or a small demo?

https://bulma.io/documentation/columns/sizes/#narrow-column

.column {
   display: block;
   flex-basis: 0;
   flex-grow: 1;/* This is a point. */
   flex-shrink: 1; 
}
.column.is-narrow {
    flex: none;/* This is a point. */
    width: unset;/* This is a point. */
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants