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

Add functionality to fill available space #21

Open
Ledzz opened this issue Mar 31, 2023 · 2 comments
Open

Add functionality to fill available space #21

Ledzz opened this issue Mar 31, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Ledzz
Copy link

Ledzz commented Mar 31, 2023

Current functionality lack an ability to set styles for an element to fill all the remaining space.

It would be great to introduce some analogue of "flex-grow" property so element can fill all the free space. I understand that flex-grow functionality may be complicated, so I think the simple "fillAllRemainingSpace: true" would be great (assuming we have only such element in layout.

@Ledzz Ledzz added the enhancement New feature or request label Mar 31, 2023
@CyberDex
Copy link
Member

FlexBox like layout implementation is in plans for the future versions.
For now, similar behaviour can be achieved using percentages as a size values.
Like in this example: https://pixijs.io/layout/storybook/?path=/story/complex--application-layout
(check the 'Story tab')

Example:

new Layout({
  content: {
    el1: {
      type: 'row1',
      style: {
        display: 'block',
        width: '20%',
      }
    },
    el2: {
      type: 'row2',
      style: {
        display: 'block',
        width: '60%',
      }
    },
    el3: {
      type: 'row3',
      style: {
        display: 'block',
        width: '20%',
      }
    },
  }
)

@Ledzz
Copy link
Author

Ledzz commented Mar 31, 2023

@CyberDex Thank you for the quick response! I'm looking forward to see it implemented.

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

When branches are created from issues, their pull requests are automatically linked.

2 participants