Onion is a night and day theme set for VS Code and VSCodium, tuned for JavaScript, TypeScript and Python, with matching file icons and product icons.
Onion gives you five color palettes, each in a Night (dark) and a Day (light) variant, so you can keep the same look from morning to late evening. The syntax colors are chosen for the languages most people use it with: JavaScript, TypeScript, TSX and Python. Every syntax color meets WCAG AA contrast (4.5:1) on its editor background and body text meets AAA (7:1). The build checks this and fails if a color falls short.
Alongside the color themes you get two file icon themes that understand JS, TS and Python projects (tests, .d.ts files, __init__.py, pyproject.toml, virtual environments, caches), and a solid product icon theme for the workbench.
Onion also ships a small runtime part. It lets you change the accent color, borders, sidebar contrast, italics and folder icon color from settings, and it can switch between Day and Night automatically, either with your OS or on a schedule.
- 10 color themes: Five palettes (Red, Shallot, Scallion, Leek, Mocha), each with a Night and a Day variant.
- Onion Classic Icons: A file icon theme with rounded language badges, document shapes and plain folders.
- Onion Bulb Icons: A file icon theme where every file is an onion bulb with a label or glyph, folders carry a sliced-onion ring, and the workspace root is a whole onion.
- Onion Product Icons: Solid (filled) icons for the activity bar, explorer, source control, debug, tabs and symbols.
- Accessible contrast: Syntax colors meet WCAG AA and body text meets AAA on every variant. Colors that fall short are nudged lighter or darker automatically.
- Accent color: Pick one of ten named hues or any
#rrggbb color for the cursor, selection, active tab, buttons and folders.
- Layout options: Optional 1px borders between areas and a high-contrast darker sidebar and panel.
- Italic control: Turn italics on or off for comments, docstrings, parameters,
self/this, decorators and type parameters.
- Automatic day and night: Follow your OS light or dark mode, or switch at times you choose.
- Commands: Quick commands to pick an accent, toggle Day and Night, and reset all customizations.
- Download the
onion-theme-<version>.vsix file from the GitHub releases page.
- Install it from the command line:
codium --install-extension onion-theme-<version>.vsix
# or
code --install-extension onion-theme-<version>.vsix
You can also open the Extensions panel, click the ... menu, choose Install from VSIX... and select the file.
You need Node.js and npm.
git clone https://github.com/n1th1n-19/ONION.git
cd ONION
npm install
npm run build # generates themes/ and the icon font, updates package.json contributes, runs contrast and icon checks
npm run package # produces onion-theme-<version>.vsix
codium --install-extension onion-theme-<version>.vsix # or: code --install-extension ...
- Open the Command Palette and run Preferences: Color Theme.
- Choose one of the Onion themes:
| Theme |
Type |
Onion Red Night |
Dark |
Onion Red Day |
Light |
Onion Shallot Night |
Dark |
Onion Shallot Day |
Light |
Onion Scallion Night |
Dark |
Onion Scallion Day |
Light |
Onion Leek Night |
Dark |
Onion Leek Day |
Light |
Onion Mocha Night |
Dark |
Onion Mocha Day |
Light |
What each palette looks like:
| Palette |
Night |
Day |
| Red |
Aubergine, purple and magenta |
Warm paper, deep plum |
| Shallot |
Dark cocoa, rose and copper |
Blush paper, terracotta |
| Scallion |
Deep forest, green and lime |
Pale sage, deep green |
| Leek |
Slate-teal, teal |
Cool mist, petrol blue |
| Mocha |
Catppuccin Mocha |
Catppuccin Latte (contrast-boosted) |
- Run Preferences: File Icon Theme.
- Choose Onion Classic Icons (
onion-files) or Onion Bulb Icons (onion-files-bulb).
Folder icons take their color from the accent of the Onion palette you are using. When no Onion color theme is active, they use the Mocha palette. Both icon themes have separate variants for dark and light backgrounds.
- Run Preferences: Product Icon Theme.
- Choose Onion Product Icons (
onion-product).
- Run Onion: Select Accent from the Command Palette.
- Pick
default (the palette's own accent), one of the named hues, or Custom hex....
- For a custom color, type it as
#rrggbb.
- When asked, click Reload Window to apply.
The quick pick shows the actual color of each hue in your current palette and variant. You can also set onion.accent directly in settings.
To switch by hand, run Onion: Toggle Day/Night. It swaps to the other variant of your current palette, for example from Onion Leek Night to Onion Leek Day. If automatic switching was on, the command turns it off (and tells you) so it does not flip the theme back. It also turns off window.autoDetectColorScheme.
To switch automatically, set onion.dayNight:
os: Onion sets your preferred dark theme to the Night variant and your preferred light theme to the Day variant of the current palette, then turns on VS Code's window.autoDetectColorScheme. VS Code then follows your OS light or dark mode. If you later pick a different Onion theme as your preferred dark or light theme, Onion keeps the other one on the same palette.
schedule: Onion uses the Day variant between onion.dayStart and onion.nightStart (local time) and the Night variant the rest of the time. It checks once a minute. Night windows that cross midnight work, for example day from 07:00 and night from 19:00.
off: no automatic switching. If you leave os mode, Onion turns off window.autoDetectColorScheme and keeps the variant that is showing.
Automatic switching only manages Onion themes. If your current theme is not an Onion theme, nothing changes.
Change any of the style settings below in Settings (search for "Onion") or in settings.json:
{
"onion.accent": "teal",
"onion.bordered": true,
"onion.contrastSidebar": true,
"onion.italic": false,
"onion.folderColor": "neutral"
}
After a style change, Onion regenerates its theme files and shows "Onion theme updated. Reload to apply." Click Reload Window. VS Code only reads theme files when the window loads.
Run Onion: Reset Customizations. It clears all onion.* settings back to their defaults, including the day and night options.
| Command |
ID |
What it does |
| Onion: Select Accent |
onion.selectAccent |
Pick an accent hue or custom hex color |
| Onion: Toggle Day/Night |
onion.toggleDayNight |
Switch to the other variant of the current palette and turn off automatic switching |
| Onion: Reset Customizations |
onion.reset |
Reset all Onion settings to defaults |
| Setting |
Type |
Default |
Description |
onion.accent |
string |
default |
Accent color for cursor, selection, active tab, buttons and folders. One of default, red, rose, peach, yellow, green, teal, sky, blue, mauve, lavender, or a #rrggbb hex |
onion.bordered |
boolean |
false |
Draw 1px borders between sidebar, editor, panel and tabs |
onion.contrastSidebar |
boolean |
false |
Use the darkest background for the sidebar and panel |
onion.italic |
boolean |
true |
Italicize comments, docstrings, parameters, self/this, decorators and type parameters |
onion.folderColor |
accent or neutral |
accent |
Color folder icons with the accent or a neutral gray |
onion.dayNight |
off, os or schedule |
off |
Switch between the Day and Night variant of the current Onion palette automatically |
onion.dayStart |
string (HH:MM) |
07:00 |
Time the Day variant starts (local time) |
onion.nightStart |
string (HH:MM) |
19:00 |
Time the Night variant starts (local time) |
Times must be 24-hour HH:MM, from 00:00 to 23:59.
Settings are written to your global (user) settings when changed through the commands.
Onion's themes are generated, not hand-written. A small set of source files describes everything:
- Palettes: each palette has a Night and a Day variant with the same slots: three background levels, three surface levels, foreground, subtle, muted and comment colors, and ten named hues (
red, rose, peach, yellow, green, teal, sky, blue, mauve, lavender).
- Syntax roles: a default mapping assigns a hue to each role, such as keywords, functions, types, parameters, strings, numbers, decorators,
self, built-ins and docstrings. A palette can override individual roles.
- UI colors, syntax rules, file icons and product icons each live in their own generator module.
When themes are generated, every role color is checked against the editor background. If a color is below the contrast target, it is nudged toward white (Night) or black (Day) in small steps until it passes. The build reports which colors were adjusted, and fails if any theme still misses the target or if an icon is missing.
The product icons are drawn as filled shapes on a 24px grid and compiled into a WOFF icon font with fantasticon.
At runtime, the extension starts after VS Code finishes loading. It reads your onion.* style settings and regenerates the theme and icon files inside the installed extension folder, writing only files whose content changed. If anything changed, it asks you to reload. This is how style settings like the accent or borders work even though VS Code themes are static files. The extension also runs the day and night logic: a once-a-minute check for schedule mode, and updates to workbench.colorTheme, workbench.preferredDarkColorTheme, workbench.preferredLightColorTheme and window.autoDetectColorScheme as needed.
Switching to a different Onion palette recolors folder icons to that palette's accent. This is applied quietly and shows up on the next reload.
- VS Code or VSCodium 1.90.0 or newer.
- The extension needs write access to its own install folder, because style settings rewrite its theme files.
- To build from source: Node.js and npm.
Problem: I changed a setting and nothing happened. Style settings take effect only after a window reload. Click Reload Window in the notification, or run Developer: Reload Window.
Problem: "Onion: could not update theme files". Onion could not write the regenerated theme files into its extension folder. This can happen when the extension folder is read-only. The themes keep working with their previous colors.
Problem: Automatic day and night switching does nothing. It only manages Onion themes. Make sure an Onion color theme is active. For schedule, check that onion.dayStart and onion.nightStart are valid HH:MM times.
Problem: I toggled Day/Night and automatic switching stopped. That is intended. A manual toggle turns onion.dayNight back to off so the schedule or OS mode does not undo your choice. Set it again to resume.
Problem: workbench.colorTheme is ignored. When window.autoDetectColorScheme is on (as in os mode), VS Code uses workbench.preferredDarkColorTheme and workbench.preferredLightColorTheme instead. Set onion.dayNight to off to go back to a single fixed theme.
Problem: Folder icons have the wrong color after switching palette. Folder colors update on the next window reload.
Problem: I want to undo all customizations. Run Onion: Reset Customizations.
Onion Theme is released under the MIT License.
The Onion Mocha palette uses colors from Catppuccin (MIT). Product icons are compiled into a font with fantasticon.
Source code: github.com/n1th1n-19/ONION.