From 9852a3d84ee7a99f3371d0d1eb0400759946a587 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 13 Aug 2018 13:46:21 -0400 Subject: [PATCH] Meta: update some syntax highlighting stuff * Makes "bad" examples fit the current code block style, instead of removing their background. * Marks ABNF code as such. This will require html-build tweaks to have an effect. * Adds syntax highlighting styles to the dev edition. Closes #3755. * Removes no-longer-necessary [hidden] rule, per https://github.com/whatwg/whatwg.org/issues/220#issuecomment-409368787. --- dev/styles.css | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ source | 28 ++++++++++++------------- 2 files changed, 70 insertions(+), 15 deletions(-) diff --git a/dev/styles.css b/dev/styles.css index 3039db1b0cc..8b8eccac148 100644 --- a/dev/styles.css +++ b/dev/styles.css @@ -633,3 +633,60 @@ ul.domTree li:not(:last-child)::after { content: ''; border-width: 0.1em; } + +/* SYNTAX HIGHLIGHTING */ + + +/* for output from https://github.com/tabatkins/highlighter */ +c-[a] { color: #990055 } /* Keyword.Declaration */ +c-[b] { color: #990055 } /* Keyword.Type */ +c-[c] { color: #708090 } /* Comment */ +c-[d] { color: #708090 } /* Comment.Multiline */ +c-[e] { color: #0077aa } /* Name.Attribute */ +c-[f] { color: #669900 } /* Name.Tag */ +c-[g] { color: #222222 } /* Name.Variable */ +c-[k] { color: #990055 } /* Keyword */ +c-[l] { color: #000000 } /* Literal */ +c-[m] { color: #000000 } /* Literal.Number */ +c-[n] { color: #0077aa } /* Name */ +c-[o] { color: #999999 } /* Operator */ +c-[p] { color: #999999 } /* Punctuation */ +c-[s] { color: #a67f59 } /* Literal.String */ +c-[t] { color: #a67f59 } /* Literal.String.Single */ +c-[u] { color: #a67f59 } /* Literal.String.Double */ +c-[cp] { color: #708090 } /* Comment.Preproc */ +c-[c1] { color: #708090 } /* Comment.Single */ +c-[cs] { color: #708090 } /* Comment.Special */ +c-[kc] { color: #990055 } /* Keyword.Constant */ +c-[kn] { color: #990055 } /* Keyword.Namespace */ +c-[kp] { color: #990055 } /* Keyword.Pseudo */ +c-[kr] { color: #990055 } /* Keyword.Reserved */ +c-[ld] { color: #000000 } /* Literal.Date */ +c-[nc] { color: #0077aa } /* Name.Class */ +c-[no] { color: #0077aa } /* Name.Constant */ +c-[nd] { color: #0077aa } /* Name.Decorator */ +c-[ni] { color: #0077aa } /* Name.Entity */ +c-[ne] { color: #0077aa } /* Name.Exception */ +c-[nf] { color: #0077aa } /* Name.Function */ +c-[nl] { color: #0077aa } /* Name.Label */ +c-[nn] { color: #0077aa } /* Name.Namespace */ +c-[py] { color: #0077aa } /* Name.Property */ +c-[ow] { color: #999999 } /* Operator.Word */ +c-[mb] { color: #000000 } /* Literal.Number.Bin */ +c-[mf] { color: #000000 } /* Literal.Number.Float */ +c-[mh] { color: #000000 } /* Literal.Number.Hex */ +c-[mi] { color: #000000 } /* Literal.Number.Integer */ +c-[mo] { color: #000000 } /* Literal.Number.Oct */ +c-[sb] { color: #a67f59 } /* Literal.String.Backtick */ +c-[sc] { color: #a67f59 } /* Literal.String.Char */ +c-[sd] { color: #a67f59 } /* Literal.String.Doc */ +c-[se] { color: #a67f59 } /* Literal.String.Escape */ +c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */ +c-[si] { color: #a67f59 } /* Literal.String.Interpol */ +c-[sx] { color: #a67f59 } /* Literal.String.Other */ +c-[sr] { color: #a67f59 } /* Literal.String.Regex */ +c-[ss] { color: #a67f59 } /* Literal.String.Symbol */ +c-[vc] { color: #0077aa } /* Name.Variable.Class */ +c-[vg] { color: #0077aa } /* Name.Variable.Global */ +c-[vi] { color: #0077aa } /* Name.Variable.Instance */ +c-[il] { color: #000000 } /* Literal.Number.Integer.Long */ diff --git a/source b/source index 6ab4395fe82..90fc3711ed4 100644 --- a/source +++ b/source @@ -82,9 +82,7 @@