Re: [css3-page] Flexbox or table algorithm for page-margin box layout

Why not use a new position value, let's say page-area, with flexbox?

Håkon's example could be expressed like this:
<div class="margin-box"><div class="pagenum left"></div><div
class="title"></div><div class="pagenum right"></div></div>
.margin-box { position:page-area; left:0; right:0; bottom: -2%;
display:flex; justify-content:center; }
.pagenum { content: counter(page); flex:none; }
.title { content: string(chapter); flex:1 0 auto; text-align:center; }
@page :left .pagenum.right { visibility:hidden; }
@page :right .pagenum.left { visibility:hidden; }

This is actually better than what's currently in the css3-page spec, IMHO,
because instead of allowing the title and page number to overlap, the page
number would be pushed out into the left or right margin.

The only tricky thing I've done here is to allow :left and :right selectors
to style content inside the margin box element. We wouldn't want to allow
them to style content that's not inside a position:page-area or
position:fixed container. (BTW the only difference between
position:page-area and position:fixed is that the former isn't clipped to
the page area.)

Rob
-- 
Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur
Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl
bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat
lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir
— whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb
tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28]

Received on Monday, 25 March 2013 23:04:49 UTC