Brownie
VS Code theme · v1.0.0

Browniewith a pinch of salt

A warm, colorful theme for long evenings of code. Caramel keywords, burnt orange functions and a few sweet sprinkles, all on a calm milk chocolate tray.

Get it for VS Code
oven.ts — bakery
2
EXPLORER
  • ⌄ src
  • oven.tsM
  • Recipe.vue
  • brownie.cssU
  • recipe.json
  • bakery.py
  • ⌄ docs
  • README.mdM
oven.tsrecipe.json
/**
 * A tiny bakery queue.
 * @see https://github.com/gregadro/brownie-theme
 */
export enum Topping {
  SaltedCaramel = "salted-caramel",
  Walnut = "walnut",
  None = "none",
}

export interface Brownie {
  readonly id: number;
  topping: Topping;
  bakedAt?: Date;
}

const MAX_TRAY_SIZE = 16;
const slugPattern = /^[a-z]+(-[a-z]+)*$/g;

export class Oven<T extends Brownie = Brownie> {
  private tray: T[] = [];

  constructor(private readonly temperature: number = 180) {}

  add(item: T): this {
    if (this.tray.length >= MAX_TRAY_SIZE) {
      throw new Error(`Tray is full (${MAX_TRAY_SIZE} pieces)\n`);
    }
    this.tray.push(item);
    return this;
  }

  async bake(minutes = 25): Promise<T[]> {
    await new Promise((resolve) => setTimeout(resolve, minutes * 1000));
    const now = new Date();
    return this.tray.map((b) => ({ ...b, bakedAt: now }));
  }
}

const oven = new Oven(175);
const isSlug = slugPattern.test(Topping.SaltedCaramel);

oven
  .add({ id: 1, topping: Topping.SaltedCaramel })
  .add({ id: 2, topping: isSlug ? Topping.Walnut : Topping.None })
  .bake()
  .then((tray) => console.log(tray.length, "brownies ready", true, null));
⎇ main⊘ 0 ⚠ 0Ln 23, Col 1Spaces: 2UTF-8TypeScriptBrownie
Three flavors · two bakes

Pick a box

Every box has the same milk chocolate tray, cream text, caramel and burnt orange. Only the sprinkles change. Each one comes as a dark Brownie and a light Blondie.

open any file, it all tastes the same
oven.ts — bakery
2
EXPLORER
  • ⌄ src
  • oven.tsM
  • Recipe.vue
  • brownie.cssU
  • recipe.json
  • bakery.py
  • ⌄ docs
  • README.mdM
oven.tsrecipe.json
/**
 * A tiny bakery queue.
 * @see https://github.com/gregadro/brownie-theme
 */
export enum Topping {
  SaltedCaramel = "salted-caramel",
  Walnut = "walnut",
  None = "none",
}

export interface Brownie {
  readonly id: number;
  topping: Topping;
  bakedAt?: Date;
}

const MAX_TRAY_SIZE = 16;
const slugPattern = /^[a-z]+(-[a-z]+)*$/g;

export class Oven<T extends Brownie = Brownie> {
  private tray: T[] = [];

  constructor(private readonly temperature: number = 180) {}

  add(item: T): this {
    if (this.tray.length >= MAX_TRAY_SIZE) {
      throw new Error(`Tray is full (${MAX_TRAY_SIZE} pieces)\n`);
    }
    this.tray.push(item);
    return this;
  }

  async bake(minutes = 25): Promise<T[]> {
    await new Promise((resolve) => setTimeout(resolve, minutes * 1000));
    const now = new Date();
    return this.tray.map((b) => ({ ...b, bakedAt: now }));
  }
}

const oven = new Oven(175);
const isSlug = slugPattern.test(Topping.SaltedCaramel);

oven
  .add({ id: 1, topping: Topping.SaltedCaramel })
  .add({ id: 2, topping: isSlug ? Topping.Walnut : Topping.None })
  .bake()
  .then((tray) => console.log(tray.length, "brownies ready", true, null));
⎇ main⊘ 0 ⚠ 0Ln 23, Col 1Spaces: 2UTF-8TypeScriptBrownie
Ingredients

What goes in

Every color has a name and a job. Click a jar to copy its hex. All syntax colors reach at least 4.5:1 contrast on the tray, and the build refuses colors that look too alike.

From the kitchen

Why a brownie

I made Brownie in 2022 for my own Vue work. The idea was simple: writing code should feel as good as eating a salted caramel brownie. Warm, soft on the eyes, a little sweet, with a pinch of salt.

This year it got a proper re-bake. The colors are clearer and easier to tell apart, there is a light Blondie for sunny days, and two new flavors if you like your brownie with berries or cherries.

If it makes your editor a little cozier, that is all I wanted.

Grega

Install

Into the oven

  1. Install the extension

    Search for Brownie in the Extensions view (Ctrl Shift X), or get it from the Marketplace.

  2. Choose a flavor

    Open the theme picker with Ctrl K Ctrl T (⌘ K ⌘ T on a Mac) and type Brownie or Blondie.

  3. Let the sun decide

    Brownie at night, Blondie by day. Add this to your settings.json:

    {
      "window.autoDetectColorScheme": true,
      "workbench.preferredDarkColorTheme": "Brownie",
      "workbench.preferredLightColorTheme": "Blondie"
    }