The Midnight theme in Xcode has been my default since I started using it, way back in 2018, I think.

Was that Xcode 9? It feels about right.

It has that perfect balance of dark background and clear, contrasting text that clicks for me.

So, naturally, one of the first things I did after getting comfortable with Cursor (and by extension, VS Code) was to find an alternative theme that could replicate that same look and feel.

needed that Midnight vibe.

I remember searching through the marketplace, trying dozens of different dark theme extensions. Some were close, others were way off. Finally, after a fair bit of searching, I found this gem on GitHub, apparently created about six years ago:

GitHub - the-1000th-summer/xcode-midnight-2-theme: vscode主题:仿xcode-midnight主题
vscode主题:仿xcode-midnight主题. Contribute to the-1000th-summer/xcode-midnight-2-theme development by creating an account on GitHub.

Bringing Midnight to VS Code / Cursor

Getting this theme set up is a two-way step. If you also love that dark, focused look, here is how you can install the theme. I realized it was not available directly on the VS Code Marketplace (at least, not when I looked!). This means we need to package it into an installable .vsix format ourselves.

Prerequisites: You need Node.js installed on your system, as it includes npm (Node Package Manager), which we will use to install the packaging tool. You can download it from nodejs.org. Verify the installation by opening Terminal (macOS/Linux) and typing node -v or npm -v. You should see version numbers printed:

rudrank@192 xcode-midnight-2-theme-master % npm -v
10.2.4

vsce: This is Microsoft's command-line tool for packaging VS Code extensions. Install it globally using npm by running this command in your terminal:

npm install -g @vscode/vsce

Head to the Xcode Midnight 2 GitHub repository and download the folder locally. Unzip the downloaded file. You will have a folder likely named xcode-midnight-2-theme-master (or similar). This folder contains the files like package.json.vsixmanifest, etc.

Then, open the Terminal, then change directory to the above folder. Then run the following command to package the extension:

vsce package

This command reads the package.json manifest, bundles all the necessary theme files, and creates a new file with a .vsix extension right there in the same folder (e.g., xcode-midnight-2-1.4.0.vsix):

rudrank@192 xcode-midnight-2-theme-master % vsce package
 WARNING  LICENSE, LICENSE.md, or LICENSE.txt not found
Do you want to continue? [y/N] y
 WARNING  Neither a .vscodeignore file nor a "files" property in package.json was found. To ensure only necessary files are included in your extension, add a .vscodeignore file or specify the "files" property in package.json. More info: https://aka.ms/vscode-vscodeignore

 INFO  Files included in the VSIX:
xcode-midnight-2-1.4.0.vsix
├─ [Content_Types].xml 
├─ extension.vsixmanifest 
└─ extension/
   ├─ changelog.md [0.23 KB]
   ├─ icon.png [36.94 KB]
   ├─ package.json [0.52 KB]
   ├─ readme.md [0.2 KB]
   ├─ readme_pic.jpg [624.7 KB]
   └─ themes/
      └─ Xcode Midnight 2-color-theme.json [17.34 KB]

The file extension/readme_pic.jpg is large (624.7 KB)

 DONE  Packaged: /Users/rudrank/Downloads/xcode-midnight-2-theme-master/xcode-midnight-2-1.4.0.vsix (8 files, 620.1 KB)

Now, open VS Code or Cursor and drag and drop this newly created file into the Extensions view (Command+Shift+X). It will automatically install the extension.

Finally, select the option "Set Color Theme" and then select "Xcode Midnight 2"!

Moving Forward

While it is not exactly the same colors as Xcode's midnight theme, the good news is that you can update the 700 lines of Xcode Midnight 2-color-theme.json code to match it better to your preferences.

I tried doing it with Gemini 2.5 Pro by taking Xcode's theme file (/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Midnight.xccolortheme) but too many mappings went wrong to match the properties and the values exactly.

Give it a shot and happy Cursoring!

AI Assisted Coding

Master AI-assisted iOS Development

Learn how to use Alex Sidebar, Cursor, Windsurf, VS Code, and other AI tools for your Swift and SwiftUI workflow.

Tagged in: