Skip to content

Instantly share code, notes, and snippets.

@jimeh
Last active December 23, 2020 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimeh/57b7e6e6e0107036c167f10f87a55861 to your computer and use it in GitHub Desktop.
Save jimeh/57b7e6e6e0107036c167f10f87a55861 to your computer and use it in GitHub Desktop.
/* ==UserStyle==
@name GitHub Dark Diff Color Customizer (customized)
@namespace StylishThemes
@version 2.0.4-custom
@description A diff color customization style, colorblind friendly by default
@author StylishThemes and contributors
@homepageURL https://github.com/StylishThemes/Feature-Override-Styles/
@supportURL https://github.com/StylishThemes/Feature-Override-Styles/issues/new/choose
@updateURL https://gist.githubusercontent.com/jimeh/57b7e6e6e0107036c167f10f87a55861/raw/github-dark-diff-color-customizer.css
@license MIT
@var color deleted-line "Deleted line bkgd" #ffcc33
@var color deleted-text "Deleted line text" #979797
@var color deleted-word-bg "Deleted word bkgd" #ffcc33
@var color deleted-word-text "Deleted word text" #979797
@var color deleted-code "Deleted code bkgd" #ffd96359
@var color deleted-hover "Deleted Hover bkgd" #805f0059
@var color added-line "Added Line bkgd" #3986ff
@var color added-text "Added Line text" #fff
@var color added-word-bg "Added Word bkgd" #3986ff
@var color added-word-text "Added Word text" #fff
@var color added-code "Added Code bkgd" #3986ff59
@var color added-hover "Added Hover bkgd" #004cc159
@preprocessor stylus
==/UserStyle== */
@-moz-document regexp("^https?://((education|gist|graphql|guides|help|raw|resources|status|developer|support|vscode-auth)\\.)?github\\.com/((?!generated_pages/preview).)*$") {
/*** Based on https://userstyles.org/styles/149864/github-diff-colorblind-friendly ***
.blob-num sets the colors in the number columns on the left
.blob-code sets the color of the rest of the line
.blob-code .x sets the word-diff highlight color
***/
/* stylelint-disable */
i = !important
/* stylelint-enable */
.highlight .blob-num-deletion {
background-color: deleted-line i;
color: deleted-text i;
}
.highlight .blob-code-deletion .x {
background-color: deleted-word-bg i;
color: deleted-word-text i;
}
.highlight .blob-code-deletion {
background-color: deleted-code i;
color: deleted-text i;
}
body .highlight:not(.lines) tr:not(.inline-comments):hover td.blob-num-deletion:not(.line-age),
body .highlight:not(.lines) tr:not(.inline-comments):hover td.blob-code-deletion:not(.line-age) {
background: deleted-hover i;
}
body .highlight:not(.lines) tr:not(.inline-comments):hover td.blob-num-deletion:not(.line-age):before {
color: deleted-text i;
}
.highlight .blob-num-addition {
background-color: added-line i;
color: added-text i;
}
.highlight .blob-code-addition .x {
background-color: added-word-line i;
color: added-word-text i;
}
.highlight .blob-code-addition {
background-color: added-code i;
color: added-text i;
}
body .highlight:not(.lines) tr:not(.inline-comments):hover td.blob-num-addition:not(.line-age),
body .highlight:not(.lines) tr:not(.inline-comments):hover td.blob-code-addition:not(.line-age) {
background: added-hover i;
}
body .highlight:not(.lines) tr:not(.inline-comments):hover td.blob-num-addition:not(.line-age):before {
color: added-text i;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment