Giter Club home page Giter Club logo

Comments (12)

pedrogit avatar pedrogit commented on June 30, 2024 1

Now how can I say:

Split(['one', 'two'], {
sizes: ['30px', 'remaining of the container width'],
});

from split.

nathancahill avatar nathancahill commented on June 30, 2024

I think this will look something like this:

Split(['one', 'two'], {
    sizes: ['30px', '560px'],
});

Might as well add support for any CSS value. The numeric values ([50, 50]) would still be interpreted as percentages for backwards compatibility.

from split.

nathancahill avatar nathancahill commented on June 30, 2024

Seems like a handy use case. How does something like this look?

Split(['one', 'two'], {
    sizes: ['30px', None],
});

For setting both sides, something like this?

Split(['one', 'two', 'three'], {
    sizes: ['30px', None, '30px'],
});

from split.

pedrogit avatar pedrogit commented on June 30, 2024

What about 'auto' instead of ''None'?
On Oct 21, 2015 12:47 PM, "Nathan Cahill" [email protected] wrote:

Seems like a handy use case. How does something like this look?

Split(['one', 'two'], {
sizes: ['30px', None],
});

For setting both sides, something like this?

Split(['one', 'two', 'three'], {
sizes: ['30px', None, '30px'],
});


Reply to this email directly or view it on GitHub
#10 (comment)
.

from split.

nathancahill avatar nathancahill commented on June 30, 2024

Opps, right. Switching between writing Javascript and Python. 'auto' is much better.

from split.

nathancahill avatar nathancahill commented on June 30, 2024

As I'm working on this, I realized a problem with the 'px' sizes. When changing the browser window size, the sizes will not adjust like they do with calc(% - 5px). I think the desired behavior for 'auto' would be to automatically fill the space.

from split.

pedrogit avatar pedrogit commented on June 30, 2024

Right! Any progress?

from split.

nathancahill avatar nathancahill commented on June 30, 2024

Haven't come up with a clean way to do this, no.

from split.

jolyonruss avatar jolyonruss commented on June 30, 2024

How about calculating the percentage at DOMReady, so if the sizes are set to ['30px', None, '30px'], inside an element that's 300px you could compute it down to ['10%', auto, '10%'], then when the window resizes everything still works...just a thought

from split.

nathancahill avatar nathancahill commented on June 30, 2024

Good idea @jolyonruss. Would 10%, 80%, 10% be the expected behavior though (fully flexible)? Or would you expect 30px, auto, 30px (fixed on the sides, flexible in the middle).

I'll take a swing at implementing the first.

from split.

brumm avatar brumm commented on June 30, 2024

Hey, might I also suggest using Flexbox for 'auto'?
That's the way it was done in atom: atom/atom#5902

from split.

nathancahill avatar nathancahill commented on June 30, 2024

Support is added for flexbox in v1.2.0. I'd rather leave this feature out of the library and allow users to implement it by calculating the desired initial percentages beforehand.

from split.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.