One Dark Theme
One Dark theme for Visual Studio Code
One Dark theme for Visual Studio Code
Full workbench mockup using this variant's colors and tokenColors.
Loading...
This One Dark pack has a standard theme and a vivid theme. Both use background #282c34 and text #abb2bf. Italic keywords are a setting.
One Dark uses comments #5c6370, keywords #c678dd, strings #98c379, functions #61afef, and types #e5c07b.
One Dark Vivid keeps the comments, functions, and types. Keywords move to #d55fde. Strings move to #89ca78.
Workbench UI color keys from the theme JSON colors map.
| key | HEX | RGB | RGBA |
|---|---|---|---|
activityBar.activeBorder | |||
activityBar.background | |||
activityBar.foreground | |||
activityBarBadge.background | |||
activityBarBadge.foreground | |||
badge.background | |||
button.background | |||
button.secondaryBackground | |||
debugToolBar.background | |||
diffEditor.insertedTextBackground | |||
dropdown.background | |||
dropdown.border | |||
editor.background | |||
editor.findMatchBackground | |||
editor.findMatchBorder | |||
editor.findMatchHighlightBackground | |||
editor.foreground | |||
editor.lineHighlightBackground | |||
editor.selectionBackground | |||
editor.selectionHighlightBackground | |||
editor.selectionHighlightBorder | |||
editor.wordHighlightBackground | |||
editor.wordHighlightBorder | |||
editor.wordHighlightStrongBackground | |||
editor.wordHighlightStrongBorder | |||
editorActiveLineNumber.foreground | |||
editorBracketMatch.background | |||
editorBracketMatch.border | |||
editorCursor.background | |||
editorCursor.foreground | |||
editorError.foreground | |||
editorGroup.background | |||
editorGroup.border | |||
editorGroupHeader.tabsBackground | |||
editorHoverWidget.background | |||
editorHoverWidget.border | |||
editorIndentGuide.activeBackground | |||
editorIndentGuide.background | |||
editorInlayHint.foreground | |||
editorLineNumber.foreground | |||
editorMarkerNavigation.background | |||
editorRuler.foreground | |||
editorSuggestWidget.background | |||
editorSuggestWidget.border | |||
editorSuggestWidget.selectedBackground | |||
editorWhitespace.foreground | |||
editorWidget.background | |||
focusBorder | |||
input.background | |||
list.activeSelectionBackground | |||
list.activeSelectionForeground | |||
list.focusBackground | |||
list.highlightForeground | |||
list.hoverBackground | |||
list.inactiveSelectionBackground | |||
list.inactiveSelectionForeground | |||
menu.foreground | |||
panel.border | |||
panelTitle.activeBorder | |||
peekViewEditor.background | |||
peekViewEditor.matchHighlightBackground | |||
peekViewResult.background | |||
quickInput.list.focusBackground | |||
scrollbarSlider.activeBackground | |||
scrollbarSlider.background | |||
scrollbarSlider.hoverBackground | |||
settings.modifiedItemIndicator | |||
sideBar.background | |||
sideBar.border | |||
sideBarSectionHeader.background | |||
statusBar.background | |||
statusBar.debuggingBackground | |||
statusBar.debuggingBorder | |||
statusBar.debuggingForeground | |||
statusBar.foreground | |||
statusBar.noFolderBackground | |||
statusBarItem.hoverBackground | |||
statusBarItem.remoteBackground | |||
statusBarItem.remoteForeground | |||
tab.activeBackground | |||
tab.activeBorder | |||
tab.activeForeground | |||
tab.activeModifiedBorder | |||
tab.border | |||
tab.hoverBackground | |||
tab.inactiveBackground | |||
tab.unfocusedHoverBackground | |||
terminal.ansiBlack | |||
terminal.ansiBlue | |||
terminal.ansiBrightBlack | |||
terminal.ansiBrightBlue | |||
terminal.ansiBrightCyan | |||
terminal.ansiBrightGreen | |||
terminal.ansiBrightMagenta | |||
terminal.ansiBrightRed | |||
terminal.ansiBrightWhite | |||
terminal.ansiBrightYellow | |||
terminal.ansiCyan | |||
terminal.ansiGreen | |||
terminal.ansiMagenta | |||
terminal.ansiRed | |||
terminal.ansiWhite | |||
terminal.ansiYellow | |||
terminal.foreground | |||
textBlockQuote.background | |||
textBlockQuote.border | |||
textCodeBlock.background | |||
textLink.activeForeground | |||
textLink.foreground | |||
textPreformat.foreground | |||
titleBar.activeBackground | |||
titleBar.activeForeground | |||
titleBar.border | |||
titleBar.inactiveBackground | |||
titleBar.inactiveForeground |
Foregrounds this theme assigns to the token scope catalog. A rule with only a font style is skipped, and a longer matching scope wins. Italic and bold rules are not listed — the preview above shows them in the code.
| scope | HEX | RGB | RGBA |
|---|---|---|---|
comment | |||
comment.block | |||
comment.block.documentation | |||
comment.line | |||
constant | |||
constant.character | |||
constant.character.escape | |||
constant.numeric | |||
constant.numeric.integer | |||
constant.numeric.float | |||
constant.numeric.hex | |||
constant.numeric.octal | |||
constant.other | |||
constant.other.placeholder | |||
constant.regexp | |||
constant.rgb-value | |||
entity | |||
entity.name | |||
entity.name.function | |||
entity.name.tag | |||
entity.name.type | |||
entity.name.type.enum | |||
entity.name.type.interface | |||
entity.name.type.struct | |||
entity.other | |||
entity.other.attribute-name | |||
entity.other.inherited-class | |||
keyword | |||
keyword.control | |||
keyword.control.flow | |||
keyword.operator | |||
keyword.operator.new | |||
keyword.operator.assignment | |||
keyword.operator.arithmetic | |||
keyword.operator.logical | |||
keyword.other | |||
markup | |||
markup.bold | |||
markup.inline.raw | |||
markup.italic | |||
markup.quote | |||
markup.underline | |||
markup.underline.link | |||
meta | |||
meta.function-call | |||
punctuation.separator | |||
punctuation.separator.continuation | |||
storage | |||
storage.modifier | |||
storage.type | |||
string | |||
string.interpolated | |||
string.other | |||
string.quoted | |||
string.quoted.double | |||
string.quoted.other | |||
string.quoted.single | |||
string.quoted.triple | |||
string.regexp | |||
string.template | |||
string.unquoted | |||
support | |||
support.class | |||
support.constant | |||
support.function | |||
support.other | |||
support.type | |||
support.type.primitive | |||
support.type.property-name | |||
variable | |||
variable.language | |||
variable.other | |||
variable.other.constant | |||
variable.parameter |
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}