From 983873a9346fc0da1d4a21732568adca708f26c0 Mon Sep 17 00:00:00 2001 From: Arnaud Coomans Date: Tue, 14 Oct 2014 17:55:41 -0700 Subject: [PATCH] Changed code highlighting to match Xcode's --- docs/_sass/_syntax-highlighting.scss | 83 +++++++++++++++------------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/docs/_sass/_syntax-highlighting.scss b/docs/_sass/_syntax-highlighting.scss index e36627da7a..3758fdb458 100644 --- a/docs/_sass/_syntax-highlighting.scss +++ b/docs/_sass/_syntax-highlighting.scss @@ -1,18 +1,26 @@ /** * Syntax highlighting styles */ + +/* not official Xcode colors, but looks better on the web */ +$xc-black: black; +$xc-green: #008d14; +$xc-red: #b72748; +$xc-blue: #103ffb; +$xc-turquoise: #3a95ba; + .highlight { background: #fff; @extend %vertical-rhythm; - .c { color: #998; font-style: italic } // Comment + .c { color: $xc-green; font-style: italic } // Comment .err { color: #a61717; background-color: #e3d2d2 } // Error - .k { font-weight: bold } // Keyword - .o { font-weight: bold } // Operator - .cm { color: #998; font-style: italic } // Comment.Multiline - .cp { color: #999; font-weight: bold } // Comment.Preproc - .c1 { color: #998; font-style: italic } // Comment.Single - .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special + .k { color: $xc-blue} // Keyword + .o { } // Operator + .cm { color: $xc-green; font-style: italic } // Comment.Multiline + .cp { color: $xc-red} // Comment.Preproc + .c1 { color: $xc-green; font-style: italic } // Comment.Single + .cs { color: $xc-green; font-weight: bold; font-style: italic } // Comment.Special .gd { color: #000; background-color: #fdd } // Generic.Deleted .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific .ge { font-style: italic } // Generic.Emph @@ -25,29 +33,30 @@ .gs { font-weight: bold } // Generic.Strong .gu { color: #aaa } // Generic.Subheading .gt { color: #a00 } // Generic.Traceback - .kc { font-weight: bold } // Keyword.Constant - .kd { font-weight: bold } // Keyword.Declaration - .kp { font-weight: bold } // Keyword.Pseudo - .kr { font-weight: bold } // Keyword.Reserved - .kt { color: #458; font-weight: bold } // Keyword.Type - .m { color: #099 } // Literal.Number - .s { color: #d14 } // Literal.String - .na { color: #008080 } // Name.Attribute - .nb { color: #0086B3 } // Name.Builtin - .nc { color: #458; font-weight: bold } // Name.Class - .no { color: #008080 } // Name.Constant - .ni { color: #800080 } // Name.Entity - .ne { color: #900; font-weight: bold } // Name.Exception - .nf { color: #900; font-weight: bold } // Name.Function - .nn { color: #555 } // Name.Namespace - .nt { color: #000080 } // Name.Tag - .nv { color: #008080 } // Name.Variable - .ow { font-weight: bold } // Operator.Word + .kc { color: orange} // Keyword.Constant + .kd { color: orange} // Keyword.Declaration + .kp { color: $xc-green} // Keyword.Pseudo + .kr { color: $xc-green} // Keyword.Reserved + .kt { color: $xc-blue} // Keyword.Type + .m { color: orange } // Literal.Number + .s { color: $xc-red } // Literal.String + .na { color: orange } // Name.Attribute + .nb { color: $xc-blue } // Name.Builtin + .nc { color: $xc-turquoise } // Name.Class + .no { color: orange } // Name.Constant + .ni { color: orange } // Name.Entity + .ne { color: orange } // Name.Exception + .nf { } // Name.Function + .nn { color: orange } // Name.Namespace + .nt { color: orange } // Name.Tag + .nv { } // Name.Variable + .ow { } // Operator.Word .w { color: #bbb } // Text.Whitespace - .mf { color: #099 } // Literal.Number.Float - .mh { color: #099 } // Literal.Number.Hex - .mi { color: #099 } // Literal.Number.Integer - .mo { color: #099 } // Literal.Number.Oct + .mf {} // Literal.Number.Float + .mh { color: $xc-black } // Literal.Number.Hex + .mi { color: $xc-black } // Literal.Number.Integer + .mo { color: $xc-black } // Literal.Number.Oct + .il { color: $xc-black } // Literal.Number.Integer.Long .sb { color: #d14 } // Literal.String.Backtick .sc { color: #d14 } // Literal.String.Char .sd { color: #d14 } // Literal.String.Doc @@ -56,12 +65,12 @@ .sh { color: #d14 } // Literal.String.Heredoc .si { color: #d14 } // Literal.String.Interpol .sx { color: #d14 } // Literal.String.Other - .sr { color: #009926 } // Literal.String.Regex - .s1 { color: #d14 } // Literal.String.Single - .ss { color: #990073 } // Literal.String.Symbol - .bp { color: #999 } // Name.Builtin.Pseudo - .vc { color: #008080 } // Name.Variable.Class - .vg { color: #008080 } // Name.Variable.Global - .vi { color: #008080 } // Name.Variable.Instance - .il { color: #099 } // Literal.Number.Integer.Long + .sr { color: orange } // Literal.String.Regex + .s1 { color: $xc-red } // Literal.String.Single + .ss { color: $xc-red } // Literal.String.Symbol + .bp { color: $xc-turquoise } // Name.Builtin.Pseudo + .vc { color: $xc-turquoise } // Name.Variable.Class + .vg { color: $xc-black } // Name.Variable.Global + .vi { color: orange } // Name.Variable.Instance + .nl { color: $xc-turquoise } }