pure icon indicating copy to clipboard operation
pure copied to clipboard

Way to fit column to content?

Open RichardJECooke opened this issue 2 years ago • 6 comments

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.

RichardJECooke avatar Jun 01 '22 15:06 RichardJECooke

Could you possibly share a fiddle or a small demo?

magikstm avatar Sep 13 '22 23:09 magikstm

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

anshul137 avatar Oct 05 '22 05:10 anshul137

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

redonkulus avatar Oct 05 '22 19:10 redonkulus

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 avatar Jan 05 '23 11:01 mildred

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>

mildred avatar Jan 05 '23 12:01 mildred

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. */
}

ileadu avatar Apr 02 '23 18:04 ileadu