Skip to content

Instantly share code, notes, and snippets.

@LordAmit
Last active July 22, 2020 21:20
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 LordAmit/b6dfa9c748bbbb333b1fa3e3fa01bd3d to your computer and use it in GitHub Desktop.
Save LordAmit/b6dfa9c748bbbb333b1fa3e3fa01bd3d to your computer and use it in GitHub Desktop.
a syntax highlighter theme based on lots of other themes. The difference? I made sure that I picked colors which has a good contrast in terms of accessibility. You can use it with Jekyll, rouge, pygments, whatever floats your boat. :)
// based on friendly and more.
// an accessible, eye-friendly syntax highlighter theme based on lots of other themes.
// The difference? I made sure that I picked colors with good contrast in terms of accessibility.
// You can use it with Jekyll, rouge, pygments, whatever floats your boat. :)
// I checked the colors using Chrome Developer tools for color contrast.
// Please let me know if I missed anything, or if you have any suggestions.
// code style
code {
font-family: 'Source Code Pro', 'Roboto Mono', 'Monaco', 'Courier', monospace;
font-size: .9rem;
}
code.language-plaintext {
background-color: #ffd4dc;
color: #860303;
padding: 2px 4px ;
border: 1px solid #ddd;
border-radius: 4px;
}
// background of code and whatnot
.highlight {
background-color: #faf9f9;
padding: 7px 7px 7px 10px;
border: 1px solid #ddd;
-moz-box-shadow: 3px 3px rgba(0,0,0,0.1);
-webkit-box-shadow: 3px 3px rgba(0,0,0,0.1);
box-shadow: 3px 3px rgba(0,0,0,0.1);
margin: 20px 0 20px 0;
overflow: auto;
}
//based on friendly
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #525252; font-style: italic } /* Comment */
.highlight .err { color: #FF0000 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .ch { color: #525252; font-style: normal } /* Comment.Hashbang */
.highlight .cm { color: #525252; font-style: normal } /* Comment.Multiline */
.highlight .cp { color: #007020 } /* Comment.Preproc */
.highlight .cpf { color: #525252; font-style: normal } /* Comment.PreprocFile */
.highlight .c1 { color: #525252; font-style: normal } /* Comment.Single */
.highlight .cs { color: #525252; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #005C00 } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .kc { color: #007020; font-weight: normal } /* Keyword.Constant */
.highlight .kd { color: #007020; font-weight: normal } /* Keyword.Declaration */
.highlight .kn { color: #007020; font-weight: normal } /* Keyword.Namespace */
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #902000 } /* Keyword.Type */
.highlight .m { color: #40a070 } /* Literal.Number */
.highlight .s { color: #4070a0 } /* Literal.String */
.highlight .na { color: #005C00 } /* Name.Attribute */
.highlight .nb { color: #005198 } /* Name.Builtin */
.highlight .nc { color: #5f01c3; font-weight: bold } /* Name.Class */
.highlight .no { color: #4070a0 } /* Name.Constant */
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #007020 } /* Name.Exception */
.highlight .nf { color: #0044DD } /* Name.Function */
.highlight .nl { color: #a02803; font-weight: normal } /* Name.Label */
.highlight .nn { color: #005198; font-weight: normal } /* Name.Namespace */
.highlight .nt { color: #062873; } /* Name.Tag */
.highlight .nv { color: #8f0190 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #40a070 } /* Literal.Number.Bin */
.highlight .mf { color: #40a070 } /* Literal.Number.Float */
.highlight .mh { color: #40a070 } /* Literal.Number.Hex */
.highlight .mi { color: #40a070 } /* Literal.Number.Integer */
.highlight .mo { color: #40a070 } /* Literal.Number.Oct */
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
.highlight .sd { color: #4070a0; font-style: normal } /* Literal.String.Doc */
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
.highlight .se { color: #4070a0; font-weight: normal } /* Literal.String.Escape */
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
.highlight .si { color: #70a0d0; font-style: normal } /* Literal.String.Interpol */
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
.highlight .sr { color: #235388 } /* Literal.String.Regex */
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #06287e } /* Name.Function.Magic */
.highlight .vc { color: #8f0190 } /* Name.Variable.Class */
.highlight .vg { color: #8f0190 } /* Name.Variable.Global */
.highlight .vi { color: #8f0190 } /* Name.Variable.Instance */
.highlight .vm { color: #8f0190 } /* Name.Variable.Magic */
.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment