[Pmwiki-users] Font size while modifying skins

Patrick R. Michaud pmichaud
Wed Feb 25 12:31:50 CST 2004


On Wed, Feb 25, 2004 at 08:15:49PM +0100, Runar Oudmayer wrote:
> > No, you're not missing anything.. can you suggest a good alternative?
> > Keep in mind that it needs to support [--some text--], [---some text---],
> > [++some text++], etc.
> >
> Since I'm not all to familiar with the pmwiki.php code and it's regulars, I
> did it as an 'inline replacement' just as an example, if it's useful I'm
> sure you can make something out of it:
> 
> Here's what I put into my config:
> 
> $InlineReplacements["/-S-(.*?)-S-/"] ="<div id='wikismall'>\$1</div>";
> $InlineReplacements["/-SS-(.*?)-SS-/"] ="<div id='wikismaller'>\$1</div>";
> $InlineReplacements["/-SSS-(.*?)-SSS-/"] ="<div
> id='wikismallest'>\$1</div>";

Well, a couple of quick observations.  First, they shouldn't be <div>s, 
because they're inline and not block markup (they should be <span>), 
and second, they can't use 'id', because there may be more than one 
of each in a document (they should be 'class').

> And here's what I put into my css (as an example):
> 
> #wikismall {padding-bottom:0.5em; padding-top:0.5em;
> FONT-FAMILY:Arial,Helvetica,Sans-serif; FONT-SIZE:0.8em;}
> #wikismaller {padding-bottom:0.5em; padding-top:0.5em;
> FONT-FAMILY:Arial,Helvetica,Sans-serif; FONT-SIZE:0.6em;}

The problem with these is that wikismall, wikismaller, wikismallest are 
defined in absolute measurements, so that someone who redefines the font size
to be something other than your default will have to also redefine all of 
these properties as well.  Better would be to use relative measurements...

...which tells me the correct answer, namely to have [--some text--]
be rendered as

   <span style='font-size:xx%'>some text</span>

where the 'xx%' is computed based upon the number of '-' or '+' in
the markup text.  Thanks, I'll see about making this change for 0.6.4.

Pm



More information about the pmwiki-users mailing list