SharePoint modern site header layout customization options were introduced to Targeted Release Office 365 tenants in the beginning of 2019. With these options you can customized header layout, background and change the site logo.

Header customization options.

There are two layout options available: Standard and Compact.

Standard header
Compact header

Site logo allows uploading of a new logo and removing a logo. If you want to reuse your logo from another site you need to update logo URL via code or you can set logo URL via classic site settings, which you can access by going to “Site information”, clicking “View all site settings” and opening “Title, description and logo” from “Look and feel” -section, or just by adding /_layouts/15/prjsetng.aspx after you site url.

For header background, there are four options from left to right: None, Neutral, Soft and Strong.

Header background options

Modifying header with PnP PowerShell

Header layout options can be easily modified with just few lines of PnP PowerShell.

Connect-PnPOnline <site url>
$web = Get-PnPWeb -Includes HeaderEmphasis,HeaderLayout,SiteLogoUrl
$web.HeaderLayout = "Compact" #Options: Standard, Compact
$web.HeaderEmphasis = "Strong" #Options None,Neutral,Soft,Strong
$web.SiteLogoUrl = <Url to your logo>