[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DNF3R0W9QQ81K3NMH97MCJ":3,"skill-same:01M7DNF3R0W9QQ81K3NMH97MCJ":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7DNF3R0W9QQ81K3NMH97MCJ","ux-css-layout",null,"VS Code CSS conventions, file organization, class naming, standard sizes, SplitView\u002FGrid layout, scrollable content, responsive layout, and text overflow\u002Fellipsis patterns. Use when writing CSS, building layouts, or fixing text truncation issues.","DragonBallerZ\u002Fdragon-ide","DragonBallerZ","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F199459338?v=4","01M7DN83GSDPNQH3ACEV21SKTQ","Z McDragon","01M7DN83HDR4KMJAMTCB5S4DCJ",12,"MIT","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fux-css-layout\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ux-css-layout\ndescription: VS Code CSS conventions, file organization, class naming, standard sizes, SplitView\u002FGrid layout, scrollable content, responsive layout, and text overflow\u002Fellipsis patterns. Use when writing CSS, building layouts, or fixing text truncation issues.\n---\n\nThis skill covers CSS file organization, naming, standard sizes, programmatic layout (SplitView, Grid, scrollable), responsive patterns, and text overflow handling.\n\n---\n\n## 1. File Organization\n\nCSS files are **co-located** with their TypeScript components:\n\n```\nsrc\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fbutton\u002F\n    button.ts\n    button.css\nsrc\u002Fvs\u002Fworkbench\u002Fcontrib\u002FmyFeature\u002Fbrowser\u002F\n    myFeature.ts\n    media\u002F\n        myFeature.css\n```\n\nImport CSS directly in the TS file:\n```typescript\nimport '.\u002Fmedia\u002FmyFeature.css';\n\u002F\u002F or for base widgets:\nimport '.\u002Fbutton.css';\n```\n\nWorkbench-level global styles live in `src\u002Fvs\u002Fworkbench\u002Fbrowser\u002Fmedia\u002F`.\n\n## 2. Class Naming\n\n- **`monaco-` prefix** for all major components: `.monaco-workbench`, `.monaco-split-view2`, `.monaco-scrollable-element`\n- **Modifier classes**: `.monaco-split-view2.vertical`, `.monaco-split-view2.horizontal`\n- **State classes**: `.visible`, `.focused`, `.active`, `.highlight`\n- Feature-specific classes use kebab-case without prefix: `.my-feature`, `.outline-pane`, `.welcome-view-content`\n\n## 3. Standard Sizes\n\n| Element | Size |\n|---------|------|\n| Part title height | 35px |\n| Title padding (horizontal) | 8px |\n| Title label inner padding | 12px |\n| Action area padding | 5px |\n| Action icon size | 16px |\n| Body font-size | 13px (workbench), 11px (HTML body) |\n| Line height | 1.4em |\n| Validation message font-size | 12px (line-height: 17px) |\n\n> For `padding`\u002F`margin`\u002F`gap`, `border-radius`, `font-size`\u002F`font-weight`, codicon size and border width, prefer the design-system **size tokens** over raw px — see [§10 Design-System Size Tokens](#10-design-system-size-tokens-spacing-radius-font-codicon-stroke). Canonical reference: `.github\u002Finstructions\u002Fdesign-tokens.instructions.md` (auto-injected for `src\u002Fvs\u002F**\u002F*.css`).\n\n\n## 4. CSS Selector Quality\n\n| Anti-pattern (flagged) | Correct pattern |\n|------------------------|-----------------|\n| ID selectors for styling (`#my-widget`) | Class selectors (`.my-widget`) |\n| Overly specific selectors | Minimal specificity needed |\n| Styles in the wrong file | Co-located with the component |\n| Missing `min-width: 0` on flex children | Prevents truncation issues |\n| Forgetting `pointer-events: none` on hidden overlays | Prevents click-through bugs |\n\n### Never Add New `!important`\n\nDo not introduce `!important` in new or modified CSS. When a declaration loses the cascade, inspect the competing selector and increase specificity with the smallest appropriate component, workbench, or state-class prefix instead. Existing `!important` declarations may be preserved and must not be removed mechanically during unrelated edits. Do not copy them, add new ones, or use them to avoid understanding selector ownership.\n\nThe narrow exception is shared focus\u002Factive-outline suppression, where `outline: 0 !important` is intentionally used to override native or global focus indicators and prevent flashing outlines during pointer activation. Keep this exception scoped to focus-indicator behavior; feature styling must still resolve cascade conflicts through selector specificity.\n\n## 5. SplitView Layout\n\n**File**: `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fsplitview\u002Fsplitview.ts`\n\nFor splitting views with draggable sashes (either horizontal or vertical):\n\n```typescript\nconst splitView = new SplitView(container, {\n    orientation: Orientation.VERTICAL,\n    proportionalLayout: true,\n    styles: { separatorBorder: asCssVariable(sashBorder) }\n});\n\n\u002F\u002F Each view implements IView:\nconst myView: IView = {\n    element: myDomNode,\n    minimumSize: 100,\n    maximumSize: Number.POSITIVE_INFINITY,\n    onDidChange: Event.None,\n    layout(size, offset) { \u002F* resize content *\u002F }\n};\n\nsplitView.addView(myView, Sizing.Distribute);\n```\n\nUse `LayoutPriority.High` \u002F `.Low` to control which views resize first when space is constrained. Use `snap: true` to allow views to snap closed.\n\n## 6. Grid Layout\n\n**File**: `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fgrid\u002Fgrid.ts`\n\nFor 2D layouts (used by editor groups):\n```typescript\nconst grid = new Grid(initialView);\ngrid.addView(newView, Sizing.Distribute, referenceView, Direction.Right);\n```\n\n## 7. Scrollable Content\n\nThree classes for different needs:\n\n| Class | When to Use |\n|-------|-------------|\n| `SmoothScrollableElement` | Animated scrolling (SplitView, ListView) |\n| `DomScrollableElement` | Wrap existing DOM content (hovers, menus, breadcrumbs) |\n| `ScrollableElement` | Basic single-direction scrollbar |\n\n```typescript\nconst scrollable = new DomScrollableElement(contentNode, {\n    horizontal: ScrollbarVisibility.Auto,\n    vertical: ScrollbarVisibility.Auto\n});\nthis._register(scrollable);\ncontainer.appendChild(scrollable.getDomNode());\nscrollable.scanDomNode(); \u002F\u002F call after content changes\n```\n\n## 8. Responsive Layout\n\nVS Code does **not** use CSS media queries. Instead, it uses a **programmatic constraint-based layout system**:\n\n- `IView.minimumSize` \u002F `maximumSize` — views declare their size constraints.\n- `SplitView` and `Grid` distribute space according to constraints and `LayoutPriority`.\n- `ResizeObserver` is used for container-aware sizing (e.g., editor auto-layout).\n- The window is treated as a fixed viewport; space is distributed via sash-based resizing.\n\nWhen building a responsive component:\n1. Set `minimumSize` \u002F `maximumSize` appropriately.\n2. Use `LayoutPriority.Low` for panels that should collapse first.\n3. Use `snap: true` for panels that should snap closed when too small.\n4. Fire `onDidChange` when your constraints change dynamically.\n\n## 9. Text Overflow & Ellipsis\n\nAll text labels that can be truncated by a resizable container **must** use the ellipsis pattern. Clipped text without an ellipsis is a visual bug.\n\n### Standard Ellipsis Pattern (CSS)\n\nThe three-property combo is required — all three must be present:\n\n```css\n.my-label {\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n```\n\n### Common Locations That Need Ellipsis\n\n| Element | Why |\n|---------|-----|\n| Part title labels (`h2`, breadcrumbs) | Sidebar\u002Fpanel can be resized narrower than the title |\n| View pane header titles | View containers can be narrow |\n| List\u002Ftree row labels | Rows have a fixed width from the list container |\n| Tab labels (editor tabs) | Many tabs shrink to fit |\n| Button labels in welcome views | Buttons have `max-width` constraints |\n| Status bar items | Many items compete for horizontal space |\n| Notification message text | Notification toast\u002Fcenter has fixed width |\n| Tooltip\u002Fhover headings | Hovers have max-width |\n| Dropdown\u002Fselect items | Select boxes have bounded width |\n| Badge text \u002F descriptions | Auxiliary text in constrained columns |\n\n### Flex Container Gotchas\n\nFlex children default to `min-width: auto`, which **prevents** `text-overflow: ellipsis` from working because the flex item refuses to shrink below its content width. Fix this by setting `min-width: 0` on the flex child:\n\n```css\n\u002F* WRONG — ellipsis will NOT trigger inside a flex container *\u002F\n.flex-parent {\n\tdisplay: flex;\n}\n.flex-parent > .label {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n\u002F* CORRECT — add min-width: 0 so the flex item can shrink *\u002F\n.flex-parent > .label {\n\tmin-width: 0;          \u002F* ← this is the fix *\u002F\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n```\n\nThis pattern is used throughout VS Code — for example, `.monaco-icon-label-container` sets `min-width: 0` and `flex: 1` to allow label text to truncate.\n\n### Fixed vs Flexible Elements\n\nWhen a row has both fixed-size elements (icons, action buttons) and flexible text:\n\n```css\n.row {\n\tdisplay: flex;\n\talign-items: center;\n}\n.row > .icon {\n\tflex-shrink: 0;        \u002F* icon never shrinks *\u002F\n\twidth: 16px;\n}\n.row > .label {\n\tflex: 1;               \u002F* label takes remaining space *\u002F\n\tmin-width: 0;          \u002F* allows shrinking below content width *\u002F\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n.row > .actions {\n\tflex-shrink: 0;        \u002F* action buttons never shrink *\u002F\n}\n```\n\nThis is the standard pattern for tree rows, list items, tab labels, and view pane headers.\n\n### Hover for Full Text\n\nWhen text is truncated with ellipsis, the **full text must be accessible** via hover tooltip. Use `IHoverService.setupDelayedHover()` with the full untruncated text so users can read it:\n\n```typescript\nthis._register(this.hoverService.setupDelayedHover(labelElement, {\n\tcontent: fullLabelText,\n}));\n```\n\nFor `IconLabel` and list\u002Ftree renderers, this is handled automatically. For custom DOM, you must add it manually.\n\n### Anti-Patterns (NEVER DO)\n\n- **Never** let text clip without an ellipsis — if `overflow: hidden` is set, `text-overflow: ellipsis` must also be set.\n- **Never** rely on a fixed pixel width for text that could be localized — localized strings vary in length.\n- **Never** use `text-overflow: ellipsis` without `overflow: hidden` and `white-space: nowrap` — all three are required.\n- **Never** forget `min-width: 0` on flex children that need to truncate.\n- **Never** truncate text without providing a hover\u002Ftooltip for the full string.\n\n---\n\n## 10. Design-System Size Tokens (spacing, radius, font, codicon, stroke)\n\nVS Code ships a design-system **size** ramp, registered in `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fsizes\u002FbaseSizes.ts` and emitted as `--vscode-*` CSS variables. When writing or editing CSS, prefer the token var over a raw px value wherever a token exists. The full tables + rationale live in the auto-injected `.github\u002Finstructions\u002Fdesign-tokens.instructions.md` (canonical source — keep this section in sync with it). This section captures the **decision logic** for deeper styling tasks.\n\n> Every `--vscode-*` size var you reference must already exist in `build\u002Flib\u002Fstylelint\u002Fvscode-known-variables.json` (`\"sizes\"` array, alphabetically sorted) or stylelint\u002Fhygiene fails. Adding a *new* token means adding it both in `baseSizes.ts` and that JSON file.\n\n### Spacing — `padding`, `margin`, `gap`\n\nScale (px): `0, 2, 4, 6, 8, 10, 12, 16, 20, 24, 28, 32, 36, 40` → `--vscode-spacing-sizeNone`, `--vscode-spacing-size20` … `--vscode-spacing-size400` (token number = px × 10, so `size200` = 20px).\n\n**What matters is the value, not the token.** Adopting the `var()` is optional — a raw px value is fine **as long as it lands on the scale**. What breaks rhythm is an **off-scale** value (3, 5, 7, 14, 26px…). Snap off-scale values to the nearest scale value, **ties round up** (`5px → 6px`, `3px → 4px`, `1px → 2px`, `26px → 28px`). Each length of a shorthand is checked independently (`0 5px → 0 6px`). Leave `auto`, `%`, `em`\u002F`rem`, `var()`\u002F`calc()` untouched.\n\n### Corner radius — `border-radius`\n\n| px | Variable | Use |\n|----|----------|-----|\n| 2  | `--vscode-cornerRadius-xSmall` | very compact elements |\n| 4  | `--vscode-cornerRadius-small` | controls (buttons, inputs) |\n| 6  | `--vscode-cornerRadius-medium` | base \u002F inner surfaces |\n| 8  | `--vscode-cornerRadius-large` | prominent \u002F outer surfaces |\n| 12 | `--vscode-cornerRadius-xLarge` | very prominent surfaces |\n| 9999 | `--vscode-cornerRadius-circle` | fully rounded (pills, dots) |\n\n**Snap map** for off-scale literals (ties round **up**): `2→xSmall`, `3,4→small`, `5,6→medium`, `7,8→large`, `10,11,12→xLarge`, `14,16,18,20→xLarge`, `999→circle`.\n\n- **Pills** (radius ≈ half the element height — e.g. `28h`\u002F`14r`, `36h`\u002F`18r`, `22×22`\u002F`11r`) → `--vscode-cornerRadius-circle`, **not** xLarge. The literal-nearest token would square them and lose the fully-rounded intent.\n- **Leave untouched:** `50%`, `0`, `0px`, `inherit`, any `calc()`\u002F`var()`. Preserve `!important`.\n\n### Font size & weight\n\nGeneric UI ramp — pair a **size** token with a **weight** token (\"Strong\" = matching size token + `semiBold`, never a separate size):\n\n| px | Size var | Weight |\n|----|----------|--------|\n| 26 | `--vscode-fontSize-heading1` | semiBold |\n| 18 | `--vscode-fontSize-heading2` | semiBold |\n| 13 | `--vscode-fontSize-heading3` | semiBold |\n| 13 | `--vscode-fontSize-body1` | regular |\n| 11 | `--vscode-fontSize-body2` | regular |\n| 12 | `--vscode-fontSize-label1` | regular |\n| 11 | `--vscode-fontSize-label2` | regular |\n| 10 | `--vscode-fontSize-label3` | regular |\n\nGeneric weights: `--vscode-fontWeight-regular` (400), `--vscode-fontWeight-semiBold` (600).\n\n**Deprecated** — `--vscode-bodyFontSize` (13) → `--vscode-fontSize-body1`, `--vscode-bodyFontSize-small` (12) → `--vscode-fontSize-label1`, `--vscode-bodyFontSize-xSmall` (11) → `--vscode-fontSize-body2`.\n\nThe legacy Agents-specific `--vscode-agents-fontSize-*` and `--vscode-agents-fontWeight-*` tokens are also deprecated; use the matching generic tokens.\n\n- **No medium (500).** `font-weight: 500` is off the ramp — snap to `semiBold`. Likewise `700`\u002F`bold` → round to the nearer of 400\u002F600.\n- **\"Strong\" is not a separate size.** \"Body 1 Strong\" = the matching `--vscode-fontSize-*` size token + `semiBold`. Never add a strong *size*.\n- `normal` ≡ 400 → `regular`. Leave `inherit`, `lighter`, `bolder`, `var()`\u002F`calc()` untouched.\n\n### Codicon size — icon `font-size`\n\nCodicons are **only ever 16px or 12px** — never `14px` or any in-between value.\n\n| px | Variable | Use |\n|----|----------|-----|\n| 16 | `--vscode-codiconFontSize` (base) | default icon size |\n| 12 | `--vscode-codiconFontSize-compact` | dense\u002Finline chrome |\n\n**Compact-glyph convention:** when sizing an icon at the compact 12px size, also swap the registered glyph to its `*Compact` variant (e.g. `Codicon.close` → `Codicon.closeCompact`, `Codicon.add` → `Codicon.addCompact`). CSS `font-size` alone only scales the icon — it does **not** change to the visually-optimized compact glyph; that requires changing the registered icon (Action2 `icon:` \u002F `renderIcon`). **Only swap the glyph when no CSS selector targets the original glyph class** (e.g. `.codicon-close`); selectors keyed on the glyph class (`.codicon-add`, `.codicon-chevron-down`) break when the class becomes `-compact`, so update those selectors too (or size via a glyph-independent wrapper class like `.monaco-button`). Some icons (settings\u002Fsliders, agent, vm, info, lock, plus) have **no** compact variant — keep the regular glyph at 12px.\n\n### Stroke — border width\n\nA **single** stroke thickness: `1px` → `--vscode-strokeThickness`. Applies to the `border: 1px solid \u003Ccolor>` shorthand and `border-width: 1px`. Other widths have no token — leave them.\n\n```css\n\u002F* prefer *\u002F  border: var(--vscode-strokeThickness) solid var(--vscode-widget-border);\n\u002F* avoid  *\u002F  border: 1px solid var(--vscode-widget-border);\n```\n\n---\n\n## Key Files\n\n| Area | File |\n|------|------|\n| SplitView | `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fsplitview\u002Fsplitview.ts` |\n| Grid | `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fgrid\u002Fgrid.ts` |\n| Scrollbar | `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fscrollbar\u002FscrollableElement.ts` |\n| Global workbench styles | `src\u002Fvs\u002Fworkbench\u002Fbrowser\u002Fmedia\u002Fstyle.css` |\n","This skill covers CSS file organization, naming, standard sizes, programmatic layout (SplitView, Grid, scrollable), responsive patterns, and text overflow handling.\n\n---\n\n## 1. File Organization\n\nCSS files are **co-located** with their TypeScript components:\n\n```\nsrc\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fbutton\u002F\n    button.ts\n    button.css\nsrc\u002Fvs\u002Fworkbench\u002Fcontrib\u002FmyFeature\u002Fbrowser\u002F\n    myFeature.ts\n    media\u002F\n        myFeature.css\n```\n\nImport CSS directly in the TS file:\n```typescript\nimport '.\u002Fmedia\u002FmyFeature.css';\n\u002F\u002F or for base widgets:\nimport '.\u002Fbutton.css';\n```\n\nWorkbench-level global styles live in `src\u002Fvs\u002Fworkbench\u002Fbrowser\u002Fmedia\u002F`.\n\n## 2. Class Naming\n\n- **`monaco-` prefix** for all major components: `.monaco-workbench`, `.monaco-split-view2`, `.monaco-scrollable-element`\n- **Modifier classes**: `.monaco-split-view2.vertical`, `.monaco-split-view2.horizontal`\n- **State classes**: `.visible`, `.focused`, `.active`, `.highlight`\n- Feature-specific classes use kebab-case without prefix: `.my-feature`, `.outline-pane`, `.welcome-view-content`\n\n## 3. Standard Sizes\n\n| Element | Size |\n|---------|------|\n| Part title height | 35px |\n| Title padding (horizontal) | 8px |\n| Title label inner padding | 12px |\n| Action area padding | 5px |\n| Action icon size | 16px |\n| Body font-size | 13px (workbench), 11px (HTML body) |\n| Line height | 1.4em |\n| Validation message font-size | 12px (line-height: 17px) |\n\n> For `padding`\u002F`margin`\u002F`gap`, `border-radius`, `font-size`\u002F`font-weight`, codicon size and border width, prefer the design-system **size tokens** over raw px — see [§10 Design-System Size Tokens](#10-design-system-size-tokens-spacing-radius-font-codicon-stroke). Canonical reference: `.github\u002Finstructions\u002Fdesign-tokens.instructions.md` (auto-injected for `src\u002Fvs\u002F**\u002F*.css`).\n\n\n## 4. CSS Selector Quality\n\n| Anti-pattern (flagged) | Correct pattern |\n|------------------------|-----------------|\n| ID selectors for styling (`#my-widget`) | Class selectors (`.my-widget`) |\n| Overly specific selectors | Minimal specificity needed |\n| Styles in the wrong file | Co-located with the component |\n| Missing `min-width: 0` on flex children | Prevents truncation issues |\n| Forgetting `pointer-events: none` on hidden overlays | Prevents click-through bugs |\n\n### Never Add New `!important`\n\nDo not introduce `!important` in new or modified CSS. When a declaration loses the cascade, inspect the competing selector and increase specificity with the smallest appropriate component, workbench, or state-class prefix instead. Existing `!important` declarations may be preserved and must not be removed mechanically during unrelated edits. Do not copy them, add new ones, or use them to avoid understanding selector ownership.\n\nThe narrow exception is shared focus\u002Factive-outline suppression, where `outline: 0 !important` is intentionally used to override native or global focus indicators and prevent flashing outlines during pointer activation. Keep this exception scoped to focus-indicator behavior; feature styling must still resolve cascade conflicts through selector specificity.\n\n## 5. SplitView Layout\n\n**File**: `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fsplitview\u002Fsplitview.ts`\n\nFor splitting views with draggable sashes (either horizontal or vertical):\n\n```typescript\nconst splitView = new SplitView(container, {\n    orientation: Orientation.VERTICAL,\n    proportionalLayout: true,\n    styles: { separatorBorder: asCssVariable(sashBorder) }\n});\n\n\u002F\u002F Each view implements IView:\nconst myView: IView = {\n    element: myDomNode,\n    minimumSize: 100,\n    maximumSize: Number.POSITIVE_INFINITY,\n    onDidChange: Event.None,\n    layout(size, offset) { \u002F* resize content *\u002F }\n};\n\nsplitView.addView(myView, Sizing.Distribute);\n```\n\nUse `LayoutPriority.High` \u002F `.Low` to control which views resize first when space is constrained. Use `snap: true` to allow views to snap closed.\n\n## 6. Grid Layout\n\n**File**: `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fgrid\u002Fgrid.ts`\n\nFor 2D layouts (used by editor groups):\n```typescript\nconst grid = new Grid(initialView);\ngrid.addView(newView, Sizing.Distribute, referenceView, Direction.Right);\n```\n\n## 7. Scrollable Content\n\nThree classes for different needs:\n\n| Class | When to Use |\n|-------|-------------|\n| `SmoothScrollableElement` | Animated scrolling (SplitView, ListView) |\n| `DomScrollableElement` | Wrap existing DOM content (hovers, menus, breadcrumbs) |\n| `ScrollableElement` | Basic single-direction scrollbar |\n\n```typescript\nconst scrollable = new DomScrollableElement(contentNode, {\n    horizontal: ScrollbarVisibility.Auto,\n    vertical: ScrollbarVisibility.Auto\n});\nthis._register(scrollable);\ncontainer.appendChild(scrollable.getDomNode());\nscrollable.scanDomNode(); \u002F\u002F call after content changes\n```\n\n## 8. Responsive Layout\n\nVS Code does **not** use CSS media queries. Instead, it uses a **programmatic constraint-based layout system**:\n\n- `IView.minimumSize` \u002F `maximumSize` — views declare their size constraints.\n- `SplitView` and `Grid` distribute space according to constraints and `LayoutPriority`.\n- `ResizeObserver` is used for container-aware sizing (e.g., editor auto-layout).\n- The window is treated as a fixed viewport; space is distributed via sash-based resizing.\n\nWhen building a responsive component:\n1. Set `minimumSize` \u002F `maximumSize` appropriately.\n2. Use `LayoutPriority.Low` for panels that should collapse first.\n3. Use `snap: true` for panels that should snap closed when too small.\n4. Fire `onDidChange` when your constraints change dynamically.\n\n## 9. Text Overflow & Ellipsis\n\nAll text labels that can be truncated by a resizable container **must** use the ellipsis pattern. Clipped text without an ellipsis is a visual bug.\n\n### Standard Ellipsis Pattern (CSS)\n\nThe three-property combo is required — all three must be present:\n\n```css\n.my-label {\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n```\n\n### Common Locations That Need Ellipsis\n\n| Element | Why |\n|---------|-----|\n| Part title labels (`h2`, breadcrumbs) | Sidebar\u002Fpanel can be resized narrower than the title |\n| View pane header titles | View containers can be narrow |\n| List\u002Ftree row labels | Rows have a fixed width from the list container |\n| Tab labels (editor tabs) | Many tabs shrink to fit |\n| Button labels in welcome views | Buttons have `max-width` constraints |\n| Status bar items | Many items compete for horizontal space |\n| Notification message text | Notification toast\u002Fcenter has fixed width |\n| Tooltip\u002Fhover headings | Hovers have max-width |\n| Dropdown\u002Fselect items | Select boxes have bounded width |\n| Badge text \u002F descriptions | Auxiliary text in constrained columns |\n\n### Flex Container Gotchas\n\nFlex children default to `min-width: auto`, which **prevents** `text-overflow: ellipsis` from working because the flex item refuses to shrink below its content width. Fix this by setting `min-width: 0` on the flex child:\n\n```css\n\u002F* WRONG — ellipsis will NOT trigger inside a flex container *\u002F\n.flex-parent {\n\tdisplay: flex;\n}\n.flex-parent > .label {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n\u002F* CORRECT — add min-width: 0 so the flex item can shrink *\u002F\n.flex-parent > .label {\n\tmin-width: 0;          \u002F* ← this is the fix *\u002F\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n```\n\nThis pattern is used throughout VS Code — for example, `.monaco-icon-label-container` sets `min-width: 0` and `flex: 1` to allow label text to truncate.\n\n### Fixed vs Flexible Elements\n\nWhen a row has both fixed-size elements (icons, action buttons) and flexible text:\n\n```css\n.row {\n\tdisplay: flex;\n\talign-items: center;\n}\n.row > .icon {\n\tflex-shrink: 0;        \u002F* icon never shrinks *\u002F\n\twidth: 16px;\n}\n.row > .label {\n\tflex: 1;               \u002F* label takes remaining space *\u002F\n\tmin-width: 0;          \u002F* allows shrinking below content width *\u002F\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n.row > .actions {\n\tflex-shrink: 0;        \u002F* action buttons never shrink *\u002F\n}\n```\n\nThis is the standard pattern for tree rows, list items, tab labels, and view pane headers.\n\n### Hover for Full Text\n\nWhen text is truncated with ellipsis, the **full text must be accessible** via hover tooltip. Use `IHoverService.setupDelayedHover()` with the full untruncated text so users can read it:\n\n```typescript\nthis._register(this.hoverService.setupDelayedHover(labelElement, {\n\tcontent: fullLabelText,\n}));\n```\n\nFor `IconLabel` and list\u002Ftree renderers, this is handled automatically. For custom DOM, you must add it manually.\n\n### Anti-Patterns (NEVER DO)\n\n- **Never** let text clip without an ellipsis — if `overflow: hidden` is set, `text-overflow: ellipsis` must also be set.\n- **Never** rely on a fixed pixel width for text that could be localized — localized strings vary in length.\n- **Never** use `text-overflow: ellipsis` without `overflow: hidden` and `white-space: nowrap` — all three are required.\n- **Never** forget `min-width: 0` on flex children that need to truncate.\n- **Never** truncate text without providing a hover\u002Ftooltip for the full string.\n\n---\n\n## 10. Design-System Size Tokens (spacing, radius, font, codicon, stroke)\n\nVS Code ships a design-system **size** ramp, registered in `src\u002Fvs\u002Fplatform\u002Ftheme\u002Fcommon\u002Fsizes\u002FbaseSizes.ts` and emitted as `--vscode-*` CSS variables. When writing or editing CSS, prefer the token var over a raw px value wherever a token exists. The full tables + rationale live in the auto-injected `.github\u002Finstructions\u002Fdesign-tokens.instructions.md` (canonical source — keep this section in sync with it). This section captures the **decision logic** for deeper styling tasks.\n\n> Every `--vscode-*` size var you reference must already exist in `build\u002Flib\u002Fstylelint\u002Fvscode-known-variables.json` (`\"sizes\"` array, alphabetically sorted) or stylelint\u002Fhygiene fails. Adding a *new* token means adding it both in `baseSizes.ts` and that JSON file.\n\n### Spacing — `padding`, `margin`, `gap`\n\nScale (px): `0, 2, 4, 6, 8, 10, 12, 16, 20, 24, 28, 32, 36, 40` → `--vscode-spacing-sizeNone`, `--vscode-spacing-size20` … `--vscode-spacing-size400` (token number = px × 10, so `size200` = 20px).\n\n**What matters is the value, not the token.** Adopting the `var()` is optional — a raw px value is fine **as long as it lands on the scale**. What breaks rhythm is an **off-scale** value (3, 5, 7, 14, 26px…). Snap off-scale values to the nearest scale value, **ties round up** (`5px → 6px`, `3px → 4px`, `1px → 2px`, `26px → 28px`). Each length of a shorthand is checked independently (`0 5px → 0 6px`). Leave `auto`, `%`, `em`\u002F`rem`, `var()`\u002F`calc()` untouched.\n\n### Corner radius — `border-radius`\n\n| px | Variable | Use |\n|----|----------|-----|\n| 2  | `--vscode-cornerRadius-xSmall` | very compact elements |\n| 4  | `--vscode-cornerRadius-small` | controls (buttons, inputs) |\n| 6  | `--vscode-cornerRadius-medium` | base \u002F inner surfaces |\n| 8  | `--vscode-cornerRadius-large` | prominent \u002F outer surfaces |\n| 12 | `--vscode-cornerRadius-xLarge` | very prominent surfaces |\n| 9999 | `--vscode-cornerRadius-circle` | fully rounded (pills, dots) |\n\n**Snap map** for off-scale literals (ties round **up**): `2→xSmall`, `3,4→small`, `5,6→medium`, `7,8→large`, `10,11,12→xLarge`, `14,16,18,20→xLarge`, `999→circle`.\n\n- **Pills** (radius ≈ half the element height — e.g. `28h`\u002F`14r`, `36h`\u002F`18r`, `22×22`\u002F`11r`) → `--vscode-cornerRadius-circle`, **not** xLarge. The literal-nearest token would square them and lose the fully-rounded intent.\n- **Leave untouched:** `50%`, `0`, `0px`, `inherit`, any `calc()`\u002F`var()`. Preserve `!important`.\n\n### Font size & weight\n\nGeneric UI ramp — pair a **size** token with a **weight** token (\"Strong\" = matching size token + `semiBold`, never a separate size):\n\n| px | Size var | Weight |\n|----|----------|--------|\n| 26 | `--vscode-fontSize-heading1` | semiBold |\n| 18 | `--vscode-fontSize-heading2` | semiBold |\n| 13 | `--vscode-fontSize-heading3` | semiBold |\n| 13 | `--vscode-fontSize-body1` | regular |\n| 11 | `--vscode-fontSize-body2` | regular |\n| 12 | `--vscode-fontSize-label1` | regular |\n| 11 | `--vscode-fontSize-label2` | regular |\n| 10 | `--vscode-fontSize-label3` | regular |\n\nGeneric weights: `--vscode-fontWeight-regular` (400), `--vscode-fontWeight-semiBold` (600).\n\n**Deprecated** — `--vscode-bodyFontSize` (13) → `--vscode-fontSize-body1`, `--vscode-bodyFontSize-small` (12) → `--vscode-fontSize-label1`, `--vscode-bodyFontSize-xSmall` (11) → `--vscode-fontSize-body2`.\n\nThe legacy Agents-specific `--vscode-agents-fontSize-*` and `--vscode-agents-fontWeight-*` tokens are also deprecated; use the matching generic tokens.\n\n- **No medium (500).** `font-weight: 500` is off the ramp — snap to `semiBold`. Likewise `700`\u002F`bold` → round to the nearer of 400\u002F600.\n- **\"Strong\" is not a separate size.** \"Body 1 Strong\" = the matching `--vscode-fontSize-*` size token + `semiBold`. Never add a strong *size*.\n- `normal` ≡ 400 → `regular`. Leave `inherit`, `lighter`, `bolder`, `var()`\u002F`calc()` untouched.\n\n### Codicon size — icon `font-size`\n\nCodicons are **only ever 16px or 12px** — never `14px` or any in-between value.\n\n| px | Variable | Use |\n|----|----------|-----|\n| 16 | `--vscode-codiconFontSize` (base) | default icon size |\n| 12 | `--vscode-codiconFontSize-compact` | dense\u002Finline chrome |\n\n**Compact-glyph convention:** when sizing an icon at the compact 12px size, also swap the registered glyph to its `*Compact` variant (e.g. `Codicon.close` → `Codicon.closeCompact`, `Codicon.add` → `Codicon.addCompact`). CSS `font-size` alone only scales the icon — it does **not** change to the visually-optimized compact glyph; that requires changing the registered icon (Action2 `icon:` \u002F `renderIcon`). **Only swap the glyph when no CSS selector targets the original glyph class** (e.g. `.codicon-close`); selectors keyed on the glyph class (`.codicon-add`, `.codicon-chevron-down`) break when the class becomes `-compact`, so update those selectors too (or size via a glyph-independent wrapper class like `.monaco-button`). Some icons (settings\u002Fsliders, agent, vm, info, lock, plus) have **no** compact variant — keep the regular glyph at 12px.\n\n### Stroke — border width\n\nA **single** stroke thickness: `1px` → `--vscode-strokeThickness`. Applies to the `border: 1px solid \u003Ccolor>` shorthand and `border-width: 1px`. Other widths have no token — leave them.\n\n```css\n\u002F* prefer *\u002F  border: var(--vscode-strokeThickness) solid var(--vscode-widget-border);\n\u002F* avoid  *\u002F  border: 1px solid var(--vscode-widget-border);\n```\n\n---\n\n## Key Files\n\n| Area | File |\n|------|------|\n| SplitView | `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fsplitview\u002Fsplitview.ts` |\n| Grid | `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fgrid\u002Fgrid.ts` |\n| Scrollbar | `src\u002Fvs\u002Fbase\u002Fbrowser\u002Fui\u002Fscrollbar\u002FscrollableElement.ts` |\n| Global workbench styles | `src\u002Fvs\u002Fworkbench\u002Fbrowser\u002Fmedia\u002Fstyle.css` |\n",{"name":5,"description":7},"main","af285532414d1fa855b4360d86103c12253e6f2f",".github\u002Fskills\u002Fux-css-layout",0,"https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide","https:\u002F\u002Fgithub.com\u002FDragonBallerZ","https:\u002F\u002Fwww.velloralabs.com","Building Dangerously Disruptive Technology. ","2026-10-23 14:19:51",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add DragonBallerZ\u002Fdragon-ide --skill ux-css-layout",{"tool":39,"command":40},"bunx","bunx skills add DragonBallerZ\u002Fdragon-ide --skill ux-css-layout",{"tool":42,"command":43},"pnpm","pnpm dlx skills add DragonBallerZ\u002Fdragon-ide --skill ux-css-layout","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fux-css-layout\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7DNGQPVJGHW226R8PS3R31F","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.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-skills\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7DNGP5XJWV3CG63DVS6NR8Y","update-pr","Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-pr\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7DNGJEMNJZR24NBJ7MF5V8R","troubleshoot","Investigate unexpected behavior in the current Copilot agent session by analyzing its event log. Use when the user asks why something happened, why a request was slow, why a tool was or was not used, or why instructions\u002Fskills\u002Fagents did not load.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Ftroubleshoot\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7DNGFVCVMFN5J4ZKV27CDR1","sync","Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fsync\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7DNGC9GE8EKQED3ZR3KAJ0K","sync-upstream","Update a stale session branch by rebasing onto the latest origin. Use when the upstream has moved significantly and the session needs to catch up, resolving conflicts by preserving upstream changes and adapting session work to fit.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fsync-upstream\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7DNG9NJNG1QPJB6C3GFDHVS","merge","Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fmerge\u002FSKILL.md",[],[]]