[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699BX77QFE0H5JJW9AY8RHZ":3,"skill-same:01M699BX77QFE0H5JJW9AY8RHZ":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M699BX77QFE0H5JJW9AY8RHZ","ux-theming","VS Code 主题样式设计","VS Code theming, color tokens, composited surfaces, interaction-state precedence, and high-contrast support. Use when styling widgets, changing hover\u002Ffocus\u002Fselection, or validating rendered theme states.","VS Code 主题、颜色 token、合成表面、交互状态优先级以及高对比度支持。在为控件设置样式、更改悬停\u002F聚焦\u002F选中状态，或验证渲染后的主题状态时使用。","microsoft\u002Fvscode","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M6998NK2WED5M549DX06VBCH",195369,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fux-theming\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"theming","ux","ux theming","hc","contrast","compliance","widgets","high","focus","styles","indicators","high-contrast","with","code","when","use","tokens","theme","color","support","2026-11-10 10:12:30",false,"---\nname: ux-theming\ndescription: VS Code theming, color tokens, composited surfaces, interaction-state precedence, and high-contrast support. Use when styling widgets, changing hover\u002Ffocus\u002Fselection, or validating rendered theme states.\n---\n\nThis skill covers color registration, CSS variable usage, widget style patterns, focus indicators, and high-contrast theme requirements.\n\n---\n\n## 1. Registering Colors\n\n**File**: `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002FcolorUtils.ts`\n\n```typescript\nexport const myWidgetBackground = registerColor('myWidget.background',\n    { light: '#ffffff', dark: '#252526', hcDark: Color.black, hcLight: Color.white },\n    nls.localize('myWidgetBackground', \"Background color of My Widget.\"));\n```\n\n**Rules**:\n- Provide defaults for all four theme types: `light`, `dark`, `hcDark`, `hcLight`.\n- HC themes must use solid colors (avoid transparency) and set explicit borders via `contrastBorder`.\n- Use color transforms for derived colors: `transparent()`, `darken()`, `lighten()`, `oneOf()`.\n- Reference existing colors when possible instead of hardcoding hex values.\n\n## 2. Color Categories\n\n| File | Colors |\n|------|--------|\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FbaseColors.ts` | `foreground`, `focusBorder`, `contrastBorder`, text links |\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FeditorColors.ts` | Editor widgets, find match, errors\u002Fwarnings |\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FinputColors.ts` | Input, toggle, validation |\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FlistColors.ts` | List\u002Ftree selection, focus, hover, drop |\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FmiscColors.ts` | Badge, scrollbar, progress bar, sash |\n| `src\u002Fvs\u002Fworkbench\u002Fcommon\u002Ftheme.ts` | Tabs, sidebar, status bar, panels, editor groups, banner |\n\n## 3. Using Colors in CSS\n\nColors are injected as CSS custom properties on `.monaco-workbench`:\n\n```\nColor ID: editor.background\nCSS variable: --vscode-editor-background\nUsage: var(--vscode-editor-background)\n```\n\nConversion functions in `colorUtils.ts`:\n- `asCssVariable(colorId)` → `'var(--vscode-editor-background)'`\n- `asCssVariableName(colorId)` → `'--vscode-editor-background'`\n\n**In CSS files**, reference directly:\n```css\n.my-widget {\n    background-color: var(--vscode-editor-background);\n    color: var(--vscode-foreground);\n    border: 1px solid var(--vscode-contrastBorder);\n}\n```\n\nTrace the rendered control before choosing a token or selector; custom editor overlays may not use native input pseudo-elements. Inspect inherited and nested styles as well as the component's own declarations.\n\n### Contrast and Interaction States\n\n- Treat foreground and background as a semantic pair. A background change requires checking text, placeholders, links, operable inactive icons, hover, selection, and focus against the final composited surface.\n- Resolve defaults, opacity, and user overrides before measuring contrast. For example, an opaque icon color may meet contrast requirements while its translucent inactive variant does not.\n- Normal-size text and placeholders need at least 4.5:1 contrast; visual information needed to identify controls and focus needs at least 3:1 against adjacent colors. Apply the relevant accessibility criteria rather than extending these thresholds to decorative or disabled content. Unselected but operable controls are not disabled.\n- Check nested labels and descriptions in combined states; an explicit child foreground can defeat a correctly paired selection background.\n- Choose tokens by semantic role, not their current hue. A chart accent is not automatically a warning-button background, and pairing it with a default button foreground does not establish contrast. Reuse an appropriate control palette or register a themeable foreground\u002Fbackground pair when the component has its own semantics.\n\n### Composited Surfaces\n\nA theme variable is not necessarily opaque. For a floating panel that must conceal underlying content, inspect the resolved alpha and all material layers rather than assuming a panel token or `var()` fallback guarantees occlusion. Use the owning theme\u002Fcolor helpers to derive an opaque semantic background where needed, preserve the intended glass treatment elsewhere, and verify switching content and floating\u002Fdocked modes on the same instance.\n\nKeep material paint separate from interactive descendants. Border-box and padding-box alignment, clipping, and duplicated translucent strokes are covered by [rounded-surface geometry](..\u002Fux-css-layout\u002FSKILL.md#rounded-surface-geometry).\n\n## 4. Widget Styles Pattern\n\n**File**: `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fbrowser\u002FdefaultStyles.ts`\n\nEvery widget type has a default style object and an override factory:\n\n```typescript\n\u002F\u002F Use defaults:\nconst button = new Button(container, defaultButtonStyles);\n\n\u002F\u002F Override specific colors:\nconst button = new Button(container, getButtonStyles({\n    buttonBackground: myCustomBackgroundColor\n}));\n```\n\nAvailable defaults: `defaultButtonStyles`, `defaultInputBoxStyles`, `defaultCheckboxStyles`, `defaultToggleStyles`, `defaultDialogStyles`, `defaultListStyles`, `defaultSelectBoxStyles`, `defaultMenuStyles`, `defaultProgressBarStyles`, `defaultCountBadgeStyles`, `defaultBreadcrumbsWidgetStyles`, `defaultKeybindingLabelStyles`, `defaultFindWidgetStyles`.\n\n### Transient Theme Overrides\n\nUse the owning theme service for temporary palettes so CSS variables and programmatic color consumers remain consistent. Keep overrides scoped to the intended window and preserve the base theme and user customizations.\n\nVerify enabling, disabling, replacement, disposal, and theme changes, including stale asynchronous results. Clearing an override must restore the original colors without persisting generated values or changing another window's theme or startup colors.\n\n## 5. Focus Indicators\n\nDefined in `src\u002Fvs\u002Fworkbench\u002Fbrowser\u002Fmedia\u002Fstyle.css`:\n\n```css\n.my-widget:focus-visible {\n    outline-width: 1px;\n    outline-style: solid;\n    outline-offset: -1px;\n    outline-color: var(--vscode-focusBorder);\n}\n```\n\n**Rules**:\n- Use `var(--vscode-focusBorder)` — never hardcode a focus color.\n- Default `outline-offset: -1px` (inset). Exception: checkboxes use `2px`.\n- Preserve the owning widget's keyboard-focus mechanism, including supported `.focus-visible` or `.synthetic-focus` classes. Pointer activation should not leave an unnecessary keyboard ring, but broad `:active` suppression must not erase the boundary during keyboard activation.\n- Toggle selection, pointer hover, and keyboard focus are different states; do not use a dashed focus border as a universal toggle rule. Follow the [interaction-state contract](#high-contrast-interaction-state-contract).\n- Check keyboard focus independently from selection and hover, including ordinary links without explicit `tabindex` and icon-only controls. Inspect computed outlines and pseudo-elements under production styles; token registration alone does not establish visibility.\n- Preserve a clear focus boundary through clipping and modal wrappers. Resolve competing border\u002Foutline ownership rather than adding duplicate rings or removing focus visibility.\n\n### Focus Trapping\n\nModal dialogs must trap focus within the dialog until dismissed. Use `dom.trackFocus()` and handle `Tab`\u002F`Shift+Tab` cycling.\n\n## 6. High Contrast Theme Rules\n\n- **Always** provide `hcDark` and `hcLight` defaults when registering colors.\n- HC surface backgrounds: use the registered HC defaults, commonly `Color.black` (hcDark) and `Color.white` (hcLight). Preserve component-specific selection and control palettes.\n- HC borders: reference `contrastBorder` — it is `null` in normal themes, visible in HC.\n- HC keyboard focus: use `focusBorder` or the owning list's focus token; reserve `contrastActiveBorder` for the interaction states below.\n- In CSS, use `.hc-black` \u002F `.hc-light` class selectors for HC-specific overrides:\n  ```css\n  .hc-black .my-widget { border: 1px solid var(--vscode-contrastBorder); }\n  ```\n- In TypeScript, check `isHighContrast(theme.type)` for runtime behavior changes.\n- **Box shadows** must be removed or replaced in HC mode (shadows are invisible\u002Fdistracting with high contrast borders):\n  ```css\n  .my-widget {\n      box-shadow: 0 1px 3px var(--vscode-widget-shadow);\n  }\n  .monaco-workbench:is(.hc-black, .hc-light) .my-widget {\n      box-shadow: none;\n      border: 1px solid var(--vscode-contrastBorder);\n  }\n  ```\n\n### High-Contrast Interaction-State Contract\n\nInteraction boundaries communicate different semantics. Do not collapse hover, keyboard focus, selection, and persistent state into one generic rule.\n\n| State | Boundary | Required behavior |\n|---|---|---|\n| Pointer hover | Dashed `contrastActiveBorder` | Apply only to the actionable element actually under the pointer. A `mouse-navigation` class plus a stale focused row is not sufficient. |\n| Keyboard focus | Solid `focusBorder` or the owning list focus token | Must win over simultaneous hover and open\u002Fexpanded\u002Fpressed state. Preserve the focus ring when the pointer remains over the control. |\n| Open, expanded, or pressed | Solid `contrastActiveBorder` | Persistent state, not transient hover. Keep normal-theme hover fill separate so an expanded control can respond to the pointer without becoming dashed. |\n| Selected or checked | The component's selection palette and semantic foreground | Hover must not replace the selected background while leaving the selected foreground behind. |\n| Disabled | No hover or active boundary | Disabled styling remains owned by the component. A disabled control that intentionally remains keyboard-focusable still needs a focus indicator. |\n\nAssign one boundary owner per interaction. A pseudo-element may paint an inset hover fill, but it must not also draw an outline when the component root owns the boundary. When a card contains independent actions, suppress the card boundary while a nested action is hovered, focused, or open. For virtualized trees, inspect both the `.monaco-list-row` and its painted child such as `.monaco-tl-row`; never clear the child focus ring when the outer row's outline is intentionally suppressed.\n\nNative disclosure state is not exposed as `aria-expanded` on `\u003Csummary>`. Use `details[open] > summary` for visual state, or synchronize a component state class\u002FARIA attribute for a non-native disclosure. Exclude keyboard focus from persistent-state rules as well as hover rules; greater selector specificity can otherwise erase focus even when the focus rule comes later.\n\nFor a custom control whose expanded\u002Fpressed state uses ARIA, keep background and boundary selectors independent. This example preserves keyboard precedence in combined states:\n\n```css\n.control:not(.disabled, :disabled, [aria-disabled='true']):is(:hover, .hovered) {\n\tbackground-color: var(--vscode-list-hoverBackground);\n}\n\n.monaco-workbench:is(.hc-black, .hc-light) .control:not(.disabled, :disabled, [aria-disabled='true'], :focus-visible, .focus-visible, [aria-expanded='true'], [aria-pressed='true']):is(:hover, .hovered) {\n\toutline: var(--vscode-strokeThickness) dashed var(--vscode-contrastActiveBorder);\n}\n\n.monaco-workbench:is(.hc-black, .hc-light) .control:not(:disabled):is(:focus-visible, .focus-visible) {\n\toutline: var(--vscode-strokeThickness) solid var(--vscode-focusBorder);\n}\n\n.monaco-workbench:is(.hc-black, .hc-light) .control:not(.disabled, :disabled, [aria-disabled='true'], :focus-visible, .focus-visible):is([aria-expanded='true'], [aria-pressed='true']) {\n\toutline: var(--vscode-strokeThickness) solid var(--vscode-contrastActiveBorder);\n}\n```\n\nFor controls with a selected\u002Fchecked palette, exclude that state from the generic hover fill or provide its correctly paired selected-hover colors. Keep independent status markers distinct as well: attention-required, pinned, selected, and focused states can coexist. Test their combined placement and semantic foregrounds rather than letting a new marker cover an existing one.\n\nValidate a state matrix rather than isolated screenshots: rest, hover, keyboard focus, focus plus hover, open\u002Fexpanded\u002Fpressed plus focus and hover, selected\u002Fchecked plus hover, disabled plus hover, and nested-action focus\u002Fhover. Load all production styles that compete for the boundary and verify both HC Dark and HC Light, plus normal Dark\u002FLight when selector exclusions can affect hover fills.\n\nTest runtime theme changes and custom color overrides, including transitions where a previously defined token becomes absent. Clear stale inline colors or classes rather than leaving the previous theme's state behind. Render through production state-owning services so intentionally omitted decoration remains absent.\n\n### Testing Rendered Interaction States\n\n- A dispatched `mousemove` can update a widget's modality or logical focus without activating CSS `:hover`. Use real pointer input for interaction tests. A fixture may use the production-supported `.hovered` class, but it must assert the intended computed boundary before capturing a screenshot.\n- Establish keyboard modality through the actual input path, then dispatch navigation from the focused item. An ancestor bubbling listener may never see keys consumed by an inner ActionBar; use capture only where the owner must observe the event before that handler. Test pointer-to-keyboard transitions with a stationary pointer.\n- Do not assume `.focus()` or a synthetic key event makes `:focus-visible` true in every browser or Electron host. Control the fixture's supported focus state or drive actual keyboard input, isolate previous focus, and verify the state before asserting styles. Do not skip a failed focus assertion or weaken it to mere `activeElement` equality.\n- When exact theme colors are the contract, load and assert those tokens. When preserving platform styling is the contract, assert a visible nonzero focus boundary instead of an unrelated hardcoded color. Include the relevant production stylesheet cascade in either case.\n- Exercise both forced-focus and natural-focus fixture modes. Wait for a focus-triggered hover only when focus was actually requested. Check readiness, idle, and remount so an async tooltip is not captured accidentally or awaited forever.\n- In missing-token tests, distinguish local removal from inherited values. If an ancestor supplies the property, use a scoped guaranteed-invalid value such as a self-reference to exercise `var()` fallback without changing global theme state. A fallback does not repair a defined value with the wrong CSS type.\n- Hit-test the intended action region, allowing the hit element to be the control or one of its descendants, then activate it and assert the behavior or ARIA change. Exact root equality is brittle; CSS styling alone does not prove that labels, chevrons, or edge padding remain clickable.\n\n## 7. No Hardcoded Visual Values\n\nReviewers will always flag hardcoded colors, shadows, sizes that should use theme tokens or CSS variables.\n\n| Hardcoded (flagged) | Correct |\n|---------------------|---------|\n| `rgba(0, 0, 0, 0.12)` | `var(--vscode-widget-shadow)` or theme-aware variable |\n| `#252526` | `var(--vscode-editor-background)` |\n| `color: white` | `var(--vscode-button-foreground)` |\n| `border: 1px solid #ccc` | `var(--vscode-editorWidget-border)` |\n| `border: 1px solid …` (width) | `var(--vscode-strokeThickness)` for the 1px width |\n| `border-radius: 6px` | `var(--vscode-cornerRadius-medium)` (radius ramp) |\n| `padding: 8px 12px` (off-scale) | spacing ramp (`--vscode-spacing-size*`) |\n| `font-size: 14px` (arbitrary) | size ramp (`--vscode-fontSize-*`) |\n| `font-weight: 500` | `--vscode-fontWeight-semiBold` (no 500) |\n| codicon `font-size: 14px` | `--vscode-codiconFontSize` (16) \u002F `-compact` (12) |\n\n**Rule:** If a value relates to color, shadow, or border — it must come from a CSS variable or registered color token. The only exception is `0` (zero) values and purely structural measurements like `100%`.\n\n**Size, spacing, radius, font and stroke** values have their own design-system **size** tokens (and decision logic — snap maps, the pill→`circle` rule, and the compact-glyph convention). Those live in the **ux-css-layout** skill (§10 Design-System Size Tokens) and the auto-injected `.github\u002Finstructions\u002Fdesign-tokens.instructions.md`. Reach for those when a flag is about *how big \u002F how round \u002F how bold* something is rather than *what color*.\n\n---\n\n## Key Files\n\n| Area | File |\n|------|------|\n| Color registration | `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002FcolorUtils.ts` |\n| Color registry (barrel) | `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002FcolorRegistry.ts` |\n| Base colors | `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FbaseColors.ts` |\n| Workbench colors | `src\u002Fvs\u002Fworkbench\u002Fcommon\u002Ftheme.ts` |\n| Default widget styles | `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fbrowser\u002FdefaultStyles.ts` |\n| Global workbench styles | `src\u002Fvs\u002Fworkbench\u002Fbrowser\u002Fmedia\u002Fstyle.css` |\n","This skill covers color registration, CSS variable usage, widget style patterns, focus indicators, and high-contrast theme requirements.\n\n---\n\n## 1. Registering Colors\n\n**File**: `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002FcolorUtils.ts`\n\n```typescript\nexport const myWidgetBackground = registerColor('myWidget.background',\n    { light: '#ffffff', dark: '#252526', hcDark: Color.black, hcLight: Color.white },\n    nls.localize('myWidgetBackground', \"Background color of My Widget.\"));\n```\n\n**Rules**:\n- Provide defaults for all four theme types: `light`, `dark`, `hcDark`, `hcLight`.\n- HC themes must use solid colors (avoid transparency) and set explicit borders via `contrastBorder`.\n- Use color transforms for derived colors: `transparent()`, `darken()`, `lighten()`, `oneOf()`.\n- Reference existing colors when possible instead of hardcoding hex values.\n\n## 2. Color Categories\n\n| File | Colors |\n|------|--------|\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FbaseColors.ts` | `foreground`, `focusBorder`, `contrastBorder`, text links |\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FeditorColors.ts` | Editor widgets, find match, errors\u002Fwarnings |\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FinputColors.ts` | Input, toggle, validation |\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FlistColors.ts` | List\u002Ftree selection, focus, hover, drop |\n| `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FmiscColors.ts` | Badge, scrollbar, progress bar, sash |\n| `src\u002Fvs\u002Fworkbench\u002Fcommon\u002Ftheme.ts` | Tabs, sidebar, status bar, panels, editor groups, banner |\n\n## 3. Using Colors in CSS\n\nColors are injected as CSS custom properties on `.monaco-workbench`:\n\n```\nColor ID: editor.background\nCSS variable: --vscode-editor-background\nUsage: var(--vscode-editor-background)\n```\n\nConversion functions in `colorUtils.ts`:\n- `asCssVariable(colorId)` → `'var(--vscode-editor-background)'`\n- `asCssVariableName(colorId)` → `'--vscode-editor-background'`\n\n**In CSS files**, reference directly:\n```css\n.my-widget {\n    background-color: var(--vscode-editor-background);\n    color: var(--vscode-foreground);\n    border: 1px solid var(--vscode-contrastBorder);\n}\n```\n\nTrace the rendered control before choosing a token or selector; custom editor overlays may not use native input pseudo-elements. Inspect inherited and nested styles as well as the component's own declarations.\n\n### Contrast and Interaction States\n\n- Treat foreground and background as a semantic pair. A background change requires checking text, placeholders, links, operable inactive icons, hover, selection, and focus against the final composited surface.\n- Resolve defaults, opacity, and user overrides before measuring contrast. For example, an opaque icon color may meet contrast requirements while its translucent inactive variant does not.\n- Normal-size text and placeholders need at least 4.5:1 contrast; visual information needed to identify controls and focus needs at least 3:1 against adjacent colors. Apply the relevant accessibility criteria rather than extending these thresholds to decorative or disabled content. Unselected but operable controls are not disabled.\n- Check nested labels and descriptions in combined states; an explicit child foreground can defeat a correctly paired selection background.\n- Choose tokens by semantic role, not their current hue. A chart accent is not automatically a warning-button background, and pairing it with a default button foreground does not establish contrast. Reuse an appropriate control palette or register a themeable foreground\u002Fbackground pair when the component has its own semantics.\n\n### Composited Surfaces\n\nA theme variable is not necessarily opaque. For a floating panel that must conceal underlying content, inspect the resolved alpha and all material layers rather than assuming a panel token or `var()` fallback guarantees occlusion. Use the owning theme\u002Fcolor helpers to derive an opaque semantic background where needed, preserve the intended glass treatment elsewhere, and verify switching content and floating\u002Fdocked modes on the same instance.\n\nKeep material paint separate from interactive descendants. Border-box and padding-box alignment, clipping, and duplicated translucent strokes are covered by [rounded-surface geometry](..\u002Fux-css-layout\u002FSKILL.md#rounded-surface-geometry).\n\n## 4. Widget Styles Pattern\n\n**File**: `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fbrowser\u002FdefaultStyles.ts`\n\nEvery widget type has a default style object and an override factory:\n\n```typescript\n\u002F\u002F Use defaults:\nconst button = new Button(container, defaultButtonStyles);\n\n\u002F\u002F Override specific colors:\nconst button = new Button(container, getButtonStyles({\n    buttonBackground: myCustomBackgroundColor\n}));\n```\n\nAvailable defaults: `defaultButtonStyles`, `defaultInputBoxStyles`, `defaultCheckboxStyles`, `defaultToggleStyles`, `defaultDialogStyles`, `defaultListStyles`, `defaultSelectBoxStyles`, `defaultMenuStyles`, `defaultProgressBarStyles`, `defaultCountBadgeStyles`, `defaultBreadcrumbsWidgetStyles`, `defaultKeybindingLabelStyles`, `defaultFindWidgetStyles`.\n\n### Transient Theme Overrides\n\nUse the owning theme service for temporary palettes so CSS variables and programmatic color consumers remain consistent. Keep overrides scoped to the intended window and preserve the base theme and user customizations.\n\nVerify enabling, disabling, replacement, disposal, and theme changes, including stale asynchronous results. Clearing an override must restore the original colors without persisting generated values or changing another window's theme or startup colors.\n\n## 5. Focus Indicators\n\nDefined in `src\u002Fvs\u002Fworkbench\u002Fbrowser\u002Fmedia\u002Fstyle.css`:\n\n```css\n.my-widget:focus-visible {\n    outline-width: 1px;\n    outline-style: solid;\n    outline-offset: -1px;\n    outline-color: var(--vscode-focusBorder);\n}\n```\n\n**Rules**:\n- Use `var(--vscode-focusBorder)` — never hardcode a focus color.\n- Default `outline-offset: -1px` (inset). Exception: checkboxes use `2px`.\n- Preserve the owning widget's keyboard-focus mechanism, including supported `.focus-visible` or `.synthetic-focus` classes. Pointer activation should not leave an unnecessary keyboard ring, but broad `:active` suppression must not erase the boundary during keyboard activation.\n- Toggle selection, pointer hover, and keyboard focus are different states; do not use a dashed focus border as a universal toggle rule. Follow the [interaction-state contract](#high-contrast-interaction-state-contract).\n- Check keyboard focus independently from selection and hover, including ordinary links without explicit `tabindex` and icon-only controls. Inspect computed outlines and pseudo-elements under production styles; token registration alone does not establish visibility.\n- Preserve a clear focus boundary through clipping and modal wrappers. Resolve competing border\u002Foutline ownership rather than adding duplicate rings or removing focus visibility.\n\n### Focus Trapping\n\nModal dialogs must trap focus within the dialog until dismissed. Use `dom.trackFocus()` and handle `Tab`\u002F`Shift+Tab` cycling.\n\n## 6. High Contrast Theme Rules\n\n- **Always** provide `hcDark` and `hcLight` defaults when registering colors.\n- HC surface backgrounds: use the registered HC defaults, commonly `Color.black` (hcDark) and `Color.white` (hcLight). Preserve component-specific selection and control palettes.\n- HC borders: reference `contrastBorder` — it is `null` in normal themes, visible in HC.\n- HC keyboard focus: use `focusBorder` or the owning list's focus token; reserve `contrastActiveBorder` for the interaction states below.\n- In CSS, use `.hc-black` \u002F `.hc-light` class selectors for HC-specific overrides:\n  ```css\n  .hc-black .my-widget { border: 1px solid var(--vscode-contrastBorder); }\n  ```\n- In TypeScript, check `isHighContrast(theme.type)` for runtime behavior changes.\n- **Box shadows** must be removed or replaced in HC mode (shadows are invisible\u002Fdistracting with high contrast borders):\n  ```css\n  .my-widget {\n      box-shadow: 0 1px 3px var(--vscode-widget-shadow);\n  }\n  .monaco-workbench:is(.hc-black, .hc-light) .my-widget {\n      box-shadow: none;\n      border: 1px solid var(--vscode-contrastBorder);\n  }\n  ```\n\n### High-Contrast Interaction-State Contract\n\nInteraction boundaries communicate different semantics. Do not collapse hover, keyboard focus, selection, and persistent state into one generic rule.\n\n| State | Boundary | Required behavior |\n|---|---|---|\n| Pointer hover | Dashed `contrastActiveBorder` | Apply only to the actionable element actually under the pointer. A `mouse-navigation` class plus a stale focused row is not sufficient. |\n| Keyboard focus | Solid `focusBorder` or the owning list focus token | Must win over simultaneous hover and open\u002Fexpanded\u002Fpressed state. Preserve the focus ring when the pointer remains over the control. |\n| Open, expanded, or pressed | Solid `contrastActiveBorder` | Persistent state, not transient hover. Keep normal-theme hover fill separate so an expanded control can respond to the pointer without becoming dashed. |\n| Selected or checked | The component's selection palette and semantic foreground | Hover must not replace the selected background while leaving the selected foreground behind. |\n| Disabled | No hover or active boundary | Disabled styling remains owned by the component. A disabled control that intentionally remains keyboard-focusable still needs a focus indicator. |\n\nAssign one boundary owner per interaction. A pseudo-element may paint an inset hover fill, but it must not also draw an outline when the component root owns the boundary. When a card contains independent actions, suppress the card boundary while a nested action is hovered, focused, or open. For virtualized trees, inspect both the `.monaco-list-row` and its painted child such as `.monaco-tl-row`; never clear the child focus ring when the outer row's outline is intentionally suppressed.\n\nNative disclosure state is not exposed as `aria-expanded` on `\u003Csummary>`. Use `details[open] > summary` for visual state, or synchronize a component state class\u002FARIA attribute for a non-native disclosure. Exclude keyboard focus from persistent-state rules as well as hover rules; greater selector specificity can otherwise erase focus even when the focus rule comes later.\n\nFor a custom control whose expanded\u002Fpressed state uses ARIA, keep background and boundary selectors independent. This example preserves keyboard precedence in combined states:\n\n```css\n.control:not(.disabled, :disabled, [aria-disabled='true']):is(:hover, .hovered) {\n\tbackground-color: var(--vscode-list-hoverBackground);\n}\n\n.monaco-workbench:is(.hc-black, .hc-light) .control:not(.disabled, :disabled, [aria-disabled='true'], :focus-visible, .focus-visible, [aria-expanded='true'], [aria-pressed='true']):is(:hover, .hovered) {\n\toutline: var(--vscode-strokeThickness) dashed var(--vscode-contrastActiveBorder);\n}\n\n.monaco-workbench:is(.hc-black, .hc-light) .control:not(:disabled):is(:focus-visible, .focus-visible) {\n\toutline: var(--vscode-strokeThickness) solid var(--vscode-focusBorder);\n}\n\n.monaco-workbench:is(.hc-black, .hc-light) .control:not(.disabled, :disabled, [aria-disabled='true'], :focus-visible, .focus-visible):is([aria-expanded='true'], [aria-pressed='true']) {\n\toutline: var(--vscode-strokeThickness) solid var(--vscode-contrastActiveBorder);\n}\n```\n\nFor controls with a selected\u002Fchecked palette, exclude that state from the generic hover fill or provide its correctly paired selected-hover colors. Keep independent status markers distinct as well: attention-required, pinned, selected, and focused states can coexist. Test their combined placement and semantic foregrounds rather than letting a new marker cover an existing one.\n\nValidate a state matrix rather than isolated screenshots: rest, hover, keyboard focus, focus plus hover, open\u002Fexpanded\u002Fpressed plus focus and hover, selected\u002Fchecked plus hover, disabled plus hover, and nested-action focus\u002Fhover. Load all production styles that compete for the boundary and verify both HC Dark and HC Light, plus normal Dark\u002FLight when selector exclusions can affect hover fills.\n\nTest runtime theme changes and custom color overrides, including transitions where a previously defined token becomes absent. Clear stale inline colors or classes rather than leaving the previous theme's state behind. Render through production state-owning services so intentionally omitted decoration remains absent.\n\n### Testing Rendered Interaction States\n\n- A dispatched `mousemove` can update a widget's modality or logical focus without activating CSS `:hover`. Use real pointer input for interaction tests. A fixture may use the production-supported `.hovered` class, but it must assert the intended computed boundary before capturing a screenshot.\n- Establish keyboard modality through the actual input path, then dispatch navigation from the focused item. An ancestor bubbling listener may never see keys consumed by an inner ActionBar; use capture only where the owner must observe the event before that handler. Test pointer-to-keyboard transitions with a stationary pointer.\n- Do not assume `.focus()` or a synthetic key event makes `:focus-visible` true in every browser or Electron host. Control the fixture's supported focus state or drive actual keyboard input, isolate previous focus, and verify the state before asserting styles. Do not skip a failed focus assertion or weaken it to mere `activeElement` equality.\n- When exact theme colors are the contract, load and assert those tokens. When preserving platform styling is the contract, assert a visible nonzero focus boundary instead of an unrelated hardcoded color. Include the relevant production stylesheet cascade in either case.\n- Exercise both forced-focus and natural-focus fixture modes. Wait for a focus-triggered hover only when focus was actually requested. Check readiness, idle, and remount so an async tooltip is not captured accidentally or awaited forever.\n- In missing-token tests, distinguish local removal from inherited values. If an ancestor supplies the property, use a scoped guaranteed-invalid value such as a self-reference to exercise `var()` fallback without changing global theme state. A fallback does not repair a defined value with the wrong CSS type.\n- Hit-test the intended action region, allowing the hit element to be the control or one of its descendants, then activate it and assert the behavior or ARIA change. Exact root equality is brittle; CSS styling alone does not prove that labels, chevrons, or edge padding remain clickable.\n\n## 7. No Hardcoded Visual Values\n\nReviewers will always flag hardcoded colors, shadows, sizes that should use theme tokens or CSS variables.\n\n| Hardcoded (flagged) | Correct |\n|---------------------|---------|\n| `rgba(0, 0, 0, 0.12)` | `var(--vscode-widget-shadow)` or theme-aware variable |\n| `#252526` | `var(--vscode-editor-background)` |\n| `color: white` | `var(--vscode-button-foreground)` |\n| `border: 1px solid #ccc` | `var(--vscode-editorWidget-border)` |\n| `border: 1px solid …` (width) | `var(--vscode-strokeThickness)` for the 1px width |\n| `border-radius: 6px` | `var(--vscode-cornerRadius-medium)` (radius ramp) |\n| `padding: 8px 12px` (off-scale) | spacing ramp (`--vscode-spacing-size*`) |\n| `font-size: 14px` (arbitrary) | size ramp (`--vscode-fontSize-*`) |\n| `font-weight: 500` | `--vscode-fontWeight-semiBold` (no 500) |\n| codicon `font-size: 14px` | `--vscode-codiconFontSize` (16) \u002F `-compact` (12) |\n\n**Rule:** If a value relates to color, shadow, or border — it must come from a CSS variable or registered color token. The only exception is `0` (zero) values and purely structural measurements like `100%`.\n\n**Size, spacing, radius, font and stroke** values have their own design-system **size** tokens (and decision logic — snap maps, the pill→`circle` rule, and the compact-glyph convention). Those live in the **ux-css-layout** skill (§10 Design-System Size Tokens) and the auto-injected `.github\u002Finstructions\u002Fdesign-tokens.instructions.md`. Reach for those when a flag is about *how big \u002F how round \u002F how bold* something is rather than *what color*.\n\n---\n\n## Key Files\n\n| Area | File |\n|------|------|\n| Color registration | `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002FcolorUtils.ts` |\n| Color registry (barrel) | `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002FcolorRegistry.ts` |\n| Base colors | `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fcolors\u002FbaseColors.ts` |\n| Workbench colors | `src\u002Fvs\u002Fworkbench\u002Fcommon\u002Ftheme.ts` |\n| Default widget styles | `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fbrowser\u002FdefaultStyles.ts` |\n| Global workbench styles | `src\u002Fvs\u002Fworkbench\u002Fbrowser\u002Fmedia\u002Fstyle.css` |\n",{"name":5,"description":7},"main","1448348da3b327766105cde54b608195de21b2d4",".github\u002Fskills\u002Fux-theming",43835,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode","https:\u002F\u002Fcode.visualstudio.com","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 03:00:24",{"source":9,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add microsoft\u002Fvscode --skill ux-theming",{"tool":72,"command":73},"bunx","bunx skills add microsoft\u002Fvscode --skill ux-theming",{"tool":75,"command":76},"pnpm","pnpm dlx skills add microsoft\u002Fvscode --skill ux-theming","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fux-theming\u002FSKILL.md",true,[],[81,89,96,103,128,156],{"skillNo":82,"name":83,"nameZh":17,"description":84,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":88},"01M7B4XRMJX3WB67XWMX3GVHNN","vscode-ui","Present metrics, comparisons, tables, bar charts, and expandable details as native visuals inside an Agents window response. Use when numbers or a comparison are clearer shown than described. Not for diagrams, mockups, or standalone documents.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fvscode-ui\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":90,"name":91,"nameZh":17,"description":92,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":88},"01M78JJQ6C7V7NR93D5D9N2VCA","html-preview","Create visual reports, implementation plans, code-review explainers, comparisons, diagrams, and static UI mockups as inline HTML previews in the Agents window. Use when the user asks for visual or rendered output, not ordinary HTML code examples.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fhtml-preview\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":17,"description":99,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":88},"01M78JJDRGWKHBBZY6W3GY2CQ9","endgame-status","Report VS Code endgame status, focusing on test-plan progress, tester activity, release-branch PRs, and release-build availability.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fendgame-status\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":17,"description":106,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":51},"01M70H0ANBKZAVEP1NVV4K28M3","sweeper-query","Answer natural-language questions about the VS Code Sweeper's published issue index (index-\u003Cname>.json for microsoft\u002Fvscode and the enrolled family repos) — which issues are agent-ready to implement or plan, what the sweeper proposed for an assignee or area, whether the sweeper knows a report as a duplicate, the highest-value open bugs in a lane — and, for one issue, the review's full record (evidence with file citations, fix brief, proposed comment). Use ONLY when the request explicitly names the sweeper — \"sweeper\", \"vscodesweeper\", \"sweeper-query\", a sweeper verdict, record, brief or index, an agent-ready issue — or asks what \"the sweeper\" found, proposed or knows. Do NOT use for general questions about issues, duplicates, priorities or ranking that do not mention the sweeper. Read-only; discovery only.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsweeper-query\u002FSKILL.md",[],[110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,45,44,127],"sweeper query","query","sweeper","duplicates","read","Citations","brief","ready","which","review","request","fix","plan","issues","ranking","open","only","natural-language",{"skillNo":129,"name":130,"nameZh":131,"description":132,"descriptionZh":133,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":134,"categories":135,"keywords":140,"publishedAt":51},"01M699DRJS4YJCV600Q72SVVWE","update-skills","仓库技能与指令更新","Create or update repository skills and instructions when major learnings are discovered during a session. Use when the user says \"learn!\", when a significant pattern or pitfall is identified, or when reusable domain knowledge should be captured for future sessions.","当在会话中发现重要经验教训时，创建或更新仓库技能与指令。当用户说\"learn!\"、识别出重要模式或陷阱，或需要为未来会话捕获可复用的领域知识时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-skills\u002FSKILL.md",[136,137],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":138,"categoryName":139,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRN0CV1NMDZ5TEJX1GVM29","插件与技能管理",[141,142,143,144,145,146,147,148,149,150,151,46,45,152,153,154,155],"update","update skills","repository","pattern","user","sessions","instructions","domain","for","session","knowledge","reusable","learn","learnings","create",{"skillNo":157,"name":158,"nameZh":159,"description":160,"descriptionZh":161,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":162,"categories":163,"keywords":168,"publishedAt":51},"01M699DPWHZ72B66P82EW31RNE","update-pr","Pull Request 更新与推送","Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.","更新当前会话的拉取请求（Pull Request）。当用户希望把新变更推送到已有 PR 时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-pr\u002FSKILL.md",[164,165],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":166,"categoryName":167,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[169,141,170,171,172,173,174,149,120,150,46,175,45,145],"pr","update pr","pull","push","changes","pull request","Existing"]