univer-customize-theme
БесплатноБез исполняемых скриптовНе проверенCustomize Univer color themes, branded palettes, dark mode, and theme-aware plugin styles across Sheets, Docs, Slides, Bases, Boards, and PDFs. Use when…
от dream-num★ 83 звезды на GitHubОб этом скилле
Univer Customize Theme
Build and apply a complete Univer theme without bypassing the public Facade or runtime theme service.
Source baseline: current Univer OSS and Pro source, whose manifests identify as
1.0.0-beta.0. Inspect the target application's installed declarations first: the npm release with the same version label can lag the current source API.
Workflow
- Decide whether the request concerns the application palette, dark mode, plugin styling, or a Pro Chart theme. These are separate contracts.
- Inspect the exact installed version and integration mode. Presets compose plugins and Facade extensions; Plugin Mode requires explicit plugin and
/facadeimports. - Derive a complete
Themefrom a built-in theme. Do not hand-write or cast a partial object. - Pass the initial theme to
createUniver. Use currentFUnivertheme methods only when they exist in the target declarations. - Read live colors through
ThemeServicein plugin/render code and through--univer-*variables in browser CSS. - Verify light and dark appearances in every enabled product host.
Build a complete brand palette
Import from the owning package and keep it on the target application's exact Univer version:
import type { Theme } from '@univerjs/themes';
import { defaultTheme } from '@univerjs/themes';
export const brandTheme: Theme = {
...defaultTheme,
primary: {
...defaultTheme.primary,
50: '#F5F3FF',
100: '#EDE9FE',
200: '#DDD6FE',
300: '#C4B5FD',
400: '#A78BFA',
500: '#8B5CF6',
600: '#7C3AED',
700: '#6D28D9',
800: '#5B21B6',
900: '#4C1D95',
},
};
The current source schema also contains gray, semantic color ramps, loop-color, and highlight.background. Preserve every branch unless the design intentionally replaces it. See Theme API and migration for the schema, built-ins, and release gate.
Apply the theme
Add the initial theme to the existing createUniver configuration. Keep that integration's locale, preset, container, and explicit stylesheet imports unchanged:
const { univer, univerAPI } = createUniver({
locale: LocaleType.EN_US,
locales,
presets,
theme: brandTheme,
darkMode: false,
});
Current source supports runtime changes through the base Facade:
univerAPI.setTheme(brandTheme);
univerAPI.toggleDarkMode(true);
const currentTheme = univerAPI.getCurrentTheme();
const darkMode = univerAPI.isDarkMode();
Theme selection and dark mode are independent. setTheme() does not toggle dark mode, and toggleDarkMode() does not replace the palette.
Preset Mode constructs the base Facade. In manual Plugin Mode, construct it from the public core entry after registering plugins:
import { FUniver } from '@univerjs/core/facade';
const univerAPI = FUniver.newAPI(univer);
There is no @univerjs/themes/facade package. If installed FUniver declarations lack setTheme(), getCurrentTheme(), or isDarkMode(), configure the complete theme during initialization or upgrade; do not reach through univer.__getInjector().
Make custom code theme-aware
For custom DOM, use variables injected by the UI workbench:
.brand-action {
color: var(--univer-gray-0);
background: var(--univer-primary-600);
border-color: var(--univer-primary-700);
}
For plugin services, canvas rendering, and model code, inject ThemeService and resolve the live token instead of importing a built-in palette as runtime state:
import { Inject, ThemeService } from '@univerjs/core';
export class SelectionColorProvider {
constructor(
@Inject(ThemeService) private readonly _themeService: ThemeService
) {}
getColor(): string {
return this._themeService.getColorFromTheme('primary.600');
}
}
Observe currentTheme$ or darkMode$ when caching derived colors, and release subscriptions with the owner lifecycle. Headless runtimes have ThemeService but do not inject browser CSS variables.
Six products and Pro Charts
One Univer runtime shares its core ThemeService across Sheets, Docs, Slides, Bases, Boards, and PDFs. Theme setup does not register product plugins, load locales, or load CSS. Preserve the aggregate preset CSS or every selected Plugin Mode stylesheet.
Slides, Boards, PDF tables, Sheet ranges, and Pro Charts also have content-level theme/style systems. They do not use the same contract as the application palette. Read Products and Pro themes before changing content or chart colors.
Browser-global boundary
The current UI workbench writes flattened variables to one :root style element and toggles univer-dark on document.documentElement. Multiple browser UI instances in one document therefore do not have isolated CSS palettes or dark-mode classes; the latest document-level update wins. Current disposal also does not restore the previous document-level style or root class. Use one shared appearance
Установить univer-customize-theme в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл univer-customize-theme?
Customize Univer color themes, branded palettes, dark mode, and theme-aware plugin styles across Sheets, Docs, Slides, Bases, Boards, and PDFs. Use when setting an initial or runtime Theme, consuming ThemeService or --univer-* CSS variables, keeping custom UI or canvas code theme-aware, registering a separate Univer Pro chart theme, or migrating theme code from Univer 0.25.0 to current 1.0 source.
Как установить скилл univer-customize-theme?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл univer-customize-theme запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic