Skip to content

Instantly share code, notes, and snippets.

@tterb
Last active December 28, 2022 14:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tterb/45f9e4fd69daccff08b148fdbd6eb786 to your computer and use it in GitHub Desktop.
Save tterb/45f9e4fd69daccff08b148fdbd6eb786 to your computer and use it in GitHub Desktop.
Monokai Pro-inspired syntax-highlighting for Rouge
/**
* Syntax highlighting styles
*/
$syntax-hue: 270;
$syntax-saturation: 4%;
$syntax-brightness: 15%;
$base: hsl($syntax-hue, $syntax-saturation, $syntax-brightness);
$text: hsl($syntax-hue, 9%, 87%);
$subtle: hsl($syntax-hue, 8%, 43%);
$highlight: hsl($syntax-hue, 9%, 90%);
$red: hsl( 5, 48%, 51%);
$orange: hsl( 21, 86%, 70%);
$yellow: hsl( 40, 98%, 78%);
$green: hsl( 98, 64%, 68%);
$blue: hsl(195, 83%, 73%);
$purple: hsl(246, 80%, 80%);
$pink: hsl(350, 100%, 70%);
$err: $red;
.highlight,
pre.highlight {
background: $base;
color: $text;
}
.highlight {
.highlighter-rouge & {
background: transparent;
}
pre { background: transparent; }
.hll { background: $base; }
.c { color: $subtle; font-style: italic; }
.err { color: $err; }
.k { color: $pink; }
.l { color: $yellow; }
.n { color: $text; }
.o { color: $pink; }
.p { color: $text; }
.cm { color: $subtle; font-style: italic; }
.cp { color: $subtle; font-style: italic; }
.c1 { color: $subtle; font-style: italic; }
.cs { color: $subtle; font-style: italic; }
.ge { font-style: italic; }
.gs { font-weight: 700; }
.kc { color: $purple; }
.kd { color: $blue; }
.kn { color: $blue; }
.kp { color: $blue; }
.kr { color: $blue; }
.kt { color: $blue; }
.ld { color: $yellow; }
.m { color: $orange; }
.s { color: $yellow; }
.na { color: $text; }
.nb { color: $yellow; }
.nc { color: $yellow; }
.no { color: $yellow; }
.nd { color: $yellow; }
.ni { color: $yellow; }
.ne { color: $yellow; }
.nf { color: $text; }
.nl { color: $yellow; }
.nn { color: $text; }
.nx { color: $text; }
.py { color: $yellow; }
.nt { color: $red; }
.nv { color: $yellow; }
.ow { font-weight: 700; }
.w { color: $highlight; }
.mf { color: $orange; }
.mh { color: $orange; }
.mi { color: $orange; }
.mo { color: $orange; }
.sb { color: $yellow; }
.sc { color: $yellow; }
.sd { color: $yellow; }
.s2 { color: $yellow; }
.se { color: $purple; }
.sh { color: $yellow; }
.si { color: $yellow; }
.sx { color: $yellow; }
.sr { color: $pink; }
.s1 { color: $yellow; }
.ss { color: $blue; }
.bp { color: $yellow; }
.vc { color: $yellow; }
.vg { color: $yellow; }
.vi { color: $red; }
.il { color: $orange; }
.gu { color: $subtle; }
.gd { color: $pink; }
.gi { color: $green; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment