Add-SPOTheme
创建新的自定义主题,或覆盖现有主题以修改其设置。
语法
Add-SPOTheme
-Identity <SpoThemePipeBind>
-IsInverted <bool>
-Overwrite
-Palette <SpoThemePalettePipeBind>
[<CommonParameters>]
说明
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 |