Add-SPOTheme
建立新的自訂主題,或覆寫現有的主題以修改其設定。
Syntax
Add-SPOTheme
-Identity <SpoThemePipeBind>
-IsInverted <bool>
-Overwrite
-Palette <SpoThemePalettePipeBind>
[<CommonParameters>]
Description
Add-SPOTheme Cmdlet 會建立新的主題或更新現有的主題。 調色盤設定可以當做雜湊表或字典傳遞。
新增主題不會將主題套用至任何網站。 它會將主題新增至您的租使用者存放區,然後主題即可在 [變更新式頁面 的外觀 ] 選項下的主題清單中取得。
範例
範例 1
在此範例中,會建立名為 "Custom Cyan"
的新主題,其中包含各種青色陰影的調色盤設定。 請注意,設定會以雜湊表形式傳遞。
$themepalette = @{
"themePrimary" = "#00ffff";
"themeLighterAlt" = "#f3fcfc";
"themeLighter" = "#daffff";
"themeLight" = "#affefe";
"themeTertiary" = "#76ffff";
"themeSecondary" = "#39ffff";
"themeDarkAlt" = "#00c4c4";
"themeDark" = "#009090";
"themeDarker" = "#005252";
"neutralLighterAlt" = "#f8f8f8";
"neutralLighter" = "#f4f4f4";
"neutralLight" = "#eaeaea";
"neutralQuaternaryAlt" = "#dadada";
"neutralQuaternary" = "#d0d0d0";
"neutralTertiaryAlt" = "#c8c8c8";
"neutralTertiary" = "#a6a6a6";
"neutralSecondaryAlt" = "#767676";
"neutralSecondary" = "#666666";
"neutralPrimary" = "#333";
"neutralPrimaryAlt" = "#3c3c3c";
"neutralDark" = "#212121";
"black" = "#000000";
"white" = "#fff";
"primaryBackground" = "#fff";
"primaryText" = "#333"
}
Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false
注意事項
在 2017 年 12 月發行的 SPO 管理命令介面之前, Add-SPOTheme Cmdlet 需要將調色盤設定當做字典傳遞。 建議您使用最新版的 SPO 管理命令介面,或視需要使用 HashToDictionary
函式將雜湊表轉換成字典。
範例 2
如果您想要更新現有的主題 (以修改其部分色彩設定,例如) ,請使用先前所示的相同語法,但將 旗標新 -Overwrite
增至 Add-SPOTheme Cmdlet。
Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false -Overwrite
參數
-Identity
指定主題的名稱。 這必須唯一識別主題。
Type: | SpoThemePalettePipeBind |
Aliases: | Name |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
-IsInverted
指定主題是否反轉,具有深色背景和淺色前景。
Type: | Boolean |
Aliases: | None |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
-Overwrite
覆寫相同名稱的主題,以防其存在。
Type: | SwitchParameter |
Aliases: | None |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
-Palette
指定主題中色彩的調色盤,做為主題位置值的字典。
Type: | SpoThemePalettePipeBind |
Aliases: | None |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |