Closed robinwhittleton closed 1 year ago
Yes I suppose we should, since we define margins for other basic elements like <blockquote>
and <h#>
in core.css. But, if we're going to think about <figure>
, then we should sit down and review all of the block level elements that we may have missed the first time around to define default margins for all of them.
OK, after some research, this is the picture. SE based on either core.css or recommended default styles in SEMOS. UA agents based on default Gecko / WebKit / Blink stylesheets (they seem to agree mostly these days).
Element | SE margin and padding | UA margin and padding |
---|---|---|
article |
- | - |
aside |
- | - |
blockquote |
margin: 1em 2.5em; |
margin: 1em 40px; |
body |
- | - |
dd |
- | margin: 0 0 0 40xp; |
div |
- | - |
dl |
- | margin: 1em 0; |
dt |
- | - |
figcaption |
margin: 1em; |
- |
figure |
- | margin: 1em 40px; |
footer |
margin-top: 1em; |
- |
h1 |
margin: 3em 0; |
margin: 0.83em 0; |
h2 |
margin: 3em 0; |
margin: 0.83em 0; |
h3 |
margin: 3em 0; |
margin: 1em 0; |
h4 |
margin: 3em 0; |
margin: 1.33em 0; |
h5 |
margin: 3em 0; |
margin: 1.67em 0; |
h6 |
margin: 3em 0; |
margin: 2.33em 0; |
header |
margin: 1em; |
- |
hgroup |
margin: 3em 0; |
- |
hr |
margin: 1.5em auto; |
margin: 0.5em auto; |
li |
- | - |
nav |
- | - |
ol |
- | margin: 1em 0; padding: 0 0 0 40px; |
p |
margin: 0; |
margin: 1em 0; |
section |
- | - |
table |
- | - |
ul |
- | margin: 1em 0; padding: 0 0 0 40px; |
OK, so it looks like we're basically on track with default stylesheets, and 40px means 2.5em for us assuming a 16px font size.
The only thing that might be tricky is <ol>
. I think that in the default stylesheet the left margin includes space for the actual numbers. But if we have very long numbers, like Decline and Fall's endnotes, forcing a custom margin may screw up any padding changes the browser might make to fit long numbers. What do you think?
I’d be happy to leave left/right padding to default on ol
/ul
. The 40px seems to have been designed to just about allow four digit ol
numbers at a default font size.
So, proposal:
figure
styling to include margin: 1em 2.5em
.<figure>
s.ul, ol { margin-top: 1em; margin-bottom: 1em; }
to core.css.dl { margin: 1em 0; } dd { margin-left: 2.5em; }
.Happy for me to go ahead with that?
Yes, I think that works!
I was trying to work out why browsers had gone with 40px
instead of 2.5em
and realised that it’s probably about coping with increased text size. If you’re reading with 5× zoom then the margins on the left and right will appear to be 200px, not 40px. That could, conversely, make it much harder to see the contents of the figure.
So a slight amendment to my proposal: everywhere where I’d written 2.5em
I’ll make 40px
instead.
OK, that makes sense. Thanks!
OK, I’ve updated the following repos with the new figure styling. In a few cases there was a little more work to do, but usually just CSS tidying.
So I guess the only thing left to do is to update core.css in every book. I guess you’ve got a nice script to do that?
Yup! I'm updating them all now. Does that wrap it up for this issue?
Think so 🙂
Should
figure
(as defined in https://standardebooks.org/manual/1.7.0/single-page#7.8.5.2) have a default margin? At the moment we don’t define any margin, and leave it up to the user agent. In browsers (Gecko, WebKit, Blink) this defaults tomargin: 1em 40px
from the default W3 HTML stylesheet, but we can’t guarantee it I guess.