[Mailman-Developers] Styling patch

Ethan Fremen i at mindlace.net
Sun May 13 01:09:56 CEST 2007


A.M. Kuchling wrote:

> I have an idea for a proposed conservative approach for 2.1:
> 
> * Add two mm_cfg settings: CSS_FILES and JS_FILES, while are lists
>   (alternatively, whitespace-separated strings):
> 
> 	CSS_FILES = ['/css/mailman.css', '/css/custom.css']
> 	JS_FILES = ['/js/switcher.js', '/js/foo.js']

Just to be pedantic, as long as we make sure they appear in the order 
they're presented; you may also wish to do something like:

CSS_FILES = [{'href':'/css/mailman.css', 'rel': 'stylesheet', 'media': 
'screen'}, {'href':'/css/custom.css','rel':'alternate','media':'screen'}]

of course, at that point you're practically spelling the entire link, 
but at least the 'rel' is commonly used.

> * Wrap the body of Mailman-generated pages in <div id="mailman">...</div>.
> 
> That's it. 

great! +1

> Possibly we could apply the portion of the patch that generates tags
> like <br /> instead of <br>, but since we wouldn't be adding a DOCTYPE
> to the pages, it wouldn't have much effect. 

Pretty please lets add this doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">

and fix singleton tags (though *note* you cannot emit <script> tags as 
singletons). There is a lot of CSS that simply Does Not Work without a 
doctype. This is particularly true for Internet Explorer 6 (and I assume 
7) which basically doesn't turn on the CSS bugfixes since IE 5 if you 
don't issue a doctype.

It is actually ok if the hand-written HTML is still tag-soupish; as long 
as we don't include an XML prolog the browsers still handle simplistic 
well-formedness errors, and even more severe ones don't give you the "I 
refuse to render" problem that you get if you use an XML prolog. The 
main difference is the CSS rendering path used.

> For 2.2, add:
> 
> * Restructure HTML to use semantic markup and CSS instead of tables.
> 
> * Add a DOCTYPE to the HTML output and check for validity.  Hand-written 
>   HTML in list configs. might break validity; IMHO that shouldn't be
>   our problem to fix.  We might choose HTML 4.01 validity to avoid
>   imposing XHTML correctness on such hand-written text.

For pages that are "generated" rather than hand-edited, I propose we use 
this doctype as of 2.2:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

with the 4.01 strict being fallback for non-validating hand-edited pages.

> * If the MM developers are OK with taking out the WEB_*_COLOR config
>   settings, remove them with no concern for compatibility.
> 
> * Install a static mailman.css file.

+1

~ethan


More information about the Mailman-Developers mailing list