W3C home > Mailing lists > Public > www-style@w3.org > June 2006

Re: [css3-gcpm] Leaders

From: Håkon Wium Lie <howcome@opera.com>
Date: Fri, 16 Jun 2006 15:36:39 +0200
Message-ID: <17554.46055.140784.414077@localhost.localdomain>
To: Mike Bremford <mike-css@bfo.co.uk>
Cc: www-style@w3.org

Also sprach Mike Bremford:

 > > But, consider this example:
 > >
 > >   ul.toc a::after {
 > >     font-size: 10pt;
 > >     content: leader('. . . ') target-counter(attr(href), page);
 > >   }
 > >
 > > By setting the font size to get leaders right, you also set the size
 > > on page numbers. Typically, you want the font size of the page numbers
 > > to match that of the text.
 > 
 > You can get around this like so:
 > 
 > ul.toc a::after {
 >      font-size:10pt; content:leader('. . . ');
 > }
 > 
 > ul.toc a::after(2) {
 >      content:target-counter(attr(href), page);
 > }

Yes, that could work. 

It requires support for a fairly advanced construct (arbitrary number
of pseudo-elements), but syntactiacally it works.

 > While we're on leaders, what happens here?
 > 
 > <div style="float:left">
 >    Text<span style="content:leader('. ')" />Text
 > </div>
 > 
 > As a floats width is shrink-to-fit, how wide is the leader? As narrow  
 > as possible seems to be the correct answer.

Yes. The concept of a minimum leader width should probably be
introduced, though. Another optional argument might to the trick:

  ul.toc a::after {
       content:leader('. . . ', current, 2em);
  }

Hmm.

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Friday, 16 June 2006 13:36:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:45 GMT