Can some css style be applied globally in modern mode? So far we have tried by embeding css in scriptlink custom action. This is working in classic mode only but not in modern view.

Any spfx extension or anything that can help? Please provide corresponding references.


Found it here: it injects css to all the modern pages



Currently, modern page is not supported for CSS/JavaScript code.

As a workaround, you can use a Github solution "Modern Script edit web part" and add your script into it.

More information about the Github solution, you can refer to:
Script editor web part for modern pages built in React


As far as I can tell, the "Modern Script edit web part" lets you add CSS to the HTML you put into it. It does not allow you to override "modern" (gasp!) SP CSS. I could be totally wrong, and maybe I just couldn't figure out how to do it. Regardless, it is a very handy solution to have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.