Skip to content

Instantly share code, notes, and snippets.

@hkfoster
Created March 3, 2017 02:08
Show Gist options
  • Save hkfoster/12bf961c0536bd65eec7ae0364b93be0 to your computer and use it in GitHub Desktop.
Save hkfoster/12bf961c0536bd65eec7ae0364b93be0 to your computer and use it in GitHub Desktop.
Compose Articles Syntax Highlighting
/* ===================================== *
* Preformatted text
* ------------------------------------- */
$color-code: #58728A;
$color-code-background: #EDF5F7;
$color-code-punctuation: #7EC9FF;
$color-code-tag: #DD2F41;
$color-code-selector: #F69523;
$color-code-keyword: #25C894;
$color-code-comment: #87A0B8;
pre,
code,
kbd,
samp {
direction: ltr;
text-align: left;
tab-size: 2;
hyphens: none;
tab-size: 2;
hyphens: none;
}
pre {
overflow: auto;
background: $color-code-background;
}
:not(pre) > code,
:not(pre) > kbd,
:not(pre) > samp {
line-height: 0;
letter-spacing: -.015em;
word-spacing: -.015em;
word-wrap: break-word;
white-space: pre-wrap;
border-radius: 5px;
padding: 1px 5px;
background: $color-code-background;
}
/* ===================================== *
* Syntax highlighting
* ------------------------------------- */
/* Code blocks */
pre[class*="language-"] {
overflow: auto;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: $color-code-comment;
}
.token.punctuation {
color: $color-code-punctuation;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: $color-code-tag;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: $color-code-selector;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: $color-code-selector;
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: $color-code-keyword;
}
.token.function {
color: $color-code-tag;
}
.token.regex,
.token.important,
.token.variable {
color: $color-code-selector;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment