This is the relevant entry in CSS for the theme:
html
{
font-family: Verdana, Arial, Helvetica, sans-serif !important;
font-size: 80% !important;
background-color: #fbaa1e;
color: #2171a9 !important;
}
The problem is that if I change #fbaa1e to #ffffff, this change also affects the background of the "surround" of the site which also uses that colour. This is a fixed width theme and the "surround" is the area that is displayed outside of the main site area if the monitor resolution is wider than the theme.
How can I change the chat pane background for chat only?
Hi Ray,
Nice to bump into you again here ; ) Hope things are well with you.
Not sure if I have understood exactly what your aim is as I am not familiar with your custom theme. Plus I am still learning how Moodle works ; )
If you wish to change the background colour of the chat pane to a different colour to that of the background colour of the main site like this:
Then you need to specify the css for the specific chat page using its id:
#mod-chat-gui_basic-index
..as otherwise I think the colour is inherited from the global body background colour.
So if you want this lovely yellow colour ; ) then in your custom css file for the theme you need this rule:
#mod-chat-gui_basic-index {
background-color: yellow;
}
Hope this helps.
~thomas
That didn't have any impact at all on my chat pane. I noticed a silly error in my attempts yesterday, having corrected that I've achieved the effect below.
Any ideas why your solution didn't work for me?
Edit: It works in the non-JavaScript chat option.
For the javascript version you need #mod-chat-gui_header_js-jsupdate
Jon
Getting closer... see below.
CSS is:
#mod-chat-gui_basic,
#mod-chat-gui_header_js-jsupdate{
background-color: #ffffff;
}
#mod-chat-gui_header_js-chatinput{
background-color: #ffffff;
}
#mod-chat-view #chatcurrentusers {
background-color: #ffffff;
}
What else can I do to get an all white background?
Try
.chat-event{
background-color: #fff;
}
.chat-message{
background-color: #fff;
}
Jon
edit----
You could also try...
body#mod-chat-gui_header_js-jsupdate{
background-color: #fff;
}
I used Firebug to inspect the CSS initially. This gave me the following for the chat pane background
html
{
font-family: Verdana, Arial, Helvetica, sans-serif !important;
font-size: 80% !important;
background-color: #fbaa1e;
color: #2171a9 !important;
}
I'm stuck. Perhaps there's no way to make this a different colour.
hth
Frank
I tried both of those, but I get the effects in the screen shots above.
frame html body{
background-color: #fff;
}
work?
I'm afraid I don't have access to a Moodle install to check this on so I am stabbing in the dark a bit!
I will have a look at work tomorrow if I get a minute and see if I can figure it out (My custom theme does the same btw).
Another tricky area on my theme is the message pop-up. Is that OK on your custom theme?
I did some poking myself using the Standard theme, see screenshot.
The background-color seems to be inherited from the standard CSS for each of the frames body tags (magenta and blue in the screenshot) and the form tag (green). By using "!important" you can override those settings.
hth
Frank
I can make the changes using Firebug but how do I make them local to the chat pane?
The easiest way to find out is looking at each frame'e source code (with your browser's function or Firebug) which CSS style sheets are linked by your theme like so:
<link href="http://moodle.org/theme/standard/styles.php" type="text/css" rel="stylesheet">
Then you can do a search to find the CSS rule your interested in and modify that rule.
The line numbers Firebug shows are mostly of not much use because they pertain to the aggregated CSS Moodle sends to the browser and not the actual line numbers of the files on the server.
hth
Frank
Unfortunately I don't seem to be able to make the change to the background so that the change is only applied locally i.e. in the chat pane.
I've not had chance to move this n since my last post. If I get the desired affect I'll post here and in Docs. Hopefully before 2.0 when this will no doubt change anyway.....
One solution might be to give the chat window a specific id for selecting it with a CSS rule. But that might make some modifying of PHP code necessary.
body.mod-chat-gui_header_js {
background-color: fuchsia;
}
Make sure that your theme's config.php file contains the following section:
$THEME->modsheets = true;
When this is enabled, then this theme will search for files named "styles.php" inside all activity modules and include them.
Theme config file#Mod sheets
hth
Frank
Frank,
I think I must be missing something with that!
I created the style.php file in the chat mod folder and copied your css into it.
Checked that my theme has modsheets set to true.
Yet still no change...
What else do I need in that php file?
Jon
Glad it worked.
What I found useful when trying different solutions was deactivating your browser's cache while changing the CSS. Otherwise the cached version is still used and not the current modifcation.
The easiest way to do that is using the Web developer extension for Firefox which comes with such function.
Cheers,
Frank
PS
If you want to give your own CSS a little more punch use "!important".
Thanks anyway.
Hi Ray,
Maybe I have misinterpreted what you are trying to achieve?
I thought you just wanted the chat window's background colour to have it's colour set independently from the background colour of the main (underlying) Moodle site?
->Click here to enter the chat now:
Pops up a new chat window with a different background colour:
The above CSS allows you to do this. Or is it something else you wish to achieve?
~thomas
That's exactly what I'm after. There must be something in my custom theme that's preventing it.
Hi Ray,
Have you tried adding Frank's CSS into your custom theme's CSS file? That is what worked for me.
Jon
Yup. I've tried everything that's been suggested in this discussion. See below for the current look.
Nothing beats looking a the live site when doing CSS troubleshooting
I think I found the culprit: Your background color is provided partly using an image: background-image:url(pix/rshadow.gif) That will override setting background-color.
So try adding "background-image: none !important;" to the above solution.
hth
Frank
PS
Could you perhaps provide guest access to your site?
I had a closer look at your CSS:
/***
*** Modules: Chat
***/
#mod-chat-gui_basic,
#mod-chat-gui_header_js-jsupdate{
background-color: #ffffff;
}
#mod-chat-gui_header_js-chatinput{
background-color: #ffffff;
}
#mod-chat-view #chatcurrentusers {
background-color: #ffffff ;
}
/***** HowToMoodle_theme/ray.css end *****/
You use the "#" selector which is for ids where those are classes for which you have to use the "." selector (see my solution above). I think that's the solution.
Forget my posting about background images
Frank
I've copied the theme to another site where I can give you access.
I'll message you with login details
The background color must be inherited from high above because the brute force method, deactivating all background settings by first using
* {
background: none !important;
}
did work. Of course this unset also the main window's background...
After some trial and error I found that this modification of my proposed solution from before worked:
html {
background: none !important;
}
body.mod-chat-gui_header_js {
background-color: blue !important;
}
Cheers,
Frank
Added to Docs here: http://docs.moodle.org/en/Theme_scrapbook
And thanks for adding this to the Theme Scrapbook of which I wasn't aware until now. I added a link to this thread as some might find other points of the discussion useful in a similar situation.
Frames are deprecated in XHTML and can be replaced by more accessible layouts.
So I suppose we have to keep struggling...
Cheers,
Frank
I think there is still some tweaking to go... ;)
If we can crack the Chat pane issue it will be an excellent snippet for Docs.