crobi / rpg-cards

RPG spell/item/monster card generator
https://rpg-cards.vercel.app
MIT License
511 stars 288 forks source link

Custom border size #35

Open crobi opened 9 years ago

crobi commented 9 years ago

As print studios seem to require bleed and safe areas around the actual card content, we should make those configurable.

Examples: http://www.printerstudio.com/pops/faq-photo.html http://www.makeplayingcards.com/dl/templates/poker-size.pdf

gamlin777 commented 8 years ago

Is there a solution (or quick hack) to this yet? I'm looking to take my deck to a print studio who have described this problem with the generated PDF.

crobi commented 8 years ago

If you know CSS, then a quick hack would be to edit the CSS of the generated page before converting it to PDF (using Chrome dev tools, for example).

The relevant file is https://github.com/crobi/rpg-cards/blob/master/generator/css/cards.css, have a look at the two top classes and play with margin and padding.

I currently don't have time to work on this project, but feel free to implement this and post a PR!

gamlin777 commented 8 years ago

Yeah I've been playing around with them. I was just curious if there was another route. If I get anything good I'll be sure to commit it.

gamlin777 commented 8 years ago

The quick way to achieve what we're after is to add the following to the .card class in card.css

-webkit-box-shadow: 0 0 0 2mm; margin: 2mm;

This would work perfectly, however what I've been wrestling with is Chrome's Print to PDF which turns the box shadow black. Apparently this is a longstanding bug from 2010.

crobi commented 8 years ago

I was just curious if there was another route

The way I should have done it is add elements to the UI where the user can set bleed and save margins, and then add generated inline CSS to the card elements. There's already generated inline CSS for the card color.