[pmwiki-users] Moving CSS to a file

Hans design at softflow.co.uk
Sun Oct 23 13:25:41 CDT 2005


Saturday, October 22, 2005, 8:42:23 PM, Spare wrote:
> Hi, when I "view-source" on the default template I see some CSS
> in the Header Style section. How can I move this to a CSS file?

To move all style definitions from the header into a css file is not
so easy, since different modules are adding them, and some of those
additions cannot be turned off individually.

You can find these modules by searching all installed scripts for
$HTMLStylesFmt, including pmwiki.php and all pmwiki scripts in the
scripts directory, plus in addition cookbook scripts.

The following pmwiki script modules add styles via $HTMLStylesFmt:
pagerev.php:    SDV($HTMLStylesFmt['diff']
simuledit.php:  $HTMLStylesFmt[]
stdmarkup.php:  $HTMLStylesFmt['markup']
urlapprove.php: $HTMLStylesFmt['urlapprove']
vardoc.php:     $HTMLStylesFmt[]
wikistyles.php: SDV($HTMLStylesFmt['wikistyles']
pmwiki.php:     $HTMLStylesFmt['pmwiki']

Note that some can be turned off in config.php with
$HTMLStylesFmt['diff'] = "";
$HTMLStylesFmt['markup'] = "";
$HTMLStylesFmt['urlapprove'] = "";
$HTMLStylesFmt['wikistyles'] = "";
$HTMLStylesFmt['pmwiki'] = "";

The ones in simuledit.php and vardoc.php cannot be turned off, since
they have no identifier in the square brackets. Perhaps Patrick could
add these?

We could also turn off all HTMLStyles definitions from any module,
including any cookbook recipe, with
$HTMLHeaderFmt['styles'] = '';
but then we have to make sure that we really don't need
$HTMLStylesFmt[] at all.

After having turned off some $HTMLStylesFmt[] defibnitions we need to
include these via a css file, usually this is pub/css/local.css,
since it get loaded automatically.
So create or add to pub/css/local.css the following:

/* wikistyles */
.frame  { border:1px solid #cccccc; padding:4px; background-color:#f9f9f9; }
.lfloat { float:left; margin-right:0.5em; }
.rfloat { float:right; margin-left:0.5em; }

/* pmwiki */
ul, ol, pre, dl, p { margin-top:0px; margin-bottom:0px; }
code { white-space: nowrap; }
.vspace { margin-top:1.33em; }
.indent { margin-left:40px; }
.outdent { margin-left:40px; text-indent:-40px; }
a.createlinktext { text-decoration:none; border-bottom:1px dotted gray; }
a.createlink { text-decoration:none; position:relative; top:-0.5em;
  font-weight:bold; font-size:smaller; border-bottom:none; }
img { border:0px; }

/* markup */
table.markup { border: 2px dotted #ccf; width:90%; }
table.markup td { padding-left:10px; padding-right:10px; }
td.markup { border-bottom: 1px solid #ccf; }
p.question { font-weight:bold; }

/* pagerev */
.diffbox { border:1px #999999 solid; margin-top:1.33em; }
.diffauthor { font-weight:bold; }
.diffchangesum { font-weight:bold; }
.difftime { font-family:verdana,sans-serif; font-size:66%; 
  background-color:#dddddd; }
.difftype { clear:both; font-family:verdana,sans-serif; 
  font-size:66%; font-weight:bold; }
.diffadd { border-left:5px #99ff99 solid; padding-left:5px; }
.diffdel { border-left:5px #ffff99 solid; padding-left:5px; }
.diffrestore { clear:both; font-family:verdana,sans-serif; 
  font-size:66%; margin:1.5em 0px; }
.diffmarkup { font-family:monospace; }

/* urlapprove */
.apprlink { font-size:smaller; }

plus any css definitions from any other module or cookbook recipe.

I'll add all this as a cookbook recipe
http://www.pmwiki.org/wiki/Cookbook/RemovingHTMLStyles


Best, 
~Hans                           






More information about the pmwiki-users mailing list