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

CSS3 Multi-column Layout #60

Open
miminno opened this issue Jan 3, 2017 · 12 comments
Open

CSS3 Multi-column Layout #60

miminno opened this issue Jan 3, 2017 · 12 comments
Assignees

Comments

@miminno
Copy link

miminno commented Jan 3, 2017

Guys, did anyone try to do this, or thought about it? My current employer needs this feature desperately, willing to offer a compensation for whoever takes on this task.

@danfickle
Copy link
Owner

Hi @miminno
What column features do you need specifically:
Do you need balanced columns?
Column spanned elements?
Block level content inside columns or just inline text?
Explicit column breaks?

And more importantly, how desperate is desperate?

@miminno
Copy link
Author

miminno commented Jan 4, 2017

Do you need balanced columns? - No
Column spanned elements? - No
Block level content inside columns or just inline text? - Yes
Explicit column breaks? - Yes

Obviously the more features get implemented the better for the project as a whole.
Desperate as highly desirable and anticipated.

@danfickle
Copy link
Owner

What about floats in column content?

I've read the multi column specification so I'll experiment and get back to you.

@miminno
Copy link
Author

miminno commented Jan 4, 2017

@danfickle Floats is a must. Thanks for your response.

@danfickle
Copy link
Owner

Note to self:
I've been reading the relevant code and come up with a plan of attack.

When we encounter a column in BoxBuilder we put it in a ColumnBox which itself extends BlockBox. We get the BlockBox super to do all the heavy layout work such as floats, lines, etc into one super long column. When the super (BlockBox) method returns we have a super long column that we split up based on the y position of each recursively examined box.

For example if we desire two columns of 100px high each, everything with a y <= 100 is left alone, everything from 101 to 200 is put in column two and translated by one column width in the x direction and one column height up in the y direction, and so on.

For this to work, we have to turn off page breaking when the BlockBox does the original single column layout. Perhaps this can be done by putting the context into screen (continuous) mode or having a third "in column" mode.

Challenges:

  • What to do about columns nested inside columns?

@miminno
Copy link
Author

miminno commented Jan 27, 2017

@danfickle
From the spec point of view, w3c says:

Nested multi-column elements are allowed, but there may be implementation-specific limits.

I think WebKit will only respect the outermost block element with 'column-count'. You can probably safely follow the same rule.

@miminno
Copy link
Author

miminno commented Apr 13, 2017

Since there's no updates on this I assume it won't be possible any time soon?

@danfickle
Copy link
Owner

Hi @miminno
At the moment I've been lazy and not done much work on the project. Fortunately, @rototor has been keeping the project going. I'm sure I'll get motivated and start working on this again, but I can't give you a schedule.

My apologies for giving you false hope on this being completed promptly, I was planning on doing it, but life intervened.

Regards,
Daniel.

danfickle added a commit that referenced this issue Jun 26, 2017
Implements:
+ Unbalanced columns
+ Inline content only
+ column-count and column-gap properties
danfickle added a commit that referenced this issue Jun 26, 2017
…dth was not always calculated before use.
@danfickle
Copy link
Owner

I have just implemented CSS3 columns. At the moment columns are:

  • Unbalanced - go down to the bottom of the page and then across on each page.
  • For text and inline content only - float content and block content in columns is not yet debugged.
  • column-count and column-gap properties are implemented. column-width is not.
  • Explicit column breaks and page breaks inside a column are yet to be implemented.

Screenshot:
multi-column-screenshot

@asahicks
Copy link

Hi @danfickle, are there any plans to look at balanced columns so the content would always split exactly half way, regardless if it's hit the bottom of the page? Thanks

@danfickle
Copy link
Owner

@asahicks - I will try to get balanced columns working when I next work on the column code but no timeframe (other than version 1).

@lauer
Copy link

lauer commented Feb 28, 2019

👍 for adding balanced columns. Or maybe just be able to add a fixed sized box with columns. Currently it seems always hitting the bottom of the page before going to next column.

Have tried with margin, fixed-position and others.
Also note. It only works for <div> and not <section>/<article>

@danfickle danfickle self-assigned this Jan 3, 2021
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

4 participants