From: Shaun M. <sh...@ae...> - 2004-08-30 11:49:14
|
On 29 Aug 2004, at 21:21, Mike Noyes wrote: > On Sun, 2004-08-29 at 12:29, Shaun Murray wrote: >> On 29 Aug 2004, at 19:07, Mike Noyes wrote: >>> >>> http://phpwebsite-comm.sourceforge.net/temp/ >>> >>> Any comments and/or suggestions are welcome. >> >> That works although I don't see why you hang everything off a div, >> it's >> unnecessary and introduces an arbitrary structure into a document that >> need not be there. > > Shawn, > I think you missed the global div styles for menuman. Extending menuman > styles to use variants (vertical, horizontal, tabbed, rollover, etc.) > required the double class. At least that was the only reasonable > solution I found. > Nope, I didn't. You can still have <ul class="menuman horizontal"> if you want. It makes more sense than using divs to me most of the time although it may not fit in with getting it to work easily with phpWebSite. I also wonder what happens when you've got multiple templates? eg. Announce has a view_small.tpl and a view.tpl which both have menus in. Do you define two classes so that each template view can be styled differently? Using the module name wouldn't let you have two different menu styles defined so I guess you'd have to use a content variable as the class? >> Instead of >> >> <div class="menuman horizontal"> >> <ul> >> ... >> </ul> >> </div> >> >> Just use >> >> <ul class="horizontal"> >> ... >> </ul> >> >> then in the css define >> >> .horizontal ul { ... } > > A global class name of 'horizontal' isn't very descriptive, and can > easily cause a conflict that is resolved improperly. I believe > specificity is very important when dealing with multiple stylesheets in > this proposal. > I agree, but I'm trying to make them non-module-specific. I want to avoid having to define a 'horizontal' class for every module. It should be defined just once and work through all modules unless the theme designer has chosen to override them specifically for a module by building in an extra style sheet for the theme or module. I really think we should avoid as much as possible multiple spreadsheets. I really, really, really don't want the default behaviour to be that module developers have to provide a stylesheet by default. The problem with that is that you're then setting a precedent that the style is set locally in the module and not globally by default so each module developer will set their styles up differently to each other. Whereas that's powerful, it's also hard work for a theme designer, site maintainer and prone to errors. It's a lot of duplication too. I think that means there should be... .horizontal ul { list-style-type: none; display: inline; margin-left: 0; padding-left: 0; } .horizontal li { display: inline; padding-left: 0.5em; padding-right: 0.5em; } ...in the persistent style sheet which provides a basic menu. It's then overridden in the theme's stylesheet which is loaded after the persistent style sheet. if you want it more fancy. eg. .horizontal li { display: inline; background-color: gray; padding-left: 0.5em; padding-right: 0.5em; } And if you want it different just in a module then you stick it in the module's stylesheet and stick a module class in the template also, probably in a div surrounding the whole shebang though it need not be. eg. .menuman .horizontal ul { ... } That gives you basic functionality with no theme stylesheet and no module stylesheets - ie. just one stylesheet. It's then easily overridden for different media, like print or PDAs. "horizontal" isn't a very good gobal classname, no. I just used yours so you knew what I meant. I think you might have persistent and preferred the wrong way round also as preferred.css looked more like a persistent to me. ;-) With menus, I think it's something that should be as global as the boxstyles templates so that you can style menus in one place and they get used everywhere. If you want something special for a module then they can have your own module menustyles although I imagine if they are nice enough, they'd make their way into the global menustyles. >> If you want special treatment in a particular mod, then enclose the >> content in a <div class="menuman"> </div> in the template, and the >> mod's stylesheet will cascade the specifics. > > I'm still learning things about cascade, so I might well be wrong. Who isn't? I spent ages last week designing some css only to find I couldn't get it to work on Internet Explorer again. Most annoying. Then came across a new css hack I'd not seen before. CSS isn't simple so we have a duty to make it as simple as possible. I'm messing around with different menu styles at the moment, showing what can be done with a simple unordered list and working out menu states and if you need other classes. I think you need an 'active' class and a 'first' or 'last' class at least. It might get more complex with multi-level too. I was hoping to have this finished a while ago but paying work got in the way. http://www.aegisdesign.co.uk/examples/pwsmenu/ The html is exactly the same on each variant bar a class name for the ul, only the css changes. It's not then too much of a stretch to imagine a php function generating the html from a template when passed an array and a menu template name. The html is in /templates along with lists and img_gallery. I think perhaps boxstyles should be in /templates also if we're tying the whole thing up.. Shaun aegis design - http://www.aegisdesign.co.uk |
From: Mike N. <mh...@us...> - 2004-08-30 19:26:52
|
On Mon, 2004-08-30 at 04:49, Shaun Murray wrote: > On 29 Aug 2004, at 21:21, Mike Noyes wrote: > You can still have <ul class="menuman horizontal"> if you want. It > makes more sense than using divs to me most of the time although it may > not fit in with getting it to work easily with phpWebSite. Shaun, Prefixing selectors that originate in module css thus making a descendant selector module set, is the main thrust of this proposal (e.g. .pagemaster, .menuman). I agree I probably went overboard with div, but I wanted to show structure in the prof-of-concept. > I also wonder what happens when you've got multiple templates? eg. > Announce has a view_small.tpl and a view.tpl which both have menus in. > Do you define two classes so that each template view can be styled > differently? Using the module name wouldn't let you have two different > menu styles defined so I guess you'd have to use a content variable as > the class? That's left to the module developer. They have three choices: A) Use a style defined in another module Note: core modules are the only ones guaranteed to be available in all installs. B) Use a style defined in another module, and modify it. C) Create a new style > I agree, but I'm trying to make them non-module-specific. I want to > avoid having to define a 'horizontal' class for every module. It should > be defined just once and work through all modules unless the theme > designer has chosen to override them specifically for a module by > building in an extra style sheet for the theme or module. Ah. We differ here in structure. > I really think we should avoid as much as possible multiple > spreadsheets. I really, really, really don't want the default behaviour > to be that module developers have to provide a stylesheet by default. > The problem with that is that you're then setting a precedent that the > style is set locally in the module and not globally by default so each > module developer will set their styles up differently to each other. > Whereas that's powerful, it's also hard work for a theme designer, site > maintainer and prone to errors. It's a lot of duplication too. How much duplication we experience is a function of coordination/cooperation. If all the css is contained in preferred and persistent style sheets, how would additional module installation or upgrade be handled? For a dynamic modular cms to function, I believe module style sheets are necessary. > That gives you basic functionality with no theme stylesheet and no > module stylesheets - ie. just one stylesheet. It's then easily > overridden for different media, like print or PDAs. Can you work up a prof-of-concept for this structure? > "horizontal" isn't a very good gobal classname, no. I just used yours > so you knew what I meant. I think you might have persistent and > preferred the wrong way round also as preferred.css looked more like a > persistent to me. ;-) I'm still trying to figure out what styles belong in each. The main thing is making sure alternate stylesheets work for WAI purposes. > With menus, I think it's something that should be as global as the > boxstyles templates so that you can style menus in one place and they > get used everywhere. If you want something special for a module then > they can have your own module menustyles although I imagine if they are > nice enough, they'd make their way into the global menustyles. In my proposal menumaker.css specifies default menu style sets/types. Unfortunately, menumaker isn't a core module. > > I'm still learning things about cascade, so I might well be wrong. > > Who isn't? I spent ages last week designing some css only to find I > couldn't get it to work on Internet Explorer again. Most annoying. Then > came across a new css hack I'd not seen before. CSS isn't simple so we > have a duty to make it as simple as possible. Agreed. > I'm messing around with different menu styles at the moment, showing > what can be done with a simple unordered list and working out menu > states and if you need other classes. I think you need an 'active' > class and a 'first' or 'last' class at least. It might get more complex > with multi-level too. I was hoping to have this finished a while ago > but paying work got in the way. > > http://www.aegisdesign.co.uk/examples/pwsmenu/ > > The html is exactly the same on each variant bar a class name for the > ul, only the css changes. > It's not then too much of a stretch to imagine a php function > generating the html from a template when passed an array and a menu > template name. The html is in /templates along with lists and > img_gallery. I think perhaps boxstyles should be in /templates also if > we're tying the whole thing up.. This is a very good example for menuman.css. -- Mike Noyes <mhnoyes at users.sourceforge.net> http://sourceforge.net/users/mhnoyes/ SF.net Projects: ffl, leaf, phpwebsite, phpwebsite-comm, sitedocs |