--- Gnarlodious <[EMAIL PROTECTED]> wrote:

> Whenever I add some new CSS element, I need to go through all
> installed themes and add that element to the css files. Would it not
> be simpler to add a "Common.css" stylesheet that would apply default
> styles first? This would allow for theme-independent styles that
> control some basic layout and structural elements. Colors and other
> theme-based properties could still be set in separate themes.
> 
> Does that sound like an improvement?

Duplicating the img directory and the CSS files has troubled me as
well.  For the last couple of custom themes I created I sub-classed a
parent theme.  Something like:

'''
import fixedleft

class Theme(fixedleft.Theme):

    def html_head(self, d):
        """ Add another screen.css and a javascript function to
whatever fixedleft creates."""
        head = u'\n'.join((fixedleft.Theme.html_head(self, d),
u'<link rel="stylesheet" type="text/css" charset="utf-8" media="screen"
href="/wiki/drafixedleft/css/draScreen.css">', u'<link rel="stylesheet"
type="text/css" charset="utf-8" media="screen"
href="/wiki/drafixedleft/css/draScreen.css">',
u'<link rel="stylesheet" type="text/css" charset="utf-8" media="print"
href="/wiki/drafixedleft/css/draPrint.css">', u'<link rel="stylesheet"
type="text/css" charset="utf-8" media="screen"
href="/wiki/drafixedleft/css/draScreen.css">',  
u'<script type="text/javascript"
src="/wiki/dramodern/js/draMoin.js"></script>',
))
        return head
'''

As the word wrap may have made the above hard to read, the idea is to
import a parent theme and then override the html_head method to load
additional CSS or Javascript files unique to the new theme.

Obviously this doesn't help if you are using the contributed themes. 
But if you are developing internal themes (or maybe a new contributed
theme), you can sub-class one of the Moin standard themes (modern,
classic, or rightsidebar) and avoid duplicating the existing css and
img files.

Back to your original point, the "common.css" files distributed in
htdocs/classic/css, ../modern/.., and ../rightsidebar/.. are all
different.  Maybe something along the lines of your suggestion could be
put on next year's "easy to do list".

Roger Haase


      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Moin-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/moin-user

Reply via email to