@equinor/fusion-web-theme

中文文档
0.1.12发布于 2026/10/22ISCTypeScriptCommonJS构建来源已验证近 30 天下载 7791

fusion web theme

原始使用文档
文档目录3 节
  1. Apply the theme
  2. Temporary native-control light mode
  3. Development

@equinor/fusion-web-theme

Fusion theme style properties and CSS declarations for colors, elevation, spacing, and typography.

Apply the theme

Importing the package only creates theme data: it does not inject CSS, access the DOM, or change HTML attributes. Consumers must emit the exported declarations in their root stylesheet, for example with their existing CSS-in-JS integration:

import { attributes } from '@equinor/fusion-web-theme';

const rootCss = `:root { ${attributes.join(';')}; }`;

Apply this CSS to the document root before the first paint to cover native controls from startup, including controls in overlays mounted under body. Scoping the declarations to an app container does not cover overlays outside that container. If the consuming stylesheet loads later, protection only starts when it applies.

Temporary native-control light mode

colorVariables (from src/styles/colors) includes a standalone color-scheme: only light declaration. The public aggregate attributes inherits it once. This keeps browser-native controls on a light scheme while Fusion does not support dark mode, including when the OS preference changes at runtime. Remove this single entry when Fusion supports dark mode.

This is not a complete EDS dark-mode lock. The existing legacy EDS 0.9.2 tokens use CSS variable references with light fallbacks. Modern EDS token stylesheets can select dark values through prefers-color-scheme; color-scheme does not disable that media query. Consumers using modern EDS must explicitly set data-color-scheme="light" on html to select its light palette. This package does not set that attribute or choose a modern EDS palette.

Development

From the repository root:

bun run --cwd packages/theme test
bun run --cwd packages/theme build
bun run check -- packages/theme

The test command builds the package first so the DOM-free import check exercises the published entry point. The committed color snapshot preserves the 75 legacy declarations and their order; review any snapshot update as a public-output change.

版本与发布记录

@equinor/fusion-web-theme 共发布 16 个版本,首次发布于 2021/03/18;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.12latest2026/10/2222 天前
0.1.112026/10/2024 天前
0.1.102024/03/142 年前
0.1.92024/03/112 年前
0.1.72021/11/164 年前
0.1.62021/09/275 年前

关于 @equinor/fusion-web-theme 的常见问题

@equinor/fusion-web-theme 是什么?

fusion web theme

如何安装 @equinor/fusion-web-theme?

在项目目录运行 npm install @equinor/fusion-web-theme,或使用 pnpm add / yarn add / bun add。

@equinor/fusion-web-theme 支持 TypeScript 吗?

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

@equinor/fusion-web-theme 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@equinor/fusion-web-theme 可以商用吗?

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

@equinor/fusion-web-theme 的下载量有多少?

根据 npm 官方下载统计,@equinor/fusion-web-theme 在 2026/10/14 – 2026/11/12 这 30 天内被下载 7,791 次,日均约 260 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@equinor/fusion-web-theme 还在维护吗?

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