Spartan Theme
Publisher: Ryan OlsonThemes in package: 1
A minimalist and spartan light color theme
A minimalist and spartan light color theme
Full workbench mockup using this variant's colors and tokenColors.
Loading...
Workbench UI color keys from the theme JSON colors map.
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| string | #915119 | — |
| comment | #828A96 | — |
| keyword, storage, entity.name.tag | #B00000 | — |
| keyword.operator, storage.type.function.arrow, keyword.other.unit | #000000 | — |
| invalid | #B00303 | — |
| markup.heading | #B00000 | — |
| token.info-token | #316BCD | — |
| token.warn-token | #CD9731 | — |
| token.error-token | #CD3131 | — |
| token.debug-token | #800080 | — |
| string | #0000AA | — |
| comment | #AAAAAA | — |
| keyword, storage, entity.name.tag | #AA0000 | — |
| keyword.operator, storage.type.function.arrow, keyword.other.unit | #000000 | — |
| invalid | #B00303 | — |
| markup.heading | #AA0000 | — |
| token.info-token | #316BCD | — |
| token.warn-token | #CD9731 | — |
| token.error-token | #CD3131 | — |
| token.debug-token | #800080 | — |
| comment | #AAAAAA | — |
| punctuation.definition.comment | #AAAAAA | — |
| string | #0000AA | — |
| meta.embedded.assembly | #0000AA | — |
| keyword - keyword.operator | #AA0000 | — |
| keyword.control | #AA0000 | — |
| storage | #AA0000 | — |
| storage.type | #AA0000 | — |
| constant.numeric | #000000 | — |
| keyword, constant | #AA0000 | — |
| string | #0000AA | — |
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}!`;
}