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 #00000000 activityBar.background #000000 activityBar.border #51515136 activityBar.foreground #ffffff activityBar.inactiveForeground #ffffff6e activityBarBadge.background #960000 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 #92000b — variable.other.generic-type.haskell #8c00b6 — storage.type.haskell #ff7c00 — support.variable.magic.python
Shiki preview TypeScript sample highlighted with this variant's colors and tokenColors.
Red Accent — Red Accent Theme
activityBarBadge.foreground #ffffff
badge.background #4b0000
badge.foreground #ffffff
breadcrumb.activeSelectionForeground #ffffff
breadcrumb.background #000000
breadcrumb.focusForeground #ffffff
breadcrumb.foreground #ffffffcc
button.background #7d0909
button.foreground #ffffff
button.hoverBackground #c90000
button.secondaryBackground #242424
button.secondaryForeground #e8e8e8
button.secondaryHoverBackground #343434
checkbox.background #1b1b1b
checkbox.border #00000000
checkbox.foreground #c9c9c9
debugExceptionWidget.background #000000
debugExceptionWidget.border #000000a7
debugToolBar.background #000000
debugToolBar.border #000000a7
diffEditor.border #00000000
diffEditor.insertedTextBackground #38ff0022
diffEditor.insertedTextBorder #00000000
diffEditor.removedTextBackground #ff000034
dropdown.background #1b1b1b
dropdown.border #00000000
dropdown.foreground #c9c9c9
editor.background #000000
editor.findMatchBackground #730000
editor.findMatchBorder #565656b7
editor.findMatchHighlightBackground #ea5c0055
editor.findMatchHighlightBorder #ffffff00
editor.findRangeHighlightBackground #3a3d4166
editor.findRangeHighlightBorder #ffffff00
editor.foldBackground #264f784d
editor.foreground #929292
editor.hoverHighlightBackground #264f7840
editor.inactiveSelectionBackground #282828
editor.lineHighlightBackground #ffffff0A
editor.lineHighlightBorder #282828
editor.rangeHighlightBackground #ffffff0b
editor.rangeHighlightBorder #ffffff00
editor.selectionBackground #30303080
editor.selectionHighlightBackground #ff000026
editor.selectionHighlightBorder #774949
editor.wordHighlightBackground #575757b8
editor.wordHighlightStrongBackground #2a2a2ab8
editorBracketMatch.background #0064001a
editorBracketMatch.border #888888
editorCodeLens.foreground #949494
editorCursor.background #000000
editorCursor.foreground #8e8e8e
editorError.background #00000000
editorError.border #ffffff00
editorError.foreground #ff2b00
editorGroup.border #000000
editorGroup.emptyBackground #000000
editorGroupHeader.border #000000a7
editorGroupHeader.tabsBackground #000000
editorGroupHeader.tabsBorder #000000a7
editorGutter.addedBackground #adff00
editorGutter.background #0d0d0d
editorGutter.commentRangeForeground #c5c5c5
editorGutter.deletedBackground #ff000c
editorGutter.foldingControlForeground #c5c5c5
editorGutter.modifiedBackground #00c7ff
editorHoverWidget.background #000000
editorHoverWidget.border #343434
editorHoverWidget.foreground #cccccc
editorIndentGuide.activeBackground #707070
editorIndentGuide.background #404040
editorInfo.background #4490BF00
editorInfo.border #4490BF00
editorInfo.foreground #0087ff
editorLineNumber.activeForeground #ffffff
editorLineNumber.foreground #868686
editorLink.activeForeground #d7d7d7
editorMarkerNavigation.background #000000
editorMarkerNavigationError.background #ff2b00
editorMarkerNavigationInfo.background #0087ff
editorMarkerNavigationWarning.background #ffd100
editorOverviewRuler.background #25252500
editorOverviewRuler.border #7f7f7f4d
editorRuler.foreground #5a5a5a
editorSuggestWidget.background #000000
editorSuggestWidget.border #303030
editorSuggestWidget.foreground #bcbcbc
editorSuggestWidget.highlightForeground #fb0000
editorSuggestWidget.selectedBackground #2c0000
editorWarning.background #A9904000
editorWarning.border #ffffff00
editorWarning.foreground #ffd100
editorWhitespace.foreground #ffffff5e
editorWidget.background #000000
editorWidget.foreground #a9a9a9
editorWidget.resizeBorder #ff0000a7
focusBorder #d40000
foreground #d70000
gitDecoration.addedResourceForeground #81b88b
gitDecoration.conflictingResourceForeground #6c6cc4
gitDecoration.deletedResourceForeground #c74e39
gitDecoration.ignoredResourceForeground #8c8c8c
gitDecoration.modifiedResourceForeground #e2c08d
gitDecoration.stageDeletedResourceForeground #c74e39
gitDecoration.stageModifiedResourceForeground #e2c08d
gitDecoration.submoduleResourceForeground #8db9e2
gitDecoration.untrackedResourceForeground #73c991
icon.foreground #d70000
input.background #1b1b1b
input.border #00000000
input.foreground #c9c9c9
input.placeholderForeground #f0f0f0
inputOption.activeBackground #a3000066
inputOption.activeBorder #007acc00
inputOption.activeForeground #ffffff
list.activeSelectionBackground #4f0000e3
list.activeSelectionForeground #ececec
list.dropBackground #2a2a2a78
list.focusBackground #3d00008b
list.focusForeground #e0e0e0
list.highlightForeground #ff0000
list.hoverBackground #26000095
list.hoverForeground #cbcbcb
list.inactiveSelectionBackground #360000ad
list.inactiveSelectionForeground #a9a9a9
listFilterWidget.background #2e2266
listFilterWidget.noMatchesOutline #ff1700
listFilterWidget.outline #00000000
menu.background #000000
menu.border #00000032
menu.foreground #a9a9a9
menu.selectionBackground #4f0000
menu.selectionBorder #00000000
menu.selectionForeground #ffffff
menu.separatorBackground #626262
menubar.selectionBackground #ff00003c
menubar.selectionBorder #ff000000
menubar.selectionForeground #ffffff
merge.commonContentBackground #282828
merge.commonHeaderBackground #383838
merge.currentContentBackground #27403B
merge.currentHeaderBackground #367366
merge.incomingContentBackground #28384B
merge.incomingHeaderBackground #395F8F
minimap.background #000000
minimap.errorHighlight #ff2b00
minimap.findMatchHighlight #730000
minimap.selectionHighlight #30303080
minimap.warningHighlight #ffd100
minimapGutter.addedBackground #adff00
minimapGutter.deletedBackground #ff000c
minimapGutter.modifiedBackground #00c7ff
notificationCenter.border #474747
notificationCenterHeader.background #000000
notificationCenterHeader.foreground #ffffff
notifications.background #000000
notifications.border #262626
notifications.foreground #e6e6e6
notificationsErrorIcon.foreground #ff2b00
notificationsInfoIcon.foreground #0087ff
notificationsWarningIcon.foreground #ffd100
notificationToast.border #ff0000a7
panel.background #000000
panel.border #ff0000a7
panelSection.border #ffffff59
panelTitle.activeBorder #ffffff
panelTitle.activeForeground #ffffff
panelTitle.inactiveForeground #ffffff99
peekView.border #00000000
peekViewEditor.background #1d0000
peekViewEditor.matchHighlightBackground #58004a60
peekViewEditor.matchHighlightBorder #d300ff
peekViewEditorGutter.background #130000
peekViewResult.background #000000
peekViewResult.fileForeground #e6e6e6
peekViewResult.lineForeground #ababab
peekViewResult.matchHighlightBackground #ff00ef4d
peekViewResult.selectionBackground #d1000033
peekViewResult.selectionForeground #ffffff
peekViewTitle.background #000000
peekViewTitleDescription.foreground #ccccccb3
peekViewTitleLabel.foreground #ffffff
pickerGroup.border #ff0000a7
pickerGroup.foreground #b2b2b2
progressBar.background #c00e0e
scrollbar.shadow #000000
scrollbarSlider.activeBackground #ffffff66
scrollbarSlider.background #515151
scrollbarSlider.hoverBackground #909090b3
selection.background #880c0c
settings.focusedRowBackground #ffffff07
settings.headerForeground #d70000
sideBar.background #000000
sideBar.border #000000a7
sideBar.dropBackground #2a2a2a78
sideBar.foreground #a9a9a9
sideBarSectionHeader.background #51515136
sideBarSectionHeader.border #00000000
sideBarSectionHeader.foreground #c2c2c2
sideBarTitle.foreground #a9a9a9
statusBar.background #000000
statusBar.debuggingBackground #33005e
statusBar.debuggingForeground #ffffff
statusBar.foreground #ffffff
statusBar.noFolderBackground #2c0000
statusBar.noFolderForeground #ffffff
statusBarItem.activeBackground #FFFFFF25
statusBarItem.hoverBackground #ffffff1f
statusBarItem.remoteBackground #4d0000
statusBarItem.remoteForeground #ffffff
tab.activeBackground #5c000058
tab.activeBorder #00000000
tab.activeBorderTop #ff000000
tab.activeForeground #ffffff
tab.border #000000a7
tab.hoverBackground #212121
tab.inactiveBackground #000000
tab.inactiveForeground #ffffff80
terminal.ansiBlack #000000
terminal.ansiBlue #2472c8
terminal.ansiBrightBlack #666666
terminal.ansiBrightBlue #3b8eea
terminal.ansiBrightCyan #29b8db
terminal.ansiBrightGreen #23d18b
terminal.ansiBrightMagenta #d670d6
terminal.ansiBrightRed #f14c4c
terminal.ansiBrightWhite #e5e5e5
terminal.ansiBrightYellow #f5f543
terminal.ansiCyan #11a8cd
terminal.ansiGreen #0dbc79
terminal.ansiMagenta #bc3fbc
terminal.ansiRed #cd3131
terminal.ansiWhite #e5e5e5
terminal.ansiYellow #e5e510
terminal.border #ffffff59
terminal.foreground #cccccc
terminal.selectionBackground #88888840
terminalCursor.background #82000083
terminalCursor.foreground #d5d5d5
textLink.foreground #d30000
titleBar.activeBackground #000000
titleBar.activeForeground #dbdbdb
titleBar.border #000000a7
titleBar.inactiveBackground #00000099
titleBar.inactiveForeground #ffffff99
tree.indentGuidesStroke #888888
walkThrough.embeddedEditorBackground #00000050
widget.shadow #0000005c #92000b
punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python #929292 —
variable.parameter.function.language.special.self.python #e09200 —
storage.modifier.lifetime.rust #929292 —
support.function.std.rust #008cff —
entity.name.lifetime.rust #e09200 —
variable.language.rust #92000b —
support.constant.edge #8c00b6 —
constant.other.character-class.regexp #92000b —
keyword.operator.quantifier.regexp #ff7c00 —
punctuation.definition.string.begin,punctuation.definition.string.end #48ab00 —
variable.parameter.function #929292 —
comment markup.link #5a5a5a —
markup.changed.diff #e09200 —
meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff #008cff —
markup.inserted.diff #48ab00 —
markup.deleted.diff #92000b —
meta.function.c,meta.function.cpp #92000b —
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 #929292 —
punctuation.separator.key-value #929292 —
keyword.operator.expression.import #008cff —
support.constant.math #e09200 —
support.constant.property.math #ff7c00 —
variable.other.constant #e09200 —
storage.type.annotation.java, storage.type.object.array.java #e09200 —
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 #929292 —
storage.modifier.import.java,storage.type.java,storage.type.generic.java #e09200 —
keyword.operator.instanceof.java #8c00b6 —
meta.definition.variable.name.java #92000b —
keyword.operator.logical #00cfff —
keyword.operator.bitwise #00cfff —
keyword.operator.channel #00cfff —
support.constant.property-value.scss,support.constant.property-value.css #ff7c00 —
keyword.operator.css,keyword.operator.scss,keyword.operator.less #00cfff —
support.constant.color.w3c-standard-color-name.css,support.constant.color.w3c-standard-color-name.scss #ff7c00 —
punctuation.separator.list.comma.css #929292 —
support.constant.color.w3c-standard-color-name.css #ff7c00 —
support.type.vendored.property-name.css #00cfff —
support.module.node,support.type.object.module,support.module.node #e09200 —
entity.name.type.module #e09200 —
variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node #92000b —
support.constant.json #ff7c00 —
keyword.operator.expression.instanceof, keyword.operator.new, keyword.operator.ternary, keyword.operator.optional, keyword.operator.expression.keyof #8c00b6 —
support.type.object.console #92000b —
support.variable.property.process #ff7c00 —
entity.name.function,support.function.console #008cff —
keyword.operator.misc.rust #929292 —
keyword.operator.sigil.rust #8c00b6 —
keyword.operator.delete #8c00b6 —
support.type.object.dom #00cfff —
support.variable.dom,support.variable.property.dom #92000b —
keyword.operator.arithmetic,keyword.operator.comparison,keyword.operator.decrement,keyword.operator.increment,keyword.operator.relational #00cfff —
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 #8c00b6 —
punctuation.separator.delimiter #929292 —
punctuation.separator.c,punctuation.separator.cpp #8c00b6 —
support.type.posix-reserved.c,support.type.posix-reserved.cpp #00cfff —
keyword.operator.sizeof.c,keyword.operator.sizeof.cpp #8c00b6 —
variable.parameter.function.language.python #ff7c00 —
support.type.python #00cfff —
keyword.operator.logical.python #8c00b6 —
variable.parameter.function.python #ff7c00 —
punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python #929292 —
meta.function-call.generic.python #008cff —
constant.character.format.placeholder.other.python #ff7c00 —
keyword.operator.assignment.compound #8c00b6 —
keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts #00cfff —
entity.name.namespace #e09200 —
variable.language #e09200 —
token.variable.parameter.java #929292 —
import.storage.java #e09200 —
token.package.keyword #8c00b6 —
entity.name.function, meta.require, support.function.any-method, variable.function #008cff —
entity.name.type.namespace #e09200 —
support.class, entity.name.type.class #e09200 —
entity.name.class.identifier.namespace.type #e09200 —
entity.name.class, variable.other.class.js, variable.other.class.ts #e09200 —
variable.other.class.php #92000b —
control.elements, keyword.operator.less #ff7c00 —
keyword.other.special-method #008cff —
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 #8c00b6 —
token.storage.type.java #e09200 —
support.type.property-name #929292 —
support.constant.property-value #929292 —
support.constant.font-name #ff7c00 —
entity.other.inherited-class #e09200 —
constant.other.symbol #00cfff —
punctuation.definition.constant #ff7c00 —
entity.other.attribute-name #ff7c00 —
entity.other.attribute-name.id #008cff normal
entity.other.attribute-name.class.css #ff7c00 normal
markup.heading punctuation.definition.heading, entity.name.section #008cff —
keyword.other.unit #92000b —
markup.bold,todo.bold #ff7c00 —
punctuation.definition.bold #e09200 —
markup.italic, punctuation.definition.italic,todo.emphasis #8c00b6 —
entity.name.section.markdown #92000b —
punctuation.definition.heading.markdown #92000b —
punctuation.definition.list.begin.markdown #92000b —
markup.heading.setext #929292 —
punctuation.definition.bold.markdown #ff7c00 —
markup.inline.raw.markdown #48ab00 —
markup.inline.raw.string.markdown #48ab00 —
punctuation.definition.list.markdown #92000b —
punctuation.definition.string.begin.markdown, punctuation.definition.string.end.markdown, punctuation.definition.metadata.markdown #92000b —
beginning.punctuation.definition.list.markdown #92000b —
punctuation.definition.metadata.markdown #92000b —
markup.underline.link.markdown,markup.underline.link.image.markdown #8c00b6 —
string.other.link.title.markdown,string.other.link.description.markdown #008cff —
constant.character.escape #00cfff —
punctuation.section.embedded, variable.interpolation #92000b —
punctuation.section.embedded.begin,punctuation.section.embedded.end #8c00b6 —
invalid.illegal.bad-ampersand.html #929292 —
invalid.deprecated #ffffff —
invalid.unimplemented #ffffff —
source.json meta.structure.dictionary.json > string.quoted.json #92000b —
source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string #92000b —
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 #48ab00 —
source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json #00cfff —
support.type.property-name.json #92000b —
support.type.property-name.json punctuation #92000b —
text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade #8c00b6 —
text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade #8c00b6 —
support.other.namespace.use.php,support.other.namespace.use-as.php,support.other.namespace.php,entity.other.alias.php,meta.interface.php #e09200 —
keyword.operator.error-control.php #8c00b6 —
keyword.operator.type.php #8c00b6 —
punctuation.section.array.begin.php #929292 —
punctuation.section.array.end.php #929292 —
invalid.illegal.non-null-typehinted.php #f44747 —
storage.type.php,meta.other.type.phpdoc.php,keyword.other.type.php,keyword.other.array.phpdoc.php #e09200 —
meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php #008cff —
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 #929292 —
support.constant.core.rust #ff7c00 —
support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php #ff7c00 —
entity.name.goto-label.php,support.other.php #008cff —
keyword.operator.logical.php,keyword.operator.bitwise.php,keyword.operator.arithmetic.php #00cfff —
keyword.operator.regexp.php #8c00b6 —
keyword.operator.comparison.php #00cfff —
keyword.operator.heredoc.php,keyword.operator.nowdoc.php #8c00b6 —
meta.function.decorator.python #008cff —
support.token.decorator.python,meta.function.decorator.identifier.python #00cfff —
function.parameter #929292 —
function.parameter.ruby, function.parameter.cs #929292 —
constant.language.symbol.ruby #00cfff —
inline-color-decoration rgb-value #ff7c00 —
support.type.primitive.ts,support.type.builtin.ts,support.type.primitive.tsx,support.type.builtin.tsx #e09200 —
block.scope.end,block.scope.begin #929292 —
entity.name.variable.local.cs #92000b —
token.error-token #f44747 —
token.debug-token #8c00b6 —
punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end, punctuation.section.embedded #8c00b6 —
meta.template.expression #929292 —
keyword.operator.module #8c00b6 —
support.type.type.flowtype #008cff —
support.type.primitive #e09200 —
meta.property.object #92000b —
variable.parameter.function.js #92000b —
keyword.other.template.begin #48ab00 —
keyword.other.template.end #48ab00 —
keyword.other.substitution.begin #48ab00 —
keyword.other.substitution.end #48ab00 —
keyword.operator.assignment #00cfff —
keyword.operator.assignment.go #e09200 —
keyword.operator.arithmetic.go, keyword.operator.address.go #8c00b6 —
entity.name.package.go #e09200 —
support.type.prelude.elm #00cfff —
support.constant.elm #ff7c00 —
punctuation.quasi.element #8c00b6 —
constant.character.entity #92000b —
entity.other.attribute-name.pseudo-element, entity.other.attribute-name.pseudo-class #00cfff —
entity.global.clojure #e09200 —
meta.symbol.clojure #92000b —
constant.keyword.clojure #00cfff —
meta.arguments.coffee, variable.parameter.function.coffee #92000b —
meta.scope.prerequisites.makefile #92000b —
storage.modifier.import.groovy #e09200 —
meta.method.groovy #008cff —
meta.definition.variable.name.groovy #92000b —
meta.definition.class.inherited.classes.groovy #48ab00 —
support.variable.semantic.hlsl #e09200 —
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 #8c00b6 —
text.variable, text.bracketed #92000b —
support.type.swift, support.type.vb.asp #e09200 —
entity.name.function.xi #e09200 —
entity.name.class.xi #00cfff —
constant.character.character-class.regexp.xi #92000b —
constant.regexp.xi #8c00b6 —
keyword.control.xi #00cfff —
beginning.punctuation.definition.quote.markdown.xi #48ab00 —
beginning.punctuation.definition.list.markdown.xi #5a5a5a —
constant.character.xi #008cff —
constant.other.color.rgb-value.xi #ffffff —
punctuation.definition.tag.xi #5a5a5a —
entity.name.label.cs, entity.name.scope-resolution.function.call, entity.name.scope-resolution.function.definition #e09200 —
entity.name.label.cs, markup.heading.setext.1.markdown, markup.heading.setext.2.markdown #92000b —
meta.brace.square #929292 —
comment, punctuation.definition.comment #5a5a5a italic
markup.quote.markdown #5a5a5a —
punctuation.definition.block.sequence.item.yaml #929292 —
constant.language.symbol.elixir #00cfff —
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
fetchUser 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
31
~/my-project
$
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 } !` ;
}
Red Accent | Coding Theme