Open-source project
StylishThemes/GitHub-Dark avatar
StylishThemes/GitHub-Dark

GitHub-Dark: a Stylus userstyle that layers on GitHub's own dark mode by overriding Primer variables

:octocat: Dark GitHub style

10,010 stars640 forksCSSBSD-2-Clause

At a glance

What is it?
StylishThemes/GitHub-Dark is a BSD-2-Clause user.css theme for github.com and related GitHub sites, installed through Stylus or Cascadea. It no longer replaces GitHub's colors from scratch; it builds on GitHub's dark theme, which shapes both how it is installed and where it falls short.
Who is it for?
GitHub-Dark suits people who already use GitHub's dark mode and want control over link color, backgrounds, tab width and syntax themes across code views, editors and notebooks. It does not suit anyone who wants a dark GitHub without installing a userstyle manager, or who keeps GitHub in light mode.
Can I use it commercially?
Yes. BSD-2-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly CSS, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • StylishThemes/GitHub-Dark10,010 ★ · +29
Star history
Repository2026-09-222026-11-13
StylishThemes/GitHub-Dark10k10k

29 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The style builds on GitHub's dark theme instead of replacing it

Installation takes three steps, and the third one trips people up. First you install a userstyle manager: Stylus for Firefox, Stylus for Chrome, or Cascadea for Safari. Second, you install github-dark.user.css from the raw URL on the master branch, which is also the repository's homepage link. Third, you set GitHub itself to dark mode at github.com/settings/appearance, because the style builds on GitHub's dark theme.

That last step is the consequence most worth knowing. GitHub-Dark adjusts and extends what GitHub's own dark theme already provides. If your account is set to light mode, the style is missing the base it is written on top of. Anyone who reports the theme as not working should check the appearance setting before anything else.

It overrides Primer CSS variables and avoids GitHub's hashed class names

The edit-and-test loop is simple because there is no build step: the whole theme is github-dark.user.css. Its approach is to override GitHub's Primer CSS variables, and to add a few rules with stable selectors only for things variables cannot reach. The contributor rule is explicit: prefer a variable over a rule, and never use GitHub's hashed class names.

This design has two practical effects. Hashed class names change whenever GitHub rebuilds its frontend, so avoiding them keeps the style from breaking on every GitHub deploy. And because the colors live in variables, browser extensions that read GitHub's CSS variables follow the theme automatically; Refined GitHub is the example given. The flip side is that the theme reaches only what Primer variables and stable selectors reach; anything GitHub styles another way is outside its control.

GitHub Enterprise needs a manual domain() edit

Out of the box the style targets GitHub's public domains. For a GitHub Enterprise server, you edit the installed style yourself and add a domain rule for your host to both GitHub @-moz-document rules, in this form:

code
domain("github.example.com")

with github.example.com replaced by your Enterprise hostname. There is no option in the settings panel for this; it is a change to the CSS of the installed style. The consequence for Enterprise users is that the theme is a local modification, and you should keep a note of the exact lines you added so you can reapply them if the installed copy is ever replaced with a fresh one.

Custom backgrounds must come from hosts GitHub's CSP allows

The Background option offers Cross-Hatch, Uniform Tile, Random Tile, None and Custom. Choosing Custom reads the image from the Custom Background field, and that value has to be wrapped in url(), as in url(https://github.com/user-attachments/assets/...). A bare URL will not work.

The bigger restriction comes from GitHub, not the theme. GitHub's Content Security Policy only allows images from github.com, *.githubusercontent.com and data: URIs, so an image hosted on your own site or an image CDN will be blocked. Three workarounds are given: drag the image into any GitHub comment box and copy the uploaded URL without submitting the comment, commit it to a public repository and use its raw.githubusercontent.com URL, or inline a small image as a base64 data: URI. Background image type then chooses between tiling and scaling to fit the window, and attachment chooses whether it scrolls with the page or stays fixed.

Three separate syntax theme slots, plus layout options

All options are changed in the style's settings, which in Stylus sit behind the gear icon next to the style. Base color sets links and highlights, and Background color sets the page color behind the background image.

Syntax highlighting is split into three independent settings. GitHub syntax theme colors code views, diffs and markdown. CodeMirror syntax theme colors the file and gist editors. Jupyter syntax theme colors notebook previews. Every theme is available in all three slots, so you can match them or deliberately mix them. Code Tab size sets the width of tabs in code to 2, 4 or 8.

The last option, Unrounded labels and avatars, is enabled by default. It gives labels, counters, state badges, topics and avatars slightly rounded corners instead of pill and circle shapes, so if you expect GitHub's round avatars you need to switch it off.

Styled sites reach beyond github.com, and three companion userstyles fill gaps

The style covers github.com, gist.github.com, support.github.com, vscode-auth.github.com and githubstatus.com. It also styles raw files on raw.githubusercontent.com and gist.githubusercontent.com, and rendered Jupyter notebooks on notebooks.githubusercontent.com.

Three extra userstyles live in the same repository and install separately. GitHub Custom Fonts sets the code font family and size, but the font must already be installed locally. GitHub Code Wrap wraps long code lines in diffs, gists and markdown. GitHub Dark Diff Color Customizer sets custom diff colors and is colorblind friendly by default. Each one is its own .user.css file at the repository root, so you install only the ones you need.

No GitHub releases: versions live inside the .user.css files

The repository has no GitHub releases. Versioning happens in the files themselves: package.json is at version 7.4.2, and the release targets bump every style together. The Makefile drives the workflow:

code
make install

serves github-dark.user.css from a temporary local HTTP server and opens it in your browser so Stylus can install it, and

code
make lint

runs stylelint across every *.user.css file. Releases use make patch, make minor or make major, which run lint first and then bump the version in all styles and package.json; you then commit, tag and push by hand.

The tooling expects Node.js 24 or newer and pnpm 12.14.0, with stylelint 17.16.0 as the linter. The repository is not archived and the last push was on 2026-10-27. For users, the practical point is that there is no release page to watch; the version number inside github-dark.user.css is what changes.

Editorial conclusion

GitHub-Dark suits people who already use GitHub's dark mode and want control over link color, backgrounds, tab width and syntax themes across code views, editors and notebooks. It does not suit anyone who wants a dark GitHub without installing a userstyle manager, or who keeps GitHub in light mode. GitHub Enterprise users should check that they can maintain the manual domain() edit, and anyone planning a custom background should confirm the image host is one GitHub's Content Security Policy allows.

Frequently asked questions

How do I turn on GitHub dark mode for GitHub-Dark?

Set GitHub to dark mode at github.com/settings/appearance. GitHub-Dark builds on GitHub's dark theme, so this step is required after installing the style.

How do I change the color in GitHub with GitHub-Dark?

Open the style's settings, in Stylus via the gear icon next to the style, and change Base color for links and highlights or Background color for the page. Syntax colors are set separately for GitHub, CodeMirror and Jupyter views.

How do I activate GitHub-Dark?

Install Stylus for Firefox or Chrome, or Cascadea for Safari, then install github-dark.user.css from its raw URL and set GitHub itself to dark mode.

Official sources

  1. Issues
  2. License: BSD-2-Clause
  3. Project website
  4. README
  5. StylishThemes/GitHub-Dark on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/stylishthemes-github-dark.svg)](https://hysenlabs.com/projects/stylishthemes-github-dark)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/stylishthemes-github-dark.svg)](https://hysenlabs.com/projects/stylishthemes-github-dark)

Was this useful?