Skip to main content
VS Code preview Full workbench mockup using this variant's colors and tokenColors.
colors Workbench UI color keys from the theme JSON colors map.
activityBar.activeBackground #ffffff00 activityBar.background #d9d9d9 activityBar.border #ffffff00 activityBar.foreground #444444 activityBar.inactiveForeground #5a5a5a activityBarBadge.background #f0f0f000 tokenColors TextMate scopes and font styles (syntax highlighting rules).
scope foreground fontStyle punctuation.definition.delayed.unison,punctuation.definition.list.begin.unison,punctuation.definition.list.end.unison,punctuation.definition.ability.begin.unison,punctuation.definition.ability.end.unison,punctuation.operator.assignment.as.unison,punctuation.separator.pipe.unison,punctuation.separator.delimiter.unison,punctuation.definition.hash.unison #000000 — variable.other.generic-type.haskell #000000 — storage.type.haskell #000000 — support.variable.magic.python
Shiki preview TypeScript sample highlighted with this variant's colors and tokenColors.
Spectrum – black and white only theme — Spectrum light
activityBarBadge.foreground #5e5e5e
badge.background #c4c4c4
badge.foreground #333333
breadcrumb.activeSelectionForeground #4e4e4e
breadcrumb.background #ffffff
breadcrumb.focusForeground #4e4e4e
breadcrumb.foreground #616161cc
button.background #c7c7c7
button.foreground #ffffff
button.hoverBackground #e8e8e8
button.secondaryBackground #ababab
button.secondaryForeground #ffffff
button.secondaryHoverBackground #7b7b7b
checkbox.background #ffffff
checkbox.border #00000000
checkbox.foreground #616161
debugExceptionWidget.background #f3f3f3
debugExceptionWidget.border #d5d5d5
debugToolBar.background #f3f3f3
debugToolBar.border #d5d5d5
diffEditor.border #d7d7d7
diffEditor.insertedTextBackground #d5d5d533
diffEditor.removedTextBackground #92929233
dropdown.background #ffffff
dropdown.border #00000000
dropdown.foreground #616161
editor.background #ffffff
editor.findMatchBackground #f2f2f2
editor.findMatchBorder #dedede
editor.findMatchHighlightBackground #e6e6e6
editor.findMatchHighlightBorder #ffffff00
editor.findRangeHighlightBackground #b4b4b44d
editor.findRangeHighlightBorder #ffffff00
editor.foldBackground #d1d1d14d
editor.foreground #000000
editor.hoverHighlightBackground #add6ff26
editor.inactiveSelectionBackground #f8f8f9
editor.lineHighlightBackground #ffffff0A
editor.lineHighlightBorder #eeeeee
editor.rangeHighlightBackground #fbfbfb
editor.rangeHighlightBorder #e2e2e200
editor.selectionBackground #e4e4e4
editor.selectionHighlightBackground #ffffff80
editor.selectionHighlightBorder #b4b4b4
editor.wordHighlightBackground #57575740
editor.wordHighlightStrongBackground #9b9b9b40
editorBracketMatch.background #0064001a
editorBracketMatch.border #b9b9b9
editorCodeLens.foreground #999999
editorCursor.background #ffffff
editorCursor.foreground #000000
editorError.background #B73A3400
editorError.border #ffffff00
editorError.foreground #000000
editorGroup.border #e7e7e7
editorGroup.emptyBackground #ffffff
editorGroupHeader.tabsBackground #ffffff
editorGroupHeader.tabsBorder #ffffff
editorGutter.addedBackground #bebebe
editorGutter.background #ffffff
editorGutter.commentRangeForeground #424242
editorGutter.deletedBackground #000000
editorGutter.foldingControlForeground #424242
editorGutter.modifiedBackground #000000
editorHoverWidget.background #f3f3f3
editorHoverWidget.border #c8c8c8
editorHoverWidget.foreground #616161
editorIndentGuide.activeBackground #ffffff00
editorIndentGuide.background #ffffff00
editorInfo.background #4490BF00
editorInfo.border #4490BF00
editorInfo.foreground #d3d3d3
editorLineNumber.activeForeground #000000
editorLineNumber.foreground #cbcbcb
editorLink.activeForeground #000000
editorMarkerNavigation.background #ffffff
editorMarkerNavigationError.background #a9a9a9
editorMarkerNavigationInfo.background #a9a9a9
editorMarkerNavigationWarning.background #a9a9a9
editorOverviewRuler.background #25252500
editorOverviewRuler.border #ffffff00
editorRuler.foreground #ffffff00
editorSuggestWidget.background #ffffff
editorSuggestWidget.border #8e8e8e
editorSuggestWidget.foreground #000000
editorSuggestWidget.highlightForeground #000000
editorSuggestWidget.selectedBackground #f2f2f2
editorWarning.background #A9904000
editorWarning.border #ffffff00
editorWarning.foreground #bababa
editorWhitespace.foreground #33333333
editorWidget.background #f3f3f3
editorWidget.foreground #616161
editorWidget.resizeBorder #c7c7c7
focusBorder #dddddd
foreground #000
gitDecoration.addedResourceForeground #000000
gitDecoration.conflictingResourceForeground #6b6b6b
gitDecoration.deletedResourceForeground #d7d7d7
gitDecoration.ignoredResourceForeground #d7d7d7
gitDecoration.modifiedResourceForeground #000000
gitDecoration.stageDeletedResourceForeground #d7d7d7
gitDecoration.stageModifiedResourceForeground #000000
gitDecoration.submoduleResourceForeground #6b6b6b
gitDecoration.untrackedResourceForeground #d7d7d7
icon.foreground #CECECE
input.background #ffffff
input.border #00000000
input.foreground #616161
input.placeholderForeground #767676
inputOption.activeBackground #0090f133
inputOption.activeBorder #007acc00
inputOption.activeForeground #000000
list.activeSelectionBackground #eaeaea
list.activeSelectionForeground #000000
list.dropBackground #eaeaea
list.focusAndSelectionOutline #ffffff00
list.focusBackground #f9f9f9
list.focusForeground #616161
list.highlightForeground #3d3d3d
list.hoverBackground #ffffff00
list.hoverForeground #757575
list.inactiveSelectionBackground #ffffff00
list.inactiveSelectionForeground #616161
listFilterWidget.background #fbfbfb
listFilterWidget.noMatchesOutline #cccccc
listFilterWidget.outline #00000000
menu.background #ffffff
menu.border #00000085
menu.foreground #616161
menu.selectionBackground #5c5c5c
menu.selectionBorder #00000000
menu.selectionForeground #ffffff
menu.separatorBackground #888888
menubar.selectionBackground #0000001a
menubar.selectionForeground #333333
merge.commonContentBackground #E5E5E5
merge.commonHeaderBackground #BFBFBF
merge.currentContentBackground #e8e8e8
merge.currentHeaderBackground #cfcfcf
merge.incomingContentBackground #e8e8e8
merge.incomingHeaderBackground #BFBFBF
minimap.background #ffffff
minimap.errorHighlight #000000
minimap.findMatchHighlight #f2f2f2
minimap.selectionHighlight #e4e4e4
minimap.warningHighlight #bababa
minimapGutter.addedBackground #bebebe
minimapGutter.deletedBackground #000000
minimapGutter.modifiedBackground #000000
notificationCenter.border #d5d5d5
notificationCenterHeader.background #e7e7e7
notificationCenterHeader.foreground #616161
notifications.background #f3f3f3
notifications.border #e7e7e7
notifications.foreground #616161
notificationsErrorIcon.foreground #000000
notificationsInfoIcon.foreground #000000
notificationsWarningIcon.foreground #000000
notificationToast.border #d5d5d5
panel.background #ffffff
panel.border #80808059
panelSection.border #80808059
panelTitle.activeBorder #424242
panelTitle.activeForeground #424242
panelTitle.inactiveForeground #424242bf
peekView.border #f2f2f2
peekViewEditor.background #ffffff
peekViewEditor.matchHighlightBackground #e2e2e2de
peekViewEditor.matchHighlightBorder #ffffff
peekViewEditorGutter.background #f2f8fc
peekViewResult.background #f3f3f3
peekViewResult.fileForeground #000000
peekViewResult.lineForeground #646465
peekViewResult.matchHighlightBackground #bebebe
peekViewResult.selectionBackground #d3d3d333
peekViewResult.selectionForeground #6c6c6c
peekViewTitle.background #ffffff
peekViewTitleDescription.foreground #616161e6
peekViewTitleLabel.foreground #333333
pickerGroup.border #cccedb
pickerGroup.foreground #000000
progressBar.background #888888
scrollbar.shadow #dddddd
scrollbarSlider.activeBackground #00000099
scrollbarSlider.background #64646466
scrollbarSlider.hoverBackground #646464b3
selection.background #f0f0f0
settings.dropdownBackground #e5e5e5
settings.dropdownForeground #333333
settings.focusedRowBackground #e0e0e0
settings.headerForeground #5a5a5a
settings.modifiedItemIndicator #757575
settings.numberInputBackground #e0e0e0
settings.numberInputForeground #333333
settings.textInputBackground #f0f0f0
settings.textInputForeground #4a4a4a
sideBar.background #f9f9f9
sideBar.border #f0f0f000
sideBar.dropBackground #eaeaea
sideBar.foreground #757575
sideBarSectionHeader.background #00000000
sideBarSectionHeader.border #ffffff00
sideBarSectionHeader.foreground #616161
sideBarTitle.foreground #6f6f6f
statusBar.background #e0e0e0
statusBar.debuggingBackground #ffffff
statusBar.debuggingForeground #ffffff
statusBar.foreground #000000
statusBar.noFolderBackground #ffffff
statusBar.noFolderForeground #ffffff
statusBarItem.activeBackground #FFFFFF25
statusBarItem.hoverBackground #ffffff1f
statusBarItem.remoteBackground #e0e0e0
statusBarItem.remoteForeground #000000
tab.activeBackground #ffffff
tab.activeBorder #00000000
tab.activeBorderTop #00000000
tab.activeForeground #333333
tab.border #ffffff
tab.inactiveBackground #ffffff
tab.inactiveForeground #000000
terminal.ansiBlack #000000
terminal.ansiBlue #0451a5
terminal.ansiBrightBlack #666666
terminal.ansiBrightBlue #0451a5
terminal.ansiBrightCyan #0598bc
terminal.ansiBrightGreen #14ce14
terminal.ansiBrightMagenta #bc05bc
terminal.ansiBrightRed #cd3131
terminal.ansiBrightWhite #a5a5a5
terminal.ansiBrightYellow #b5ba00
terminal.ansiCyan #0598bc
terminal.ansiGreen #00bc00
terminal.ansiMagenta #bc05bc
terminal.ansiRed #cd3131
terminal.ansiWhite #555555
terminal.ansiYellow #949800
terminal.border #80808059
terminal.foreground #333333
terminal.selectionBackground #00000040
terminalCursor.background #000000
terminalCursor.foreground #ffffff
textLink.foreground #000000
titleBar.activeBackground #e0e0e0
titleBar.activeForeground #333333
titleBar.border #00000000
titleBar.inactiveBackground #dddddd99
titleBar.inactiveForeground #33333399
tree.indentGuidesStroke #ffffff00
walkThrough.embeddedEditorBackground #00000050
widget.shadow #00000029 #000000
punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python #000000 —
variable.parameter.function.language.special.self.python #000000 —
storage.modifier.lifetime.rust #000000 —
support.function.std.rust #000000 —
entity.name.lifetime.rust #000000 —
variable.language.rust #000000 —
support.constant.edge #000000 —
constant.other.character-class.regexp #000000 —
keyword.operator.quantifier.regexp #000000 —
punctuation.definition.string.begin,punctuation.definition.string.end #000000 —
variable.parameter.function #000000 —
comment markup.link #bebebe —
markup.changed.diff #000000 —
meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff #000000 —
markup.inserted.diff #000000 —
markup.deleted.diff #000000 —
meta.function.c,meta.function.cpp #000000 —
punctuation.section.block.begin.bracket.curly.cpp,punctuation.section.block.end.bracket.curly.cpp,punctuation.terminator.statement.c,punctuation.section.block.begin.bracket.curly.c,punctuation.section.block.end.bracket.curly.c,punctuation.section.parens.begin.bracket.round.c,punctuation.section.parens.end.bracket.round.c,punctuation.section.parameters.begin.bracket.round.c,punctuation.section.parameters.end.bracket.round.c #000000 —
punctuation.separator.key-value #000000 —
keyword.operator.expression.import #000000 —
support.constant.math #000000 —
support.constant.property.math #000000 —
variable.other.constant #000000 —
storage.type.annotation.java, storage.type.object.array.java #000000 —
punctuation.section.block.begin.java,punctuation.section.block.end.java,punctuation.definition.method-parameters.begin.java,punctuation.definition.method-parameters.end.java,meta.method.identifier.java,punctuation.section.method.begin.java,punctuation.section.method.end.java,punctuation.terminator.java,punctuation.section.class.begin.java,punctuation.section.class.end.java,punctuation.section.inner-class.begin.java,punctuation.section.inner-class.end.java,meta.method-call.java,punctuation.section.class.begin.bracket.curly.java,punctuation.section.class.end.bracket.curly.java,punctuation.section.method.begin.bracket.curly.java,punctuation.section.method.end.bracket.curly.java,punctuation.separator.period.java,punctuation.bracket.angle.java,punctuation.definition.annotation.java,meta.method.body.java #000000 —
storage.modifier.import.java,storage.type.java,storage.type.generic.java #000000 —
keyword.operator.instanceof.java #000000 —
meta.definition.variable.name.java #000000 —
keyword.operator.logical #000000 —
keyword.operator.bitwise #000000 —
keyword.operator.channel #000000 —
support.constant.property-value.scss,support.constant.property-value.css #000000 —
keyword.operator.css,keyword.operator.scss,keyword.operator.less #000000 —
support.constant.color.w3c-standard-color-name.css,support.constant.color.w3c-standard-color-name.scss #000000 —
punctuation.separator.list.comma.css #000000 —
support.constant.color.w3c-standard-color-name.css #000000 —
support.type.vendored.property-name.css #000000 —
support.module.node,support.type.object.module,support.module.node #000000 —
entity.name.type.module #000000 —
variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node #000000 —
support.constant.json #000000 —
keyword.operator.expression.instanceof, keyword.operator.new, keyword.operator.ternary, keyword.operator.optional, keyword.operator.expression.keyof #000000 —
support.type.object.console #000000 —
support.variable.property.process #000000 —
entity.name.function,support.function.console #000000 —
keyword.operator.misc.rust #000000 —
keyword.operator.sigil.rust #000000 —
keyword.operator.delete #000000 —
support.type.object.dom #000000 —
support.variable.dom,support.variable.property.dom #000000 —
keyword.operator.arithmetic,keyword.operator.comparison,keyword.operator.decrement,keyword.operator.increment,keyword.operator.relational #000000 —
keyword.operator.assignment.c,keyword.operator.comparison.c,keyword.operator.c,keyword.operator.increment.c,keyword.operator.decrement.c,keyword.operator.bitwise.shift.c,keyword.operator.assignment.cpp,keyword.operator.comparison.cpp,keyword.operator.cpp,keyword.operator.increment.cpp,keyword.operator.decrement.cpp,keyword.operator.bitwise.shift.cpp #000000 —
punctuation.separator.delimiter #000000 —
punctuation.separator.c,punctuation.separator.cpp #000000 —
support.type.posix-reserved.c,support.type.posix-reserved.cpp #000000 —
keyword.operator.sizeof.c,keyword.operator.sizeof.cpp #000000 —
variable.parameter.function.language.python #000000 —
support.type.python #000000 —
keyword.operator.logical.python #000000 —
variable.parameter.function.python #000000 —
punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python #000000 —
meta.function-call.generic.python #000000 —
constant.character.format.placeholder.other.python #000000 —
keyword.operator.assignment.compound #000000 —
keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts #000000 —
entity.name.namespace #000000 —
variable.language #000000 —
token.variable.parameter.java #000000 —
import.storage.java #000000 —
token.package.keyword #000000 —
entity.name.function, meta.require, support.function.any-method, variable.function #000000 —
entity.name.type.namespace #000000 —
support.class, entity.name.type.class #000000 —
entity.name.class.identifier.namespace.type #000000 —
entity.name.class, variable.other.class.js, variable.other.class.ts #000000 —
variable.other.class.php #000000 —
control.elements, keyword.operator.less #000000 —
keyword.other.special-method #000000 —
keyword.operator.expression.delete,keyword.operator.expression.in,keyword.operator.expression.of,keyword.operator.expression.instanceof,keyword.operator.new,keyword.operator.expression.typeof,keyword.operator.expression.void #000000 —
token.storage.type.java #000000 —
support.type.property-name #000000 —
support.constant.property-value #000000 —
support.constant.font-name #000000 —
entity.other.inherited-class #000000 —
constant.other.symbol #000000 —
punctuation.definition.constant #000000 —
entity.other.attribute-name #000000 —
entity.other.attribute-name.id #000000 normal
entity.other.attribute-name.class.css #000000 normal
markup.heading punctuation.definition.heading, entity.name.section #000000 —
keyword.other.unit #000000 —
markup.bold,todo.bold #000000 —
punctuation.definition.bold #000000 —
markup.italic, punctuation.definition.italic,todo.emphasis #000000 —
entity.name.section.markdown #000000 —
punctuation.definition.heading.markdown #000000 —
punctuation.definition.list.begin.markdown #000000 —
markup.heading.setext #000000 —
punctuation.definition.bold.markdown #000000 —
markup.inline.raw.markdown #000000 —
markup.inline.raw.string.markdown #000000 —
punctuation.definition.list.markdown #000000 —
punctuation.definition.string.begin.markdown, punctuation.definition.string.end.markdown, punctuation.definition.metadata.markdown #000000 —
beginning.punctuation.definition.list.markdown #000000 —
punctuation.definition.metadata.markdown #000000 —
markup.underline.link.markdown,markup.underline.link.image.markdown #000000 —
string.other.link.title.markdown,string.other.link.description.markdown #000000 —
constant.character.escape #000000 —
punctuation.section.embedded, variable.interpolation #000000 —
punctuation.section.embedded.begin,punctuation.section.embedded.end #000000 —
invalid.illegal.bad-ampersand.html #000000 —
invalid.deprecated #000000 —
invalid.unimplemented #000000 —
source.json meta.structure.dictionary.json > string.quoted.json #000000 —
source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string #000000 —
source.json meta.structure.dictionary.json > value.json > string.quoted.json,source.json meta.structure.array.json > value.json > string.quoted.json,source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation,source.json meta.structure.array.json > value.json > string.quoted.json > punctuation #000000 —
source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json #000000 —
support.type.property-name.json #000000 —
support.type.property-name.json punctuation #000000 —
text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade #000000 —
text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade #000000 —
support.other.namespace.use.php,support.other.namespace.use-as.php,support.other.namespace.php,entity.other.alias.php,meta.interface.php #000000 —
keyword.operator.error-control.php #000000 —
keyword.operator.type.php #000000 —
punctuation.section.array.begin.php #000000 —
punctuation.section.array.end.php #000000 —
invalid.illegal.non-null-typehinted.php #000000 —
storage.type.php,meta.other.type.phpdoc.php,keyword.other.type.php,keyword.other.array.phpdoc.php #000000 —
meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php #000000 —
punctuation.definition.parameters.begin.bracket.round.php,punctuation.definition.parameters.end.bracket.round.php,punctuation.separator.delimiter.php,punctuation.section.scope.begin.php,punctuation.section.scope.end.php,punctuation.terminator.expression.php,punctuation.definition.arguments.begin.bracket.round.php,punctuation.definition.arguments.end.bracket.round.php,punctuation.definition.storage-type.begin.bracket.round.php,punctuation.definition.storage-type.end.bracket.round.php,punctuation.definition.array.begin.bracket.round.php,punctuation.definition.array.end.bracket.round.php,punctuation.definition.begin.bracket.round.php,punctuation.definition.end.bracket.round.php,punctuation.definition.begin.bracket.curly.php,punctuation.definition.end.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php,punctuation.definition.section.switch-block.start.bracket.curly.php,punctuation.definition.section.switch-block.begin.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php #000000 —
support.constant.core.rust #000000 —
support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php #000000 —
entity.name.goto-label.php,support.other.php #000000 —
keyword.operator.logical.php,keyword.operator.bitwise.php,keyword.operator.arithmetic.php #000000 —
keyword.operator.regexp.php #000000 —
keyword.operator.comparison.php #000000 —
keyword.operator.heredoc.php,keyword.operator.nowdoc.php #000000 —
meta.function.decorator.python #000000 —
support.token.decorator.python,meta.function.decorator.identifier.python #000000 —
function.parameter #000000 —
function.parameter.ruby, function.parameter.cs #000000 —
constant.language.symbol.ruby #000000 —
inline-color-decoration rgb-value #000000 —
support.type.primitive.ts,support.type.builtin.ts,support.type.primitive.tsx,support.type.builtin.tsx #000000 —
block.scope.end,block.scope.begin #000000 —
entity.name.variable.local.cs #000000 —
token.error-token #000000 —
token.debug-token #000000 —
punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end, punctuation.section.embedded #000000 —
meta.template.expression #000000 —
keyword.operator.module #000000 —
support.type.type.flowtype #000000 —
support.type.primitive #000000 —
meta.property.object #000000 —
variable.parameter.function.js #000000 —
keyword.other.template.begin #000000 —
keyword.other.template.end #000000 —
keyword.other.substitution.begin #000000 —
keyword.other.substitution.end #000000 —
keyword.operator.assignment #000000 —
keyword.operator.assignment.go #000000 —
keyword.operator.arithmetic.go, keyword.operator.address.go #000000 —
entity.name.package.go #000000 —
support.type.prelude.elm #000000 —
support.constant.elm #000000 —
punctuation.quasi.element #000000 —
constant.character.entity #000000 —
entity.other.attribute-name.pseudo-element, entity.other.attribute-name.pseudo-class #000000 —
entity.global.clojure #000000 —
meta.symbol.clojure #000000 —
constant.keyword.clojure #000000 —
meta.arguments.coffee, variable.parameter.function.coffee #000000 —
meta.scope.prerequisites.makefile #000000 —
storage.modifier.import.groovy #000000 —
meta.method.groovy #000000 —
meta.definition.variable.name.groovy #000000 —
meta.definition.class.inherited.classes.groovy #000000 —
support.variable.semantic.hlsl #000000 —
support.type.texture.hlsl, support.type.sampler.hlsl, support.type.object.hlsl, support.type.object.rw.hlsl, support.type.fx.hlsl, support.type.object.hlsl #000000 —
text.variable, text.bracketed #000000 —
support.type.swift, support.type.vb.asp #000000 —
entity.name.function.xi #000000 —
entity.name.class.xi #000000 —
constant.character.character-class.regexp.xi #000000 —
constant.regexp.xi #000000 —
keyword.control.xi #000000 —
beginning.punctuation.definition.quote.markdown.xi #000000 —
beginning.punctuation.definition.list.markdown.xi #bebebe —
constant.character.xi #000000 —
constant.other.color.rgb-value.xi #000000 —
punctuation.definition.tag.xi #bebebe —
entity.name.label.cs, entity.name.scope-resolution.function.call, entity.name.scope-resolution.function.definition #000000 —
entity.name.label.cs, markup.heading.setext.1.markdown, markup.heading.setext.2.markdown #000000 —
meta.brace.square #000000 —
comment, punctuation.definition.comment #bebebe italic
markup.quote.markdown #bebebe —
punctuation.definition.block.sequence.item.yaml #000000 —
constant.language.symbol.elixir #000000 —
entity.other.attribute-name.js,entity.other.attribute-name.ts,entity.other.attribute-name.jsx,entity.other.attribute-name.tsx,variable.parameter,variable.language.super — italic
comment.line.double-slash,comment.block.documentation — italic
keyword.control.import.python,keyword.control.flow.python — italic
markup.italic.markdown — italic
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 }!` ;
}
fetchUser.ts
index.ts
README.md
src
components
fetchUser.ts
src
components
fetchUser.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Problems1
Output
Debug Console
Terminal
Ports
~/my-project $ pnpm dev
▲ Next.js ready on http://localhost:3000
✓ compiled client and server successfully in 412ms
wait - compiling /theme/vscode...
main*
Button.tsx
fetchUser
31
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 }!` ;
}
Spectrum – black and white only theme | Coding Theme