@fluentui/scheme-utilities

中文文档
8.3.75发布于 2026/10/26MITTypeScriptESM + CJS近 30 天下载 8.4万

Fluent UI React subtheme generator.

原始使用文档

@fluentui/scheme-utilities

Theme variant generator for Fluent UI React (formerly Office UI Fabric React)

Variants are themes generated from an existing theme, as opposed to from raw colors. A variant will share the same colors as the original theme it was generated from, but will use those colors differently. For example, the background color and text color might be swapped. Variants can be used to highlight or de-emphasize portions of the page.

Example of normal, soft, and strong variants:

example of variants

This project provides helper functions to create variants of a given theme, which can be used with the ThemeProvider component to theme a specific portion of the page. Each function takes in an IPartialTheme and returns an ITheme.

The following example creates a strong variant of a given theme, and applies that strong variant to the components wrapped by ThemeProvider.

import { FluentTheme } from '@fluentui/theme';
import { getStrongVariant } from '@fluentui/theme-schemes';

const strongTheme = getStrongVariant(FluentTheme);

<ThemeProvider theme={strongTheme}>
  <components... />
</ThemeProvider>

The available variants are:

  • getNeutralVariant(theme: IPartialTheme): ITheme
    • Neutral - a soft neutral color is used as the background (light gray in the default theme), most other colors are changed very little or not at all
  • getSoftVariant(theme: IPartialTheme): ITheme
    • Soft - a soft shade of the primary color is used as the background (light blue in the default theme), most other colors are changed very little or not at all, but input controls look different
  • getStrongVariant(theme: IPartialTheme): ITheme
    • Strong - a strong shade of the primary color is used as the background (blue in the default theme), almost all colors are changed

版本与发布记录

@fluentui/scheme-utilities 共发布 130 个版本,首次发布于 2020/10/23;过去 12 个月发布了 3 个版本。

版本发布日期距今
8.3.75latest2026/10/2620 天前
8.3.742026/10/011 个月前
8.3.732025/12/1011 个月前
8.3.722025/11/111 年前
8.3.712025/10/231.1 年前
8.3.702025/10/161.1 年前

其他发布通道:beta → 8.0.0-beta.19,lts-7 → 7.3.4。

关于 @fluentui/scheme-utilities 的常见问题

@fluentui/scheme-utilities 是什么?

Fluent UI React subtheme generator.

如何安装 @fluentui/scheme-utilities?

在项目目录运行 npm install @fluentui/scheme-utilities,或使用 pnpm add / yarn add / bun add。

@fluentui/scheme-utilities 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fluentui/scheme-utilities 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@fluentui/scheme-utilities 可以商用吗?

@fluentui/scheme-utilities 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fluentui/scheme-utilities 的下载量有多少?

根据 npm 官方下载统计,@fluentui/scheme-utilities 在 2026/10/15 – 2026/11/13 这 30 天内被下载 83,902 次,日均约 2,797 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fluentui/scheme-utilities 还在维护吗?

最新版本 8.3.75 发布于 2026/10/26(20 天前);至今共发布 130 个版本,其中过去 12 个月发布了 3 个;首次发布于 2020/10/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。