Adding VS Code Theme to CodeSandBox

July 18, 2018
πŸ’« Originally posted here. Broken? Let me know ~

Have you ever wanted to match your CodeSandBox Editor Theme to match your Visual Studio Code Color Theme?
Well, you can.

It’s because of CodeSandBox uses Monaco (a VS Code editor engine) by default.

Follow along to make the magic ✨ happen~

πŸ‘£ Steps

Here are the steps to make it happen.

    1. Get VS Code Color Theme Settings
    2. Open CodeSandBox Preference
    3. Paste the Setting in CodeSandBox Preference modal box

Let’s do this πŸ’ͺ.

πŸ€ 1. Get VS Code Color Theme Settings

Let’s grab the color theme settings from VS Code.
I am using Cobalt2 theme on CodeSandBox, and will be updating it to use Fairy Floss theme (Found from this post) on VS Code.

From VS Code,

  1. show all commands by pressing Control+Shift+P
  2. Enter Developer: Generate Color Theme From Current Settings

show all commands

show all commands

After executing the command, you will see a new tab, Untitled-1 popping up with Color Theme in JSON format.



Now select all (Ctrl+A) and copy the content.

πŸ€ 2. Open CodeSandBox Preference

Click on “Preferences” gear βš™οΈ button to open PREFERENCES modal box.

Click Preference

Click Preference

Custom VSCode Theme

πŸ€ 3. Paste the Settings

And now paste the VS Code Color Theme copied from the previous step in the Custom VSCode Theme text area.
You can now see that the theme has been updated globally.



Ok, now Enjoy the new Look & Feel 😎.

πŸ‘©β€πŸ­Β Working Demo

Here is the video of steps above.

⚠️ A Word of Caution

Note that the change is global.
That means, all previous SandBoxes (that’s what CodeSandBox calls each project) will be affected as well.

But I am sure that the default behavior is probably what you want, anyways πŸ˜›.