Add a custom CSS/Javascript to the site's home modern page

john john 1,021 Reputation points
2021-03-09T21:31:04.247+00:00

i am working on a modern team site >> and for the home page ONLY, i want to hide the Site navigation bar, left-hand side navigation, page title and modify the float to remove the white space on the left-hand side + add a JavaScript to reload the page each 5 minutes.

to achieve the above i added the sharepoint modern script web part @ https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-script-editor and i added this custom css + custom javascript:-

75986-custom.png

and it achieved what i am looking for.. but based on my reading that my above approach of adding modern script editor web part and inside it to add custom CSS/JavaScript is not supported.. so my question is how i can apply the above custom CSS/JavaScript in a supported way inside the home page? thanks in advance for any help.

Regards

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,051 Reputation points
    2021-03-10T06:05:32.517+00:00

    Not all customizations are allowed on the modern team site. You can refer to this document:What's not supported on "modern" team sites


    If the response 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.


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.