Formatting sharepoint calendar with custom colours not working

Judge, Jacqueline 20 Reputation points
2025-03-17T11:49:47.4566667+00:00

Hi

I want to use custom colours in my modern sharepoint list calendar view, and no matter which way I write the code and i've tried many iterations I cannot get the sharepoint list calendar to recognise anything outside the defined colour palette. has anyone else experienced this or found a work around for it?


Microsoft 365 and Office SharePoint Development
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 31,596 Reputation points Microsoft External Staff
    2025-03-18T06:51:23.3366667+00:00

    Hi @Judge, Jacqueline ,

    Good days! Welcome to Q&A forum!

    Due to current platform limitations, while SharePoint allows conditional formatting using predefined CSS classes, the calendar view does not fully support applying custom colors using specific hex codes.

    SharePoint's modern UI allows conditional formatting in the calendar view using specific CSS classes. These classes correspond to a set of predefined colors. For details, see: SharePoint Online CSS Classes

    So our recommendation is to leverage the predefined CSS classes provided by SharePoint for conditional formatting. Although this will limit the color palette, it ensures compatibility and functionality in the calendar view.

    Additionally, if this feature is important to you, we recommend that you submit feedback. This is the best platform to let us hear from you and make our products and services better for you and others. Microsoft values its customer feedback and a lot of features have been developed and suggested by customers via feedback.

    If I understood something wrong, please provide more details on the matter, including the code you used. If you have questions about the answer, feel free to contact us.

    And kindly consider accepting the answer if the information provided is helpful. This can assist other community members in resolving similar issues.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.