Improve syntax highlighting styles (#1450)

* Cleanup syntax highlighting styles
* Replace hardcoded color values with [base16](http://chriskempson.com/projects/base16/) Sass variables
* Harmonize padding between GFM code blocks and `{% highlight %}` code blocks
*  Improve readability of line numbers
* Add longer code block example to test double digit line numbers
* Adjust code block colors for specific skins
This commit is contained in:
Michael Rose 2018-01-04 20:46:10 -05:00 committed by GitHub
parent 94d753378a
commit 3f469f268f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 535 additions and 340 deletions

View file

@ -6,29 +6,27 @@ div.highlighter-rouge,
figure.highlight { figure.highlight {
position: relative; position: relative;
margin-bottom: 1em; margin-bottom: 1em;
background: $base00;
color: $base05;
font-family: $monospace; font-family: $monospace;
font-size: $type-size-6; font-size: $type-size-6;
line-height: 1.8; line-height: 1.8;
border-radius: $border-radius; border-radius: $border-radius;
background-color: $code-background-color;
> pre,
pre.highlight { pre.highlight {
margin: 0; margin: 0;
padding: 1em; padding: 1em;
} }
} }
figure.highlight {
padding-left: 1em;
padding-right: 1em;
}
.highlight table { .highlight table {
margin-bottom: 0;
font-size: 1em; font-size: 1em;
border: 0; border: 0;
td { td {
padding: 5px; padding: 0;
width: calc(100% - 1em); width: calc(100% - 1em);
border: 0; border: 0;
@ -36,7 +34,14 @@ figure.highlight {
&.gutter { &.gutter {
padding-right: 1em; padding-right: 1em;
width: 1em; width: 1em;
color: rgba($muted-text-color, 0.5); color: $base04;
border-right: 1px solid $base04;
text-align: right;
}
/* code */
&.code {
padding-left: 1em;
} }
} }
@ -49,225 +54,263 @@ figure.highlight {
width: 100%; width: 100%;
} }
/* .highlight .hll {
Solarized Light background-color: $base06;
http://ethanschoonover.com/solarized }
.highlight {
SOLARIZED HEX ROLE .c {
--------- -------- ------------------------------------------ /* Comment */
base01 #586e75 body text / default code / primary content color: $base04;
base1 #93a1a1 comments / secondary content }
base3 #fdf6e3 background .err {
orange #cb4b16 constants /* Error */
red #dc322f regex, special keywords color: $base08;
blue #22b3eb reserved keywords }
cyan #2aa198 strings, numbers .k {
green #859900 operators, other keywords /* Keyword */
========================================================================== */ color: $base0e;
}
.highlight .c { .l {
color: #93a1a1; /* Literal */
} /* Comment */ color: $base09;
.highlight .err { }
color: #586e75; .n {
} /* Error */ /* Name */
.highlight .g { color: $base05;
color: #586e75; }
} /* Generic */ .o {
.highlight .k { /* Operator */
color: #859900; color: $base0c;
} /* Keyword */ }
.highlight .l { .p {
color: #586e75; /* Punctuation */
} /* Literal */ color: $base05;
.highlight .n { }
color: #586e75; .cm {
} /* Name */ /* Comment.Multiline */
.highlight .o { color: $base04;
color: #859900; }
} /* Operator */ .cp {
.highlight .x { /* Comment.Preproc */
color: #cb4b16; color: $base04;
} /* Other */ }
.highlight .p { .c1 {
color: #586e75; /* Comment.Single */
} /* Punctuation */ color: $base04;
.highlight .cm { }
color: #93a1a1; .cs {
} /* Comment.Multiline */ /* Comment.Special */
.highlight .cp { color: $base04;
color: #859900; }
} /* Comment.Preproc */ .gd {
.highlight .c1 { /* Generic.Deleted */
color: #93a1a1; color: $base08;
} /* Comment.Single */ }
.highlight .cs { .ge {
color: #859900; /* Generic.Emph */
} /* Comment.Special */ font-style: italic;
.highlight .gd { }
color: #2aa198; .gh {
} /* Generic.Deleted */ /* Generic.Heading */
.highlight .ge { color: $base05;
color: #586e75; font-weight: bold;
font-style: italic; }
} /* Generic.Emph */ .gi {
.highlight .gr { /* Generic.Inserted */
color: #dc322f; color: $base0b;
} /* Generic.Error */ }
.highlight .gh { .gp {
color: #cb4b16; /* Generic.Prompt */
} /* Generic.Heading */ color: $base04;
.highlight .gi { font-weight: bold;
color: #859900; }
} /* Generic.Inserted */ .gs {
.highlight .go { /* Generic.Strong */
color: #586e75; font-weight: bold;
} /* Generic.Output */ }
.highlight .gp { .gu {
color: #586e75; /* Generic.Subheading */
} /* Generic.Prompt */ color: $base0c;
.highlight .gs { font-weight: bold;
color: #586e75; }
font-weight: bold; .kc {
} /* Generic.Strong */ /* Keyword.Constant */
.highlight .gu { color: $base0e;
color: #cb4b16; }
} /* Generic.Subheading */ .kd {
.highlight .gt { /* Keyword.Declaration */
color: #586e75; color: $base0e;
} /* Generic.Traceback */ }
.highlight .kc { .kn {
color: #cb4b16; /* Keyword.Namespace */
} /* Keyword.Constant */ color: $base0c;
.highlight .kd { }
color: #22b3eb; .kp {
} /* Keyword.Declaration */ /* Keyword.Pseudo */
.highlight .kn { color: $base0e;
color: #859900; }
} /* Keyword.Namespace */ .kr {
.highlight .kp { /* Keyword.Reserved */
color: #859900; color: $base0e;
} /* Keyword.Pseudo */ }
.highlight .kr { .kt {
color: #22b3eb; /* Keyword.Type */
} /* Keyword.Reserved */ color: $base0a;
.highlight .kt { }
color: #dc322f; .ld {
} /* Keyword.Type */ /* Literal.Date */
.highlight .ld { color: $base0b;
color: #586e75; }
} /* Literal.Date */ .m {
.highlight .m { /* Literal.Number */
color: #2aa198; color: $base09;
} /* Literal.Number */ }
.highlight .s { .s {
color: #2aa198; /* Literal.String */
} /* Literal.String */ color: $base0b;
.highlight .na { }
color: #586e75; .na {
} /* Name.Attribute */ /* Name.Attribute */
.highlight .nb { color: $base0d;
color: #b58900; }
} /* Name.Builtin */ .nb {
.highlight .nc { /* Name.Builtin */
color: #22b3eb; color: $base05;
} /* Name.Class */ }
.highlight .no { .nc {
color: #cb4b16; /* Name.Class */
} /* Name.Constant */ color: $base0a;
.highlight .nd { }
color: #22b3eb; .no {
} /* Name.Decorator */ /* Name.Constant */
.highlight .ni { color: $base08;
color: #cb4b16; }
} /* Name.Entity */ .nd {
.highlight .ne { /* Name.Decorator */
color: #cb4b16; color: $base0c;
} /* Name.Exception */ }
.highlight .nf { .ni {
color: #22b3eb; /* Name.Entity */
} /* Name.Function */ color: $base05;
.highlight .nl { }
color: #586e75; .ne {
} /* Name.Label */ /* Name.Exception */
.highlight .nn { color: $base08;
color: #586e75; }
} /* Name.Namespace */ .nf {
.highlight .nx { /* Name.Function */
color: #586e75; color: $base0d;
} /* Name.Other */ }
.highlight .py { .nl {
color: #586e75; /* Name.Label */
} /* Name.Property */ color: $base05;
.highlight .nt { }
color: #22b3eb; .nn {
} /* Name.Tag */ /* Name.Namespace */
.highlight .nv { color: $base0a;
color: #22b3eb; }
} /* Name.Variable */ .nx {
.highlight .ow { /* Name.Other */
color: #859900; color: $base0d;
} /* Operator.Word */ }
.highlight .w { .py {
color: #586e75; /* Name.Property */
} /* Text.Whitespace */ color: $base05;
.highlight .mf { }
color: #2aa198; .nt {
} /* Literal.Number.Float */ /* Name.Tag */
.highlight .mh { color: $base0c;
color: #2aa198; }
} /* Literal.Number.Hex */ .nv {
.highlight .mi { /* Name.Variable */
color: #2aa198; color: $base08;
} /* Literal.Number.Integer */ }
.highlight .mo { .ow {
color: #2aa198; /* Operator.Word */
} /* Literal.Number.Oct */ color: $base0c;
.highlight .sb { }
color: #93a1a1; .w {
} /* Literal.String.Backtick */ /* Text.Whitespace */
.highlight .sc { color: $base05;
color: #2aa198; }
} /* Literal.String.Char */ .mf {
.highlight .sd { /* Literal.Number.Float */
color: #586e75; color: $base09;
} /* Literal.String.Doc */ }
.highlight .s2 { .mh {
color: #2aa198; /* Literal.Number.Hex */
} /* Literal.String.Double */ color: $base09;
.highlight .se { }
color: #cb4b16; .mi {
} /* Literal.String.Escape */ /* Literal.Number.Integer */
.highlight .sh { color: $base09;
color: #586e75; }
} /* Literal.String.Heredoc */ .mo {
.highlight .si { /* Literal.Number.Oct */
color: #2aa198; color: $base09;
} /* Literal.String.Interpol */ }
.highlight .sx { .sb {
color: #2aa198; /* Literal.String.Backtick */
} /* Literal.String.Other */ color: $base0b;
.highlight .sr { }
color: #dc322f; .sc {
} /* Literal.String.Regex */ /* Literal.String.Char */
.highlight .s1 { color: $base05;
color: #2aa198; }
} /* Literal.String.Single */ .sd {
.highlight .ss { /* Literal.String.Doc */
color: #2aa198; color: $base04;
} /* Literal.String.Symbol */ }
.highlight .bp { .s2 {
color: #22b3eb; /* Literal.String.Double */
} /* Name.Builtin.Pseudo */ color: $base0b;
.highlight .vc { }
color: #22b3eb; .se {
} /* Name.Variable.Class */ /* Literal.String.Escape */
.highlight .vg { color: $base09;
color: #22b3eb; }
} /* Name.Variable.Global */ .sh {
.highlight .vi { /* Literal.String.Heredoc */
color: #22b3eb; color: $base0b;
} /* Name.Variable.Instance */ }
.highlight .il { .si {
color: #2aa198; /* Literal.String.Interpol */
} /* Literal.Number.Integer.Long */ color: $base09;
}
.sx {
/* Literal.String.Other */
color: $base0b;
}
.sr {
/* Literal.String.Regex */
color: $base0b;
}
.s1 {
/* Literal.String.Single */
color: $base0b;
}
.ss {
/* Literal.String.Symbol */
color: $base0b;
}
.bp {
/* Name.Builtin.Pseudo */
color: $base05;
}
.vc {
/* Name.Variable.Class */
color: $base08;
}
.vg {
/* Name.Variable.Global */
color: $base08;
}
.vi {
/* Name.Variable.Instance */
color: $base08;
}
.il {
/* Literal.Number.Integer.Long */
color: $base09;
}
}

View file

@ -6,132 +6,148 @@
Typography Typography
========================================================================== */ ========================================================================== */
$doc-font-size : 16 !default; $doc-font-size: 16 !default;
/* paragraph indention */ /* paragraph indention */
$paragraph-indent : false !default; // true, false (default) $paragraph-indent: false !default; // true, false (default)
$indent-var : 1.3em !default; $indent-var: 1.3em !default;
/* system typefaces */ /* system typefaces */
$serif : Georgia, Times, serif !default; $serif: Georgia, Times, serif !default;
$sans-serif : -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif !default; $sans-serif: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI",
$monospace : Monaco, Consolas, "Lucida Console", monospace !default; "Helvetica Neue", "Lucida Grande", Arial, sans-serif !default;
$monospace: Monaco, Consolas, "Lucida Console", monospace !default;
/* sans serif typefaces */ /* sans serif typefaces */
$sans-serif-narrow : $sans-serif !default; $sans-serif-narrow: $sans-serif !default;
$helvetica : Helvetica, "Helvetica Neue", Arial, sans-serif !default; $helvetica: Helvetica, "Helvetica Neue", Arial, sans-serif !default;
/* serif typefaces */ /* serif typefaces */
$georgia : Georgia, serif !default; $georgia: Georgia, serif !default;
$times : Times, serif !default; $times: Times, serif !default;
$bodoni : "Bodoni MT", serif !default; $bodoni: "Bodoni MT", serif !default;
$calisto : "Calisto MT", serif !default; $calisto: "Calisto MT", serif !default;
$garamond : Garamond, serif !default; $garamond: Garamond, serif !default;
$global-font-family : $sans-serif !default; $global-font-family: $sans-serif !default;
$header-font-family : $sans-serif !default; $header-font-family: $sans-serif !default;
$caption-font-family : $serif !default; $caption-font-family: $serif !default;
/* type scale */ /* type scale */
$type-size-1 : 2.441em !default; // ~39.056px $type-size-1: 2.441em !default; // ~39.056px
$type-size-2 : 1.953em !default; // ~31.248px $type-size-2: 1.953em !default; // ~31.248px
$type-size-3 : 1.563em !default; // ~25.008px $type-size-3: 1.563em !default; // ~25.008px
$type-size-4 : 1.25em !default; // ~20px $type-size-4: 1.25em !default; // ~20px
$type-size-5 : 1em !default; // ~16px $type-size-5: 1em !default; // ~16px
$type-size-6 : 0.75em !default; // ~12px $type-size-6: 0.75em !default; // ~12px
$type-size-7 : 0.6875em !default; // ~11px $type-size-7: 0.6875em !default; // ~11px
$type-size-8 : 0.625em !default; // ~10px $type-size-8: 0.625em !default; // ~10px
/* /*
Colors Colors
========================================================================== */ ========================================================================== */
$gray : #7a8288 !default; $gray: #7a8288 !default;
$dark-gray : mix(#000, $gray, 40%) !default; $dark-gray: mix(#000, $gray, 40%) !default;
$darker-gray : mix(#000, $gray, 60%) !default; $darker-gray: mix(#000, $gray, 60%) !default;
$light-gray : mix(#fff, $gray, 50%) !default; $light-gray: mix(#fff, $gray, 50%) !default;
$lighter-gray : mix(#fff, $gray, 90%) !default; $lighter-gray: mix(#fff, $gray, 90%) !default;
$background-color : #fff !default; $background-color: #fff !default;
$code-background-color : #fafafa !default; $code-background-color: #fafafa !default;
$code-background-color-dark : $light-gray !default; $code-background-color-dark: $light-gray !default;
$text-color : $dark-gray !default; $text-color: $dark-gray !default;
$muted-text-color : mix(#fff, $text-color, 35%) !default; $muted-text-color: mix(#fff, $text-color, 35%) !default;
$border-color : $lighter-gray !default; $border-color: $lighter-gray !default;
$form-background-color : $lighter-gray !default; $form-background-color: $lighter-gray !default;
$footer-background-color : $lighter-gray !default; $footer-background-color: $lighter-gray !default;
$primary-color : #7a8288 !default; $primary-color: #7a8288 !default;
$success-color : #62c462 !default; $success-color: #62c462 !default;
$warning-color : #f89406 !default; $warning-color: #f89406 !default;
$danger-color : #ee5f5b !default; $danger-color: #ee5f5b !default;
$info-color : #52adc8 !default; $info-color: #52adc8 !default;
/* YIQ color contrast */ /* YIQ color contrast */
$yiq-contrasted-dark-default : $dark-gray !default; $yiq-contrasted-dark-default: $dark-gray !default;
$yiq-contrasted-light-default : #fff !default; $yiq-contrasted-light-default: #fff !default;
$yiq-contrasted-threshold : 175 !default; $yiq-contrasted-threshold: 175 !default;
$yiq-debug : false !default; $yiq-debug: false !default;
/* brands */ /* brands */
$behance-color : #1769FF !default; $behance-color: #1769ff !default;
$bitbucket-color : #205081 !default; $bitbucket-color: #205081 !default;
$dribbble-color : #ea4c89 !default; $dribbble-color: #ea4c89 !default;
$facebook-color : #3b5998 !default; $facebook-color: #3b5998 !default;
$flickr-color : #ff0084 !default; $flickr-color: #ff0084 !default;
$foursquare-color : #0072b1 !default; $foursquare-color: #0072b1 !default;
$github-color : #171516 !default; $github-color: #171516 !default;
$google-plus-color : #dd4b39 !default; $google-plus-color: #dd4b39 !default;
$instagram-color : #517fa4 !default; $instagram-color: #517fa4 !default;
$lastfm-color : #d51007 !default; $lastfm-color: #d51007 !default;
$linkedin-color : #007bb6 !default; $linkedin-color: #007bb6 !default;
$pinterest-color : #cb2027 !default; $pinterest-color: #cb2027 !default;
$rss-color : #fa9b39 !default; $rss-color: #fa9b39 !default;
$soundcloud-color : #ff3300 !default; $soundcloud-color: #ff3300 !default;
$stackoverflow-color : #fe7a15 !default; $stackoverflow-color: #fe7a15 !default;
$tumblr-color : #32506d !default; $tumblr-color: #32506d !default;
$twitter-color : #55acee !default; $twitter-color: #55acee !default;
$vimeo-color : #1ab7ea !default; $vimeo-color: #1ab7ea !default;
$vine-color : #00bf8f !default; $vine-color: #00bf8f !default;
$youtube-color : #bb0000 !default; $youtube-color: #bb0000 !default;
$xing-color : #006567 !default; $xing-color: #006567 !default;
/* links */ /* links */
$link-color : $info-color !default; $link-color: $info-color !default;
$link-color-hover : mix(#000, $link-color, 25%) !default; $link-color-hover: mix(#000, $link-color, 25%) !default;
$link-color-visited : mix(#fff, $link-color, 25%) !default; $link-color-visited: mix(#fff, $link-color, 25%) !default;
$masthead-link-color : $primary-color !default; $masthead-link-color: $primary-color !default;
$masthead-link-color-hover : mix(#000, $primary-color, 25%) !default; $masthead-link-color-hover: mix(#000, $primary-color, 25%) !default;
$navicon-link-color-hover : mix(#fff, $primary-color, 75%) !default; $navicon-link-color-hover: mix(#fff, $primary-color, 75%) !default;
/* syntax highlighting (base16) */
$base00: #263238 !default;
$base01: #2e3c43 !default;
$base02: #314549 !default;
$base03: #546e7a !default;
$base04: #b2ccd6 !default;
$base05: #eeffff !default;
$base06: #eeffff !default;
$base07: #ffffff !default;
$base08: #f07178 !default;
$base09: #f78c6c !default;
$base0a: #ffcb6b !default;
$base0b: #c3e88d !default;
$base0c: #89ddff !default;
$base0d: #82aaff !default;
$base0e: #c792ea !default;
$base0f: #ff5370 !default;
/* /*
Breakpoints Breakpoints
========================================================================== */ ========================================================================== */
$small : 600px !default; $small: 600px !default;
$medium : 768px !default; $medium: 768px !default;
$medium-wide : 900px !default; $medium-wide: 900px !default;
$large : 1024px !default; $large: 1024px !default;
$x-large : 1280px !default; $x-large: 1280px !default;
/* /*
Grid Grid
========================================================================== */ ========================================================================== */
$right-sidebar-width-narrow : 200px !default; $right-sidebar-width-narrow: 200px !default;
$right-sidebar-width : 300px !default; $right-sidebar-width: 300px !default;
$right-sidebar-width-wide : 400px !default; $right-sidebar-width-wide: 400px !default;
/* /*
Other Other
========================================================================== */ ========================================================================== */
$border-radius : 4px !default; $border-radius: 4px !default;
$box-shadow : 0 1px 1px rgba(0, 0, 0, 0.125) !default; $box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125) !default;
$navicon-width : 1.5rem !default; $navicon-width: 1.5rem !default;
$navicon-height : 0.25rem !default; $navicon-height: 0.25rem !default;
$global-transition : all 0.2s ease-in-out !default; $global-transition: all 0.2s ease-in-out !default;
$intro-transition : intro 0.3s both !default; $intro-transition: intro 0.3s both !default;

View file

@ -13,6 +13,24 @@ $masthead-link-color: $text-color !default;
$masthead-link-color-hover: $text-color !default; $masthead-link-color-hover: $text-color !default;
$navicon-link-color-hover: mix(#fff, $text-color, 80%) !default; $navicon-link-color-hover: mix(#fff, $text-color, 80%) !default;
/* contrast syntax highlighting (base16) */
$base00: #000000 !default;
$base01: #242422 !default;
$base02: #484844 !default;
$base03: #6c6c66 !default;
$base04: #918f88 !default;
$base05: #b5b3aa !default;
$base06: #d9d7cc !default;
$base07: #fdfbee !default;
$base08: #ff6c60 !default;
$base09: #e9c062 !default;
$base0a: #ffffb6 !default;
$base0b: #a8ff60 !default;
$base0c: #c6c5fe !default;
$base0d: #96cbfe !default;
$base0e: #ff73fd !default;
$base0f: #b18a3d !default;
.page__content { .page__content {
.notice, .notice,
.notice--primary, .notice--primary,

View file

@ -18,6 +18,24 @@ $masthead-link-color: $text-color !default;
$masthead-link-color-hover: mix(#000, $text-color, 20%) !default; $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
$navicon-link-color-hover: mix(#000, $background-color, 30%) !default; $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
/* dark syntax highlighting (base16) */
$base00: #ffffff !default;
$base01: #e0e0e0 !default;
$base02: #d0d0d0 !default;
$base03: #b0b0b0 !default;
$base04: #000000 !default;
$base05: #101010 !default;
$base06: #151515 !default;
$base07: #202020 !default;
$base08: #ff0086 !default;
$base09: #fd8900 !default;
$base0a: #aba800 !default;
$base0b: #00c918 !default;
$base0c: #1faaaa !default;
$base0d: #3777e6 !default;
$base0e: #ad00a1 !default;
$base0f: #cc6633 !default;
.page__footer-follow .social-icons .svg-inline--fa { .page__footer-follow .social-icons .svg-inline--fa {
color: inherit; color: inherit;
} }

View file

@ -12,4 +12,22 @@ $footer-background-color: #e9dcbe !default;
$link-color: #343434 !default; $link-color: #343434 !default;
$masthead-link-color: $text-color !default; $masthead-link-color: $text-color !default;
$masthead-link-color-hover: $text-color !default; $masthead-link-color-hover: $text-color !default;
$navicon-link-color-hover: mix(#fff, $text-color, 80%) !default; $navicon-link-color-hover: mix(#fff, $text-color, 80%) !default;
/* dirt syntax highlighting (base16) */
$base00: #231e18 !default;
$base01: #302b25 !default;
$base02: #48413a !default;
$base03: #9d8b70 !default;
$base04: #b4a490 !default;
$base05: #cabcb1 !default;
$base06: #d7c8bc !default;
$base07: #e4d4c8 !default;
$base08: #d35c5c !default;
$base09: #ca7f32 !default;
$base0a: #e0ac16 !default;
$base0b: #b7ba53 !default;
$base0c: #6eb958 !default;
$base0d: #88a4d3 !default;
$base0e: #bb90e2 !default;
$base0f: #b49368 !default;

View file

@ -18,6 +18,24 @@ $masthead-link-color: $text-color !default;
$masthead-link-color-hover: mix(#000, $text-color, 20%) !default; $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
$navicon-link-color-hover: mix(#000, $background-color, 30%) !default; $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
/* neon syntax highlighting (base16) */
$base00: #ffffff !default;
$base01: #e0e0e0 !default;
$base02: #d0d0d0 !default;
$base03: #b0b0b0 !default;
$base04: #000000 !default;
$base05: #101010 !default;
$base06: #151515 !default;
$base07: #202020 !default;
$base08: #ff0086 !default;
$base09: #fd8900 !default;
$base0a: #aba800 !default;
$base0b: #00c918 !default;
$base0c: #1faaaa !default;
$base0d: #3777e6 !default;
$base0e: #ad00a1 !default;
$base0f: #cc6633 !default;
.author__urls.social-icons .fa, .author__urls.social-icons .fa,
.page__footer-follow .social-icons .svg-inline--fa { .page__footer-follow .social-icons .svg-inline--fa {
color: inherit; color: inherit;

View file

@ -18,6 +18,24 @@ $masthead-link-color: $text-color !default;
$masthead-link-color-hover: mix(#000, $text-color, 20%) !default; $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
$navicon-link-color-hover: mix(#000, $background-color, 30%) !default; $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
/* plum syntax highlighting (base16) */
$base00: #ffffff !default;
$base01: #e0e0e0 !default;
$base02: #d0d0d0 !default;
$base03: #b0b0b0 !default;
$base04: #000000 !default;
$base05: #101010 !default;
$base06: #151515 !default;
$base07: #202020 !default;
$base08: #ff0086 !default;
$base09: #fd8900 !default;
$base0a: #aba800 !default;
$base0b: #00c918 !default;
$base0c: #1faaaa !default;
$base0d: #3777e6 !default;
$base0e: #ad00a1 !default;
$base0f: #cc6633 !default;
.author__urls.social-icons .fa, .author__urls.social-icons .fa,
.page__footer-follow .social-icons .svg-inline--fa { .page__footer-follow .social-icons .svg-inline--fa {
color: inherit; color: inherit;

View file

@ -20,6 +20,24 @@ $masthead-link-color: $text-color !default;
$masthead-link-color-hover: mix(#000, $text-color, 20%) !default; $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
$navicon-link-color-hover: mix(#000, $background-color, 30%) !default; $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
/* sunrise syntax highlighting (base16) */
$base00: #1d1f21 !default;
$base01: #282a2e !default;
$base02: #373b41 !default;
$base03: #969896 !default;
$base04: #b4b7b4 !default;
$base05: #c5c8c6 !default;
$base06: #e0e0e0 !default;
$base07: #ffffff !default;
$base08: #cc6666 !default;
$base09: #de935f !default;
$base0a: #f0c674 !default;
$base0b: #b5bd68 !default;
$base0c: #8abeb7 !default;
$base0d: #81a2be !default;
$base0e: #b294bb !default;
$base0f: #a3685a !default;
.author__urls.social-icons .fa, .author__urls.social-icons .fa,
.page__footer-follow .social-icons .svg-inline--fa { .page__footer-follow .social-icons .svg-inline--fa {
color: inherit; color: inherit;

View file

@ -1,7 +1,7 @@
--- ---
title: "Markup: Syntax Highlighting" title: "Markup: Syntax Highlighting"
excerpt: "Post displaying the various ways of highlighting code in Markdown." excerpt: "Post displaying the various ways of highlighting code in Markdown."
last_modified_at: 2018-01-03T09:44:58-05:00 last_modified_at: 2018-01-03T09:45:06-05:00
header: header:
teaser: "assets/images/markup-syntax-highlighting-teaser.jpg" teaser: "assets/images/markup-syntax-highlighting-teaser.jpg"
tags: tags:
@ -88,15 +88,29 @@ Indentation matters. Be sure the indent of the code block aligns with the first
An example of a code blocking using Jekyll's [`{% raw %}{% highlight %}{% endraw %}` tag](https://jekyllrb.com/docs/templates/#code-snippet-highlighting). An example of a code blocking using Jekyll's [`{% raw %}{% highlight %}{% endraw %}` tag](https://jekyllrb.com/docs/templates/#code-snippet-highlighting).
{% highlight html linenos %} {% highlight javascript linenos %}
{% raw %}<nav class="pagination" role="navigation"> // 'gulp html' -- does nothing
{% if page.previous %} // 'gulp html --prod' -- minifies and gzips HTML files for production
<a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a> gulp.task('html', () => {
{% endif %} return gulp.src(paths.siteFolderName + paths.htmlPattern)
{% if page.next %} .pipe(when(argv.prod, htmlmin({
<a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a> removeComments: true,
{% endif %} collapseWhitespace: true,
</nav><!-- /.pagination -->{% endraw %} collapseBooleanAttributes: false,
removeAttributeQuotes: false,
removeRedundantAttributes: false,
minifyJS: true,
minifyCSS: true
})))
.pipe(when(argv.prod, size({title: 'optimized HTML'})))
.pipe(when(argv.prod, gulp.dest(paths.siteFolderName)))
.pipe(when(argv.prod, gzip({append: true})))
.pipe(when(argv.prod, size({
title: 'gzipped HTML',
gzip: true
})))
.pipe(when(argv.prod, gulp.dest(paths.siteFolderName)))
});
{% endhighlight %} {% endhighlight %}
{% highlight wl linenos %} {% highlight wl linenos %}

View file

@ -88,15 +88,29 @@ Indentation matters. Be sure the indent of the code block aligns with the first
An example of a code blocking using Jekyll's [`{% raw %}{% highlight %}{% endraw %}` tag](https://jekyllrb.com/docs/templates/#code-snippet-highlighting). An example of a code blocking using Jekyll's [`{% raw %}{% highlight %}{% endraw %}` tag](https://jekyllrb.com/docs/templates/#code-snippet-highlighting).
{% highlight html linenos %} {% highlight javascript linenos %}
{% raw %}<nav class="pagination" role="navigation"> // 'gulp html' -- does nothing
{% if page.previous %} // 'gulp html --prod' -- minifies and gzips HTML files for production
<a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a> gulp.task('html', () => {
{% endif %} return gulp.src(paths.siteFolderName + paths.htmlPattern)
{% if page.next %} .pipe(when(argv.prod, htmlmin({
<a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a> removeComments: true,
{% endif %} collapseWhitespace: true,
</nav><!-- /.pagination -->{% endraw %} collapseBooleanAttributes: false,
removeAttributeQuotes: false,
removeRedundantAttributes: false,
minifyJS: true,
minifyCSS: true
})))
.pipe(when(argv.prod, size({title: 'optimized HTML'})))
.pipe(when(argv.prod, gulp.dest(paths.siteFolderName)))
.pipe(when(argv.prod, gzip({append: true})))
.pipe(when(argv.prod, size({
title: 'gzipped HTML',
gzip: true
})))
.pipe(when(argv.prod, gulp.dest(paths.siteFolderName)))
});
{% endhighlight %} {% endhighlight %}
{% highlight wl linenos %} {% highlight wl linenos %}