I think the Moodle style sheets should only change the formatting for tags that have been given moodle class names or ids. So for example don't give all table headers a coloured background but only those created by Moodle.
This easy copy-paste feature is praised among ULPGC teachers as a killer one. It saves lots of time. "traditional" teachers remain mostly "techno-skeptic", providing an easier path is essential to get them to this new world. A fantastic selling point is if you offer a solution that actually saves time/work with respect to the traditional one .
- Enrique -
What Gustav says is that appearance will not be maintained. Some colors change, some fonts. Minor points, but some people is really insistent on that points. They do not understand that Web is not a printer.
Advanced teachers know that HTML is a tagged syntax, and know <b> and the like, or that images are linked and not embedded. But few realize that actual rendering takes place in each browser, and you have little control on it. They want the Web to behave as a printer or PDF: once created a page is the same ever for everybody. Even the reddish-violet color tone they have been an afternoon deciding upon, and no other monitor on the whole earth can reproduce exactly!!
Explaining CSS to people without HTML-writing experience is a torture. That's why the former CSS, less-extensive, was more forgiving in this aspect.
Given the work that is going into the new themes, I think it is worth to have it well done, well polished. This is a minor point, not adding bell and whistles, but were Moodle has another opportunity to let shine its careful design.
- Enrique -
If you don't want this to happen, you can easily add new entries into your own theme to override the Moodle styles within any modules or pages you like.
- It does NOT look good to make all table header cells use the coloured background. It also does NOT look good to make all headings centered.
- When a teacher has prepared some content externally and then pastes it into the HTML editor to appear on Moodle the teacher really doesn't like it if his formatting is changed and he has no easy way to override it.
Headings
Headings should be easy to change since they all (should be) using print_heading() so I can add a separate class to the <h2> and make the style sheets use the "h2.main" selector rather than the plain "h2" (or not, depending on the theme-maker's preference). Easy to do and now done.Tables
I don't think tables will be so easy, since they are not all done with print_table() - there will be lots of hardcoded <th> tags around the place, I think, and I for one don't have enough time or inclination to change that right now, especially since it is fixable in your own theme if you really want to do so. All you need to do is add a selector to your theme that targets, say, <th> tags within the discussion displays or the resource pages.Finally, the HTML editor adds style tags that override all the stylesheets (eg see heading alignment in this post).
I'd appreciate some hunting by others (in latest CVS) to produce a list of table headings around the place that used to have the gradient backgrounds and now don't.
The idea of all this is that my preferred way and Gustav's way are as easy as possible to implement, so the theme designer can choose.
Re: the table headers
I was just about to 'fix' this problem too, though I'm coming at things from a different position from Gustav's.
I'd noticed that just using th
in the CSS to style table headers, affected all table header cells in the entirety of a Moodle site including those in user entered content.
I thought this was a bug because the style applied made the tabular content look like part of the Moodle interface (gradient background etc.) rather than part of the user entered content.
And talking of table headers, in the current style sheet system, the standard theme plays a dual role as a scaffolding for other themes and the default (and much nicer on the eye, imho) theme. Will these roles diverge into two sepearate themes, one with the basics and sensible default values designed to be overriden and another with the niceties, 'personality', and elements that require a bit of work to create and change (e.g. gradient backgrounds) of the standard theme?
At the moment you have to undo a lot of things before you can add your own styles e.g. changing the color of the table headers doesn't work because there is a background image over it. You need to both change the color and set background-image: none
. It's also confusing, if you base your new theme on the default one nad start modifying it, that deleting styles has no effect as they are all duplicated.
td {
color: #ff0000;
}
Now, a lot of td's are not red. It's not the fault of the style or Moodle, just the way CSS works. If there is a style in the standard style sheet like
#contentblock td {
color: #00ff00;
}
then all these are blue though I thought I said that all TD's should be red.
color: #ff0000 !important;
}
But it's a bit funny to have all of my own styles with the "!important" at the end
While on a coding mode, I read "!important" = "not important"
th.header {
background-image: none;
}
There may be a standardwhite later but standard really is meant to be very plain.
Will that actually work? I've not tried it but thought, from a brief poke around, that the gradients were defined in multiple places with various levels of specificity (e.g. there's three references to gradient.jpg in styles_layout.css
)
But it wasn't the amount of work for someone who knows what they are doing that bothered me (though I'll come back to that), it was more the surprise of someone who knows a bit of CSS and is savvy enough to duplicate and rename the folder and then starts to explore by changing things--finds that doing so works as expected--and then gets confused when deleting things from the CSS doesn't appear to have any effect.
Splitting it into two says clearly: here are the things you can and should change, and here are the things that you shouldn't (unless you really know what you are doing) and allows both deleting and changing of a line in the CSS of a duplicate of the standard theme to have an instant and obvious effect.
The other thing that I thought would be a roadbump for HTML/CSS hackers is the styles.php. I looked at the function in weblib but I'm still not sure what it's doing. Perhaps there is a way to do it with standard HTML/CSS techniques, in a way that would make sense to CSS jockeys.
Returning to the issue of effort to override, the one thing that did seem a lot of effort to get rid of was the Mozilla specific rounded corners. I was trying to duplicate the look of my University's front page (which doesn't use rounded corners) in a 1.5 theme, and eventually had to delete the styles_moz.css
from standard theme as the thought of going through and neutralising each one in turn made my heart sink. (It also doesn't help that styles_moz.css
prevents you from validating your CSS files as it uses non-standard CSS rules.)
Sorry, this turned into a bit of a mad ramble, I should really start threads as these ideas come to me.
In your own theme/config.php do this to leave out the Mozilla stuff:
$THEME->standardsheets = array('styles_layout', 'styles_font', 'styles_color');
I think coming up with a standard that allows ANY new superimposed styles to instantly work is going to be a bit tricky to get done ... particularly given the workload remaining in just getting basic stuff working for 1.5 and the small number of hands working on it, but I'll keep it in mind.
Hi David and all,
"At the moment you have to undo a lot of things before you can add your own styles e.g."
This is the reason why I used the very wise feature to turn off cascading for the theme "orangewhite".
The 1.5 CSS cascading approach opens a wide variety of possible uses of CSS files. You find all settings needed in config.php:
- you can specify the CSS files to use and the loading order
- you can switch off cascading of the standard theme's CSS files completely
- you can rely on any self defined "parent" theme - good for small changes
How to make some easy changes will be demonstrated and documented with some "child" themes of the standard theme like for example "standardwhite".
Here is the complete CSS code now for standardwhite:
th.header,
td.header,
div.header {
background-image:url(gradient.jpg);
background-position:top;
background-repeat:repeat-x;
}
#nav-bar {
background-image:url(gradient.jpg);
background-position:top;
background-repeat:repeat-x;
}
I like how Firefox, for example, handles clean HTML. You might have extravagant styles with CSS, but if you copy'paste stuff in Firefox from a clean HTML/CSS page to MS Word, you get the MS Word default styles for everything. Then, if you apply your own template, you get everything the way you want