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.

Stack space for flow elements

See original GitHub issue

This feature is best explained here: https://every-layout.dev/layouts/stack/

And an example can be found here: https://jsfiddle.net/c2fbo0u3/1/

In the example I have just added two different space size, 1.5rem and large 3rem, but could be also added more.

As explained in every-layout.dev this is useful when we need to add space between elements, and in addition I added space X and Y, something like already bootstrap m-* utilities offer.

So instead of writing:

<div>
<div></div>
<div class="mt-3"></div>
<div class="mt-3"></div>
</div>

Can be:

<div class="stack-y">
<div></div>
<div></div>
<div></div>
</div>

Or instead of:

<div class="d-flex">
<div></div>
<div class="ml-3"></div>
<div class="ml-3"></div>
</div>

Can be:

<div class="d-flex stack-x">
<div></div>
<div></div>
<div></div>
</div>

Here https://jsfiddle.net/c2fbo0u3/1/ there are all examples, also creating a reverse space for space-x, and nested.

Nested could be also created without using space-nested but just adding for each nested element the same space-x/y classes. Example:

<div class="stack-x stack-nested d-flex">
  <div>Stack nested X One</div>
  <div>Stack nested X Two</div>
  <div class="d-flex">
    <div>Stack nested X One</div>
    <div>Stack nested X Two</div>
    <div>Stack nested X Three</div>
  </div>
</div>

Can be:

<div class="stack-x d-flex">
  <div>Stack nested X One</div>
  <div>Stack nested X Two</div>
  <div class="stack-x d-flex">
    <div>Stack nested X One</div>
    <div>Stack nested X Two</div>
    <div>Stack nested X Three</div>
  </div>
</div>

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mdocommented, Nov 2, 2020

This is very familiar to Pylon’s hstack/vstack approach. Very intriguing to me also considering #31995 and not wanting to have a single component-based layout option. I’d go further than here and suggest that it be display: flex by default and offer inline-spacers via CSS customer properties. Example: https://codepen.io/emdeoh/pen/Bazxbrq.

0reactions
XhmikosRcommented, Jul 23, 2021

Fixed by #33986

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Stack
Flow elements require space (sometimes referred to as white space) to physically and conceptually separate them from the elements that come before and...
Read more >
Flow layout with centered content - qml
So we can center in. Here it is a simple code, Flow { property int rowCount: parent.width / (elements.itemAt(0).width + ...
Read more >
Working With Layouts in JavaFX: Using Built-in Layout Panes
The StackPane layout pane places all of the nodes within a single stack with each new node added on top of the previous...
Read more >
Flow cell and stack design
Between the particles there is a void space in which water is present from which the ions are absorbed or into which the...
Read more >
React Stack component - Material UI
The Stack component manages layout of immediate children along the vertical or horizontal axis with optional spacing and/or dividers between each child.
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