Forum Discussion
MartinSharepoint
Mar 14, 2021Copper Contributor
Modifying css
I've seen a few online posts where it was suggested to modify a sharepoint site css to solve a specific problem (eg. hiding the cog icon to prevent users from accessing the site content/usage). I'm a...
Don Kirkham
Mar 14, 2021MVP
To my knowledge, there is no "approved" way to currently do this on modern pages. SPFx has some options, but if you modify the page DOM outside of your web part or extension, you do so at your own risk. Twice in the past 6 months, Microsoft has made changes to the modern page CSS classes that have "broken" people's efforts to manage CSS that they don't own. To quote Andrew Connell (@andrewconnell), "The DOM is not an API" which just means Microsoft is not obligated to keep the DOM the same, or notify you that is has changed.
That said, the next version of SPFx (v1.12) is supposed to give developers additional access to the page DOM. I have not seen details yet on what areas will be available.
As far as your final note, I recommend searching UserVoice and adding your vote any requests that are already there or start a new request. https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration
I found this item: https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/18486868-hide-site-contents-access-links
I hope this helps. If so, please mark this as an answer.
That said, the next version of SPFx (v1.12) is supposed to give developers additional access to the page DOM. I have not seen details yet on what areas will be available.
As far as your final note, I recommend searching UserVoice and adding your vote any requests that are already there or start a new request. https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration
I found this item: https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/18486868-hide-site-contents-access-links
I hope this helps. If so, please mark this as an answer.