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

Support Flexbox #324

Closed
brendon opened this issue Jun 17, 2016 · 15 comments · Fixed by #579
Closed

Support Flexbox #324

brendon opened this issue Jun 17, 2016 · 15 comments · Fixed by #579
Labels
feature New feature that should be supported

Comments

@brendon
Copy link

brendon commented Jun 17, 2016

Hi there, I'm looking to switch from wkhtmltopdf to weasyprint but just wanted to check about flex-box support. I can't see any mention of it in issues. Will I have trouble using weasyprint whilst using flex-box in my design?

@liZe liZe added the feature New feature that should be supported label Jun 17, 2016
@liZe
Copy link
Member

liZe commented Jun 17, 2016

Flexbox is not supported at all, but it shouldn't be hard to implement (if anyone is interested and has a couple of weeks free).

@liZe liZe changed the title Flex-box compatibility? Support Flexbox Jun 17, 2016
@brendon
Copy link
Author

brendon commented Jun 17, 2016

Thanks @liZe :) I'd be interested in financially supporting someone to do this. I'd first need to check that there aren't any other things that need doing, so I'll have a crack at integrating weasyprint into my Rails app and see how well it outputs everything else.

I'm basically processing a Semantic UI grid document into a PDF.

@DanielSwain
Copy link

@brendon Any progress on having WeasyPrint support Flexbox?

@brendon
Copy link
Author

brendon commented Aug 15, 2016

Hi @DanAtShenTech, thanks for reminding me about this issue. I ended up sticking with wkhtmltopdf and hacking the CSS to fall back to the normal box model when the page was being rendered as a PDF. It's working well to date. I'd still be interested in WeasyPrint if it supported flex box in the future.

I'm going to close this for now though since there doesn't seem to be anyone to progress the work :)

@brendon brendon closed this as completed Aug 15, 2016
@liZe
Copy link
Member

liZe commented Aug 15, 2016

We can let this open until anyone finds the time to implement it 😄.

@liZe liZe reopened this Aug 15, 2016
@polarathene
Copy link

This might interest anyone who wants to implement flexbox. Facebook has developed a minimal CSS layout engine specifically focused around flexbox for React-Native, they've provided the code open sourced, perhaps it could be integrated into WeasyPrint easily enough?(not my forte). Do note they slightly deviate from spec with several different defaults.

@diegobill
Copy link

Hi,

weasyprint does not support the css bellow:

.grid2x2 {
	min-height: 50%;
	height: 50%;
	display: flex;
	flex-direction: row;
}

.grid2x2 > div {
	display: flex;
	flex-basis: 50%;
	width: 100%;
	justify-content: center;
	flex-direction: column;
}

.grid2x2 > div > div {
	display: flex;
	justify-content: center;
	flex-direction: column;
}

is there any alternative supported by weasyprint?

Thanks

@mahfozmt
Copy link

@brendon Im also sticking with wkhtmltopdf, what is the hack? can you share? i need implement flexbox.

@brendon
Copy link
Author

brendon commented May 22, 2023

@mahfozmt, these days I'd suggest using https://github.com/puppeteer/puppeteer

If you use Rails you can interface with this via https://github.com/Studiosity/grover

It uses headless Chrome so it stays up to date with modern web standards.

@polarathene
Copy link

i need implement flexbox.

Earlier I linked to Facebooks yoga, now a better choice AFAIK is taffy, but it doesn't have C bindings yet which other languages need (Python could use those fairly easy AFAIK).

Taffy has flexbox and also CSS Grid.


For an easier solution, I'd also suggest using alternatives like Puppeteer or PlayWright 👍

@mahfozmt
Copy link

@brendon, @polarathene My project is built by .NET Core. In there, Puppeteer Implement also has many hassles.

@brendon
Copy link
Author

brendon commented May 23, 2023

Do you use node for other things in there?

@mahfozmt
Copy link

Yes, for Angular using node.

@liZe
Copy link
Member

liZe commented May 23, 2023

Hi everyone!

Discussing about document generation is interesting, but this closed issue is not the best place for that 😄. You can continue elsewhere, maybe on the PrintCSS Discord channel.

@brendon
Copy link
Author

brendon commented May 23, 2023

Roger, @liZe. @mahfozmt, as far as CSS changes. I had a look and can't see much, but I suspect it was mostly changing flex items to regular display: block or inline-block and giving them predictable widths. Good luck :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that should be supported
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants