To, well, more colorful, not sure if I’d call this awesome or not (my color matching skills are lacking)

If you haven’t noticed, there are some colors which are really close to each other, and could easily be mistaken for each other. It’s rather frustrating. Also, they’re all pastels, which is nice but what if I want it to pop on the page?

You can setup a custom style sheet on your calendar page to override the colors. Unfortunately, this will not change the colors at the time you setup the calendars. To keep your colors straight, here’s the colors, and their associated values:

Light Yellow, #fef8d6, Color #1

Light Green, #d0ffbc, Color #2

Orange, #feebcd, Color #3

Light Turquoise, #c8f0ff, Color #4

Pink, #ffc8e8, Color #5

Light Blue, #bee5ff, Color #6

Ice Blue, #e0e8f2, Color #7

Ice Blue, #d9dde1, Color #8

White, #f2f2f2, Color #9

See the close similarities? 1 and 3; 4 and 6; 7, 8 and 9. You only have 5 unique colors to work with.

As you create your color coded calendar, make note of the color #s you’re using, this will be important when creating the new color scheme. And since we’re talking about color schemes, I highly recommend using a comfortable color scheme. You don’t want your calendar to hurt your users. You may only want to change a few colors instead of the entire collection. There are a lot of color schemes and combos online, if you want to create your own, check out http://colorexplorer.com/. Take some time and figure out your ideal color scheme.

Now that you have your colors, let’s get started! First thing you want to do is follow my other post and make your color coded calendar, click here to open the post. Your end result should be a spread of drab pastel colors, like my first image on this post.

Okay, now that you have your color coded calendar, let’s change some colors! You don’t have to change every color in the list, or you may want to. Up to you. I’m going to change colors 3, 4, 8 and 9, and use some real colors that pop.

The above 3 classes of styles represent one color. The first class is the color you see when the page loads, and you haven’t clicked on the item. The second is the selected color when you hover on it. The third class is the color in the legend, on the left of the calendar view.

See at the end of the class name, before the {, is a #. This is just a place holder, you’ll want to swap this out with the color above you want to change. For example, if you want to change color 4, you’d update your CSS like:

.ms-acal-color4, .ms-acal-selcolor4, and .ms-acal-apanel-color4

You can copy and paste the CSS as many times as you need, for numbers 1 through 9. Within each section you’ll see BACKGROUND-COLOR: #xxxxxx, and in the last CSS you’ll see BORDER-COLOR :#xxxxxx as well. This is where your new color scheme comes into play.

Any scheme you find you’ll want to find the HTML, hexidecimal, or CSS value, for your colors (naming varies depending on the site you get it from). It’ll be a 6 character code, usually starting with #. Take the above CSS classes and create your new CSS classes using the colors your picked for your previously made calendar, and specify your own color palette. Here’s what mine will look like:

For the border color, I decided to go with a grey. Once you have your CSS together, let’s get it into SharePoint!

Browse to your color coded calendar.

Click Site Actions, then Edit Page. This will switch the page into edit mode.

Click Add a Web Part above the calendar.

Select Forms in the Categories from the top left, then select HTML Form Web part. Click Add

Hover over the web part and click on the web part menu, on the right

The task pane will appear on the far right. Click Source Editor.

Delete what’s in there now, and then type in:

<style type="text/css">

Paste in your CSS.

Type in at the bottom of the page

</style>

You should see something similar to

Click Save.

You’ll see your new colors appear!!

My text is hard to read. Fortunately from here I can use the full arsenal of CSS and change font colors, sizes, spacing, etc.

To change the font color, add the following for each color number you want to change (#ffffff is white, you could use any color you want here as well.)
.ms-acal-color3 div, .ms-acal-color3 div a, .ms-acal-apanel-color3 SPAN {color: #ffffff !important}

Click OK in the task pane to close it. Click Stop Editing in the ribbon to stop page editing.

And here we have it!

You can also modify the default light green item by adding these CSS classes. However, if you do, make sure to put it at the top of your CSS text, also, in my case here, any colors not using a new color scheme, like my pink PTO, will be changed to whatever color you put here.

Like this:

LikeLoading...

Related

Published by David Lozzi

David is a lucky husband and proud father of 4 beautiful children. He's a Microsoft Certified Professional and works at Slalom Consulting as a SharePoint Architect. He is an avid do-it-yourself'er, self proclaimed chef, all-around-technology geek, Christ follower, Lego builder, and desires to be more of an outdoors-man.
View all posts by David Lozzi

Unfortunately it appears the 10 calendar limit is an out of the box limitation. You might be able to via custom code, if it’ll let you override it, but I’d question performance at that point. More calendars the slower it may perform.

That’s what I had assumed too. I guess it would be relatively easy to update with some jQuery. It’s probably not worth it though.

Its funny how there’s inconsistencies like this throughout SharePoint. For styles in the ribbon dropdowns you can easily customize the title that appears using the “-ms-name” property. You would think this would be a perfect opportunity to do something similar.

Instead it’s based off themes. In my eyes you wouldn’t usually want the color overlays to change to match the theme, but I guess that depends on how you are using themes.

Thanks David, enjoyed the solution. Any way to change the color for each of the specific views that are displayed in the “Calendars in View” section so that when a user selects one of them, then don’t get the plain, uncolored calendar view?

Making some headway thanks…I’ll let you know when I’ve ironed out a few more wrinkles. In the meantime, have you an equally impressive solution for removing Sat/Sun from the display? Wasted, high-rent real estate!

David, this code below seems to work just fine. I have a total of 9 calendar views all displaying on one “master” calendar view via calendar overlay. The one below has its event displaying in #e34363 on the master calendar. When I now select that view from the “Calendars in View” section, it now displays the events in the individual view in the same color as the master calendar view. Plus it hides the list name (changes background, border and font) to the default #EEECEA so it doesn’t appear under “Calendars in View”. Finally, I added the “master” calendar view to each individual view for ease of navigation.

I am not a coder, but it’s fun to experiment! Thanks for your effort with this.

I am having some difficulty getting the colors to implement. I have the overlayed calendar all set per your previous post, but when I follow the directions in this post, I am not getting any results. I have double checked that my numbers are correct and CSS mimics yours with my own #s and hex. Is there anything else that I may have done wrong or may be preventing the colors from being modified?

Hi David i was trying this but after adding the Web part, forms, HTML from web part, something odd happened. I can’t see the edit ribbon for the calendar nither add a new event nor any other acction it is just disable. i’m not sure what the problem is and how to solve it, could you please help me.

Uh oh. That doesn’t sound good. What you can do is in the address bar, at the end of the URL, if there are other query string variables (i.e. ?var=val&var=val) add &content=1. If you don’t see query strings, i.e. pagename.aspx, add ?contents=1. This will go to a web part maintenance page where you can remove your web parts.

Hi David,
Thanks a lot for this. It really helped. And for others not seeing the colour change, Davids example code only changed options 3,4,8 & 9. Then make sure you refresh your view properly. The change in colours do happen.
However I have another question David I hope you can answer (and clearly form it you will tell I am not a coder but a cut and paster).
When I pull the consolidated calendar in via a webpart to another page the colours don’t ‘come with it’. Do I need to replicate the CSS within the page that will now contain the Calendar webpart?
Many Thanks

Hi Dave,
I’m glad I could help. And yes, you need to include the CSS on any page you’re creating the calendar on. Alternatively, you could keep the CSS in your master page or alternate CSS file, which would make the colors apply across your entire site. If this is of interest, let me know, I’ll walk through how to.
Thanks,
David

Hi David,
This does not work when you drop the calendar as a web part onto a page. You’re not able to add overlays when editing the web part and in any case all the events are marked with the same class (ms-acal-item) in the HTML no matter which overlay they are from so a css class would not help. Any ideas?
Thanks,
Darren

Hi Bill, Sure thing. I think the comment missed something ” I forgot the last step, to add , and now…”. Add what exactly? You can view all web parts on the page by going to Site Actions > Edit Page. If a web part is hidden, it should should up in this view. Let me know. – David

Thanks for getting back to me so soon. I meant to say that I forgot to put in at the end. Now the when I click calendar in the navigation a blank page shows up. I can click the color coded views to see them but the combined view is gone. And when I click Site Actions on the blank page, it wont give me the drop down list any longer. Very strange! Any other ideas?

ok, I was able to modify the code through designer and the calendar has come back. Sorry to be a pain, as you can probably tell, I am new to this. The only issue I have now, is that all calendar items were duplicated. One of each in white and their respective colors.

Hi David – I am having the same problem as Bill did. The problem occurred because I was not following directions properly and I only typed into the web part html box before I hit save and nothing else.

Now I cannot go to Site Actions>Edit page to remove the web part, because the Site Actions menu no longer drops down. In fact, none of the drop downs on the page work anymore, including ‘Support’ and ‘Tools’.

I have checked in SharePoint Designer like Bill explained, but I can’t figure out what he did to fix it. Can you tell me where to go in SharePoint Designer to just remove this new web part and put my calendar back to normal?

Hi David, I created the calendar overlay using your instructions (thank you) and assigned colors to various calendars. The calendar overlay displays the event entries with the colors assigned to those calendars, but the shortcut links (legend) on the left navi pane are not color coded, they are all clear. Do you know why the legend shortcut links are not color coded similar to the colors assigned to the associated calendars? Thank you!

Hello David, thanks for this help! I hate identifying sharepoint CSS classes, so you’ve saved me (and a lot of people!) a lot of time.
I’ve implemented your solution, and it is only half-working for me. The left-nav that shows each of the calendars in the view is correctly colour coded, but the actual calendar entries are not. I can only assume it’s because there is a delay in rendering the calendar items – by which I mean, the ‘body’ of the calendar is rendered a little bit before all the events appear. They do correctly change colour when an event is clicked, though!
I’ve tried moving the css to a jQuery function that’s called on document ready, but still no joy – a sample alert shows this being called before the calendar events are rendered.
Any ideas?

Hi David, thanks for all your info. I’ve got it half working. I started with my calendar. Created overlay’s for each view i want to show in a different color. Then I created a calendar webpart on my main page, here I did your source code with my colors in the html form above that calendar web part. It works, though I don’t have a legend. My problem is, when you go to the calendar I can’t get my code changed there. So it might be one color on my web part, but then the calendar page had a different color. I don’t see where you can add a webpart to the calendar page. I also tried editing the calendars default form web parts, but that did nothing. Please help, where am I going wrong?

I’m not sure how I could have missed that yesterday. It had only come up as a list. Thank you very much for your help. Now I’m trying to figure out how to change the text color. I need to make some white and some black. Is this just a one line html for each of my nine colors, or do I need to add 3 more lines per color? And if you could send me the code it would need to be. Currently I have for this for one color. .ms-acal-color1{ BACKGROUND-COLOR: #8B0000 } .ms-acal-selcolor1{ BACKGROUND-COLOR: #8B0000 } .ms-acal-apanel-color1{ BORDER-COLOR: #C3B7AC; BACKGROUND-COLOR: #8B0000; } Sorry, I’m not a coder. Thanks

Thanks again David, you rock. Ok, I added the text color line and it changed it for all the colors. Which works ok, but what should I do if I want one or two of the colors to have a different text? Where would I put that code and would I need to change the other one line of text code?

Correct, I have a mixture of dark and light colors, the white text color looks good with almost all, but I have one lighter background that needs to have a dark text. I did notice that the html only changes the web part, how would I actually change it in the pages, so when I create the overlay, I can select the new color options, rather than the standard on sp? When I display it on the page, it’s the new color choices, it is just when I’m creating the overlay I have the old options.

I tried (replacing the X with 5 for color 5), I was able to get the one light background have black text, but it does not show up as black text in the Legend. I also tried this for a second line color that also was light and I just copied and pasted the code, but changed the 5 to a 6. It didn’t change the text for my color6.

David, I’m sorry for not knowing coding. I know this is supposed to be simple. How and where did you move the default text color CSS? I thought the 5 after the color was the number of the color of text I was trying to change. I’ll remove the 5, but if you could let me know about the default text. Thanks so much, Tammy

David, I was able to get it to work and added it to each line I wanted to change the color of text for. The weird thing was, when I took the 5 off of {color5: it fixed my problem in the legend, but then the event name was in the new color, but the time was in a different color, but that was not the case in the other line. The code was the same for each, but the other happens to match with the time color. If that makes any sense.

Hi David!
I found your site to be very helpful. I’ve been working on Conference Room Availability page that contains 6 individual conference room calendars (they are shown in a small scale on the right side of the screen) and then on the left side of the screen (the larger portion of the screen) I have the main calendar showing all of the reservations (an overlay calendar). Anyway I created the 6 individual calendars, the overlay calendar and applied the colors with no problems (thanks to your wonderful post). But I do have an issue where the colors from the 6 individual calendars are not coming through on their webparts on the Conference Room Availability page, however, if I click on the individual calendar I can see the colors on the actual calendar page. Now I went in to the webparts on each of them and made sure the view was set to Calendar, but that didn’t work. Am I overlooking something??? Any help would be really appreciated!!!

I’m glad my post has been helpful. I’m not sure what you’re looking at exactly. Could you send me a screen shot of the page? That may help clear things up. You can email me at david.lozzi at slalom.com. Thanks.

I’m glad my post was helpful. Unfortunately the overlay feature is not ‘movable’, you have to manually configure it per page you want to use it on. It’s rather annoying if you have lots of pages and views. HTH

I lied, it is movable. Well, what you need to do first is create the overlays on the list’s view, not in a web part, but navigate to the list and add overlays there. Then, when you add a web part, you can modify it to select a view, select that view with the overlays and that should carry over the same settings. You will need to reapply the color changing CSS to the new page however. HTH

I’m agreeing with Jennifer. My brain hurts. So I ended up finding a js for color calendars that have the ability to select and deselect overlays on the calendar page. My problem is the html (css) that we came up with for my calendar (no longer works for my web part on the main page) Any ideas?

Hi David. Very interesting! But what if I wanted to change the vertical lines running through the calendar to be different from the background of the inside calendar…I’ve changed just about every other color BUT this border-color. – rootdiv to vcont to ms-acal-header. I apologize if this is too off-topic! I enjoy your site.

Hi David,
Thanks heaps for your work on calendar views and customising colours. One thing that I have noticed is that I no longer have the calendar tools ribbon at the top of the master view. It is available on each overlay view however. Is there a way to have that back?

David,
I have the same problem with my calendar. But if I click somewhere within the calendar or just above the ribbon appears. I was just told this was a drawback of using overlays. Is that not correct?

David, Thanks for helping so many of us with this issue. I’m having a problem that occurs after I click the Source Editor button, paste in my CSS code, and then click Save. After that the color changes do appear in the legend on the left of the calendar, but the actual calendar disappears (the boxes with the days of the month, etc.) Also my ability to access any other controls on the page goes away. All of the buttons and menu choices are unresponsive (including the Stop Editing button, all other controls at the top of the page, the drop down menu to get to the Source Editor, etc). Do you think my CSS is invalid? I basically did a copy and paste from your example with the only changes being the color numbers.

Now I’m wondering if there’s a way to display my color-coded calendar on my site’s home page. When I add the calendar to my home page, it displays in the default “blah” colors and when I add the CSS web part to the page, it changes the colors but calendar items aren’t categorized so as a result, they don’t display properly. In other words, is it possible to add the calendar (along with its views and overlays) to a site’s home page?

I don’t know if its just my environment but when you add a HTML Form Web Part or a Content editor web part to the main calendar page, the page no longer has the calendar tools at the top or even the ability to change the calendar view in the breadcrumb. To bring up the calendar tools, all I need to do is click on the calendar. Previously, it would just show up when the page loaded by default. I’m really concerned about the “view arrow” disappearing in the breadcrumb to change the view. Is this happening for you?

Please can you point me in the direction of a good guide for SharePoint scripting – I have created the colour coding (thank you) but don’t know where to start adding this script to stop the new window :-)

Thanks so much for the instructions. Unfortunately, this only changed the colors on the left side (list of “Calendars in View”) without changing the colors on the actual calendar itself. Could you provide some assistance? Thank you!

Thanks a lot for your instructions, which I followed and it works fine… the only thing now is that I would like to see the same color scheme used when I edit the calenders in the Overlay settings. Here still the original colors are displayed. How can I make them match?

David,
I have a requirement to add 10 calendars in overlay calendar – which i was able to do.
Now if we can add 10 calendars, why do we have just 9 colors available ?
Can I add 10th color in my custom css file ? even if i add i will not be able to add it to any calendar.

Hi Jessica. The color numbers as noted above directly correlate to the colors selected from the picker. It doesn’t matter what order the calendars are in, it relates to the value selected for the color.

Thanks for this post. I was able to successfully modify the colors of my calendar overlays. The one issue I’m still having is using your last bit of code to modify the default calendar color. When an individual calendar overlay is clicked (opening a new calendar without overlays), the color changes back to the default color. I’m trying to change this default color within each overlay to match the color I chose on my main calendar with all overlays applied.

The issue I’m having is that when I use the below code, I’m not getting any boarders to show up around my calendar events:

The problem has been fixed by adding:
.ms-acal-sdiv a, .ms-acal-mdiv a, .ms-acal-ddiv a {
color: #000000 !important
}
I am running SharePoint 2013, and I use Content Editor webpart to call the css file.
Thanks again for the helpful info.

Hi David, thanks for your helpful post. I have implemented the colour overlays and they work fine. I have one problem; the ‘Calendars in View’ key on the left doesn’t show the correct colours, they are all the same. Is there a way to get the menu to match the actual overlays? Many thanks…

Hi David , i followed every step you described up till the part where i needed to save the web part. For some reason i kept getting a dialog box saying ” Can’t retrieve any properties at this time” followed by another that says my changes cannot be saved. My calendar has 8 views

Thank you heaps for your brilliant article, and for patiently replying to everyone.
I’ve come across two issues, the first I resolved, where I was getting the …” Can’t retrieve any properties at this time” when using the HTML Web Form web part. I tried the Script Editor web Part instead and it worked correctly. What I have found with the ledger is, if I select one of the options on the left, it displays the events in the correct view/category but it returns to the default colour of the site theme (pink). Any ideas on how I can retain the same colours used in the default view?

In addition to what you provided; I also add the ability for the calendars to expand to show all events automatically and each calendar that feeds the overlays have had their colors adjusted to match.
Similar to GovGirl (25Mar13) I am using the calendars to manage 16 individual conference rooms. We have small 4 person rooms that are grouped by floor and larger meeting rooms that are also grouped by floor. I have two rooms (classroom and a privacy room) that stand alone but have included them in the color sequence.
And your tip makes a huge difference in how things look (much better then the out of the box colors).
My problem now is that as soon as I set the calendar for Resource Reservations I lose all events and am unable to scroll the page. As soon as I change the settings back the items appear.

Hi there. I used the code that you had and it worked perfectly in the calendar page. My issue is that I have the calendar embedded on the homepage and I would like for the color code to be the same. Unfortunately it says that the web part change won’t be applied to the homepage. Do you know of a work around for that?

I encountered a strange behaviour when adding the CSS via some web part before the calendar. My colours looked fine while editing the page but returned to something else when viewed normally. I have to use the IE8 (sic) but managed to work around this thing.
I just had to place another web part (even hidden works) before the CSS injector. Any list did it.
Thanks a lot for your detailled posts.

Hi David, love your articles and this one has really helped me. Is there any way to change the leftside Default Calendar legend text ? Its the very first one in the order. I think this is named according to the Calendar list name but I want to change the text in the legend only. Using DOM I can see that the class is called “ms-acal-apanel-item ms-acal-apanel-color”. Not sure how to add the code to do this and would appreciate if you had any advise. Thanks heaps.

This worked beautifully for me. I was so surprised as I am NOT a programmer.

Now my new COLORs are too dark for the title color. So, now I need to change the font color of the title. However, what I noticed is that there are 2 colors associated (HOVER color and the TITLE color). I think the hover color of the text is fine but the TITLE color needs to be made darker so I can see it with my new and darker color coding colors.

I saw a post and your reply to use: .ms-acal-color# .ms-acal-title
Would I then do this? .ms-acal-color#000080 .ms-acal-title ?
Where would I insert this code? Would I put it in between and in the current HTML webpart? Would I add a new webpart?

I’m glad this worked for you!! For the text, you should select the number of the color selection you’re using, like .ms-acal-color1 or .ms-acal-color8, etc. Then use that to set color: #000080 in that class. Something like

Hi David,
As a few people have mentioned above, I am unable to get the font color on one of the overlays to change from white (the default) to black. I inserted the code below for the font color that I am trying to change. Color 6 is yellow and is displaying with white font and I need black.

Take a look in the article again, there’s CSS there for the font color. Also, search this page for font in your browser and you’ll find other comments around fonts. A few people have figured it out as well. Feel free to email me your CSS david.lozzi at slalom.com and I can take a look.