Removing vertical padding from paginated view in v0.3
I'm planning to manage the vertical padding myself in my updated reader, but here, epub.js sets it to 20px. Nothing breaks when I set it to 0px, which makes me think it is unnecessary (and it was not there in v0.2).
To override it, I currently need to do some hacky stuff by setting an interval to constantly set the padding to 0 until it stays the same.
Personally, I would fix this by setting the horizontal padding (needed for pagination) separately from the vertical padding. Then, I would make only the horizontal padding !important so the vertical padding can be overrided the usual way (with contents.css).
That all makes sense to me.
However I am thinking of moving that default padding to the default theme, so it's easier to override but still present unless you want to change it.
OK, that sounds good. For now, I've modified my version to get rid of the vertical padding.
@fchasen Is there is an example for this?
You can define padding in a theme like:
rendition.themes.default({
"body": { "padding-top": "10px" }
})
@fchasen i tried it out but it's not working for me, i created issue here can you check that out. #797
!important is needed to override any padding. And not all sides are possible since some already are important.
I need to use custom padding for all sides. Will make a PR soon. Think i'll just add an option to disable epubjs setting padding and column gap (need to change gap as well). Then custom padding and gap can be added with a theme or a class. @fchasen Any thoughts on this?
In my epub viewer, I just patched epub.js to remove the vertical padding. I then set the vertical padding on the container, and the horizontal padding in epub.js.
I'm a bit unclear on what you are trying to accomplish.
Any chance you could create a screengrab of what the current padding looks like and what you are trying to change it to?
@fchasen Just want to be able to set custom padding and gap from rendition options. Gap is already possible. https://i.imgur.com/BsAwEni.png Like this: #855
Horizontal paddings are too big for small screens. Please provide an option to override them.
I had a similar issue, I solved it with:
book.renderTo("bookarea", {width, height, flow:"scrolled-doc", stylesheet: '/book.css'});
And in /book.css:
body > :first-child {
padding-top: 25px !important;
}
body > :last-child {
padding-bottom: 125px !important;
}