Sebastian Faltoni Software Architect. Passionate about Clean Code, Tech, Web, AI, .NET, Python, IOT, Swift, SwiftUI and also Blazor

SharePoint Full width web part on Teams Site

14 sec read

While we should not rely on a trick like this one, and while it’s unlike that it’s going to change soon it could break in the future.

But if you need to achieve full width for your web parts on teams sites now and quickly. This snippet if for you tested on a SharePoint Web Part developed with pnpjs.

    let canvas  = window.document.getElementsByClassName('CanvasZone')
    canvas[0].setAttribute("style", "max-width:100%!important;");

Sebastian Faltoni Software Architect. Passionate about Clean Code, Tech, Web, AI, .NET, Python, IOT, Swift, SwiftUI and also Blazor

Leave a Reply

Your email address will not be published. Required fields are marked *