Can we add CSS to SharePoint Group Site Template

Krishna 61 Reputation points
2020-12-08T04:27:44.573+00:00

Hi ,
We have a SharePoint Online site with Template GROUP#0 i.e. Office 365 Group associated Team Site.
I wanted to add Custom CSS to a Calendar list. I am unable to see Content Editor Webpart or Script Editor webparts.
I have enabled Publishing features as well.
Do you know is there a way to add custom css on top of calendar.

Appreciated your help!
Thanks

Microsoft Office Online Server
Microsoft Office Online Server
Microsoft on-premises server product that runs Office Online. Previously known as Office Web Apps Server.
585 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,624 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,573 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,016 Reputation points
    2020-12-08T07:43:38.093+00:00

    Hi @Krishna ,

    You need to allow custom script on your sharepoint site to add Content Editor Webpart or Script Editor webparts. Please refer to this article for more: allow-or-prevent-custom-script

    You can allow custom script on a particular site immediately with the below powershell command:

    Connect-SPOService https://tenant-admin.sharepoint.com  
    Set-SPOsite https://tenant.sharepoint.com/sites/yoursite -DenyAddAndCustomizePages 0  
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


2 additional answers

Sort by: Most helpful
  1. Trevor Seward 11,681 Reputation points
    2020-12-08T17:47:12.55+00:00

    Manipulating the DOM, thus CSS customizations, are not supported with Modern sites. You would need to otherwise use an SPFx solution but as Microsoft may make changes to the DOM at any time, you shouldn't expect any CSS changes to function indefinitely.

    0 comments No comments

  2. MichaelHan-MSFT 18,016 Reputation points
    2020-12-09T04:07:07.807+00:00

    Hi @Krishna ,

    Another workaround is to change the Alternate CSS URL in Master Page. This needs to enable publishing feature.

    1. Upload your css file to a library.

    46419-image.png
    2. Go to site settings-> Master page, expand the Alternate CSS URL option. Add the reference to your css file.

    46440-image.png

    46398-image.png

    Test Result:

    46390-image.png