Skip to content

Commit

Permalink
epub.css: add style for 'blockquote'
Browse files Browse the repository at this point in the history
  • Loading branch information
poire-z committed Dec 4, 2018
1 parent 0879de5 commit 1c84f21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cr3gui/data/epub.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ p {
margin-top: 0;
margin-bottom: 0;
}
blockquote {
margin-top: 0.5em;

This comment has been minimized.

Copy link
@Frenzie

Frenzie Dec 4, 2018

Member

I'm not entirely sure I understand the style here. Okay, so visually you apparently don't simply want margin: 1em or margin: 1em 0 1em 1em, but shouldn't it still be margin (margin: .5em 2em) instead of randomly using padding?

This comment has been minimized.

Copy link
@poire-z

poire-z Dec 4, 2018

Author Contributor

Not much a thoughtful choice of mine. Just saw that Firefox was putting it in padding, and did the same...
What's the methaphysical rule to use padding and not margin? :) background-color and border only (that would apply over padding but not over margin)?
I don't mind changing them all to margin

This comment has been minimized.

Copy link
@Frenzie

Frenzie Dec 4, 2018

Member

It just looks to me like you're trying to add a margin here, or at the very least like you're condensing margin and padding into one. And indeed, just add a border if you're unsure what you want.

If you do it incorrectly you might get unexpected results in dealing with child elements or even just multiple elements inside the BLOCKQUOTE element. P elements often already come with margin, so if you unintentionally add padding then you're doubling the effective margin, for example.

This comment has been minimized.

Copy link
@poire-z

poire-z Dec 4, 2018

Author Contributor

I read in some specs that margins collapse so that only the largest one is used (crengine does not do that), but I get that would be for top and bottom margins only.
So, in that situation you describe (P with margin inside BLOCKQUOTE), considering only left and right, and no border/bgcolor, it would still have the same effect whether we use padding-left or margin-left, no matter what the children elements are: they would always be cumulative, always doubling, right?

This comment has been minimized.

Copy link
@Frenzie

Frenzie Dec 5, 2018

Member

I'm not saying it makes a difference here but that aside from being ugly if you add something like a left border (which is very common, e.g. GitHub) it's a bad practice if you're actually after a margin.

margin-bottom: 0.5em;
padding-left: 2em;
padding-right: 2em;
}
hr {
height: 2px;
background-color: #808080;
Expand Down

0 comments on commit 1c84f21

Please sign in to comment.