Bringing Dark Theme to Medium in Chrome

Bringing Dark Theme to Medium in Chrome

Running Javascript Snippets in Chrome Dev Tools ๐ŸŒš


2 min read

Photo by Irvan Smith on Unsplash

I remember myself running the same script in my Chrome Console. Thanks to Chrome Dev Tool Snippets, now you can save and run your favorite and frequently used code snippets on any sites in Chrome. The good thing is that these snippets are aware of the Javascript Context of the page.

For this article, I wrote a script that will bring Dark Theme to Medium web.

Javascript Snippet for Medium Dark ThemeJavascript Snippet for Medium Dark Theme

First, we add the above snippet in Chrome and see if it is working.

  1. Open Chrome Dev Tool by pressing Ctrl + Shift + Ins or Right-click and select Inspect.

Open Dev ToolsOpen Dev Tools

  1. Click on the Sources Tab. You can see a list of options on the left like Page, Filesystem, Overrides, etc.

Switch to Sources TabSwitch to Sources Tab

  1. Click the ยป button and select Snippets.

Select Snippets OptionSelect Snippets Option

  1. Now click New snippet to add a snippet. Give a meaningful name to the snippet. I am giving mine darkTheme.

Add New SnippetAdd New Snippet

  1. Now copy the below code from the **gist and paste it in the editor. Now press Ctrl + S** to save the changes

Javascript Code for Dark ThemeJavascript Code for Dark Theme

  1. Open any medium article and open the snippet by following the above steps.

  2. Right-click on the snippet and select Run

Run the snippetRun the snippet

  1. Voila, Now you can read Medium articles with Dark Theme.

My [article ]( and without Dark ThemeMy article with and without Dark Theme


And there you have it, your Medium in Dark Theme. Currently, Chrome doesn't have an option to run the script automatically but I hope we get the option in the future. Thank you for reading, I hope you found this article helpful!

Thank you ๐Ÿค˜

To know more about me, visit