[gi-docgen/highlight-theme] template: Switch to Solarized for syntax highlighting




commit 90dc18aa1c4c157f720e9f8a6c8d5450fd4e1f80
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Sep 2 14:26:56 2021 +0100

    template: Switch to Solarized for syntax highlighting
    
    The default theme doesn't really work well in dark mode, and even in
    light mode it "screams" a lot.
    
    The Solarized color scheme, on the other hand, looks better in light
    mode, and has a dark mode as well.
    
    We can use the @import rule to determine whether to load the light or
    dark Solarized scheme depending on the browser settings.
    
    Fixes: #101

 gidocgen/templates/basic/basic.toml          |  3 +-
 gidocgen/templates/basic/pygment.css         | 74 -----------------------
 gidocgen/templates/basic/solarized-dark.css  | 88 ++++++++++++++++++++++++++++
 gidocgen/templates/basic/solarized-light.css | 88 ++++++++++++++++++++++++++++
 gidocgen/templates/basic/style.css           |  9 +--
 5 files changed, 181 insertions(+), 81 deletions(-)
---
diff --git a/gidocgen/templates/basic/basic.toml b/gidocgen/templates/basic/basic.toml
index 15b6a7f..3274d04 100644
--- a/gidocgen/templates/basic/basic.toml
+++ b/gidocgen/templates/basic/basic.toml
@@ -39,7 +39,8 @@ files = [
   "fzy.js",
   "go-up-symbolic.png",
   "main.js",
-  "pygment.css",
+  "solarized-light.css",
+  "solarized-dark.css",
   "search.js",
   "RedHatDisplay-Black.woff",
   "RedHatDisplay-Black.woff2",
diff --git a/gidocgen/templates/basic/solarized-dark.css b/gidocgen/templates/basic/solarized-dark.css
new file mode 100644
index 0000000..2edc59b
--- /dev/null
+++ b/gidocgen/templates/basic/solarized-dark.css
@@ -0,0 +1,88 @@
+/*
+ * SPDX-FileCopyrightText: 2014 John Louis Del Rosario, Hank Gay, John Mastro, Brandon Bennett
+ * SPDX-License-Identifier: MIT
+ */
+
+pre { line-height: 125%; }
+td.linenos pre { color: #586e75; background-color: #073642; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: #586e75; background-color: #073642; padding-left: 5px; padding-right: 5px; }
+td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+.codehilite .hll { background-color: #073642 }
+.codehilite { background: #002b36; color: #839496 }
+.codehilite .c { color: #586e75; font-style: italic } /* Comment */
+.codehilite .err { color: #839496; background-color: #dc322f } /* Error */
+.codehilite .esc { color: #839496 } /* Escape */
+.codehilite .g { color: #839496 } /* Generic */
+.codehilite .k { color: #859900 } /* Keyword */
+.codehilite .l { color: #839496 } /* Literal */
+.codehilite .n { color: #839496 } /* Name */
+.codehilite .o { color: #586e75 } /* Operator */
+.codehilite .x { color: #839496 } /* Other */
+.codehilite .p { color: #839496 } /* Punctuation */
+.codehilite .ch { color: #586e75; font-style: italic } /* Comment.Hashbang */
+.codehilite .cm { color: #586e75; font-style: italic } /* Comment.Multiline */
+.codehilite .cp { color: #d33682 } /* Comment.Preproc */
+.codehilite .cpf { color: #586e75 } /* Comment.PreprocFile */
+.codehilite .c1 { color: #586e75; font-style: italic } /* Comment.Single */
+.codehilite .cs { color: #586e75; font-style: italic } /* Comment.Special */
+.codehilite .gd { color: #dc322f } /* Generic.Deleted */
+.codehilite .ge { color: #839496; font-style: italic } /* Generic.Emph */
+.codehilite .gr { color: #dc322f } /* Generic.Error */
+.codehilite .gh { color: #839496; font-weight: bold } /* Generic.Heading */
+.codehilite .gi { color: #859900 } /* Generic.Inserted */
+.codehilite .go { color: #839496 } /* Generic.Output */
+.codehilite .gp { color: #839496 } /* Generic.Prompt */
+.codehilite .gs { color: #839496; font-weight: bold } /* Generic.Strong */
+.codehilite .gu { color: #839496; text-decoration: underline } /* Generic.Subheading */
+.codehilite .gt { color: #268bd2 } /* Generic.Traceback */
+.codehilite .kc { color: #2aa198 } /* Keyword.Constant */
+.codehilite .kd { color: #2aa198 } /* Keyword.Declaration */
+.codehilite .kn { color: #cb4b16 } /* Keyword.Namespace */
+.codehilite .kp { color: #859900 } /* Keyword.Pseudo */
+.codehilite .kr { color: #859900 } /* Keyword.Reserved */
+.codehilite .kt { color: #b58900 } /* Keyword.Type */
+.codehilite .ld { color: #839496 } /* Literal.Date */
+.codehilite .m { color: #2aa198 } /* Literal.Number */
+.codehilite .s { color: #2aa198 } /* Literal.String */
+.codehilite .na { color: #839496 } /* Name.Attribute */
+.codehilite .nb { color: #268bd2 } /* Name.Builtin */
+.codehilite .nc { color: #268bd2 } /* Name.Class */
+.codehilite .no { color: #268bd2 } /* Name.Constant */
+.codehilite .nd { color: #268bd2 } /* Name.Decorator */
+.codehilite .ni { color: #268bd2 } /* Name.Entity */
+.codehilite .ne { color: #268bd2 } /* Name.Exception */
+.codehilite .nf { color: #268bd2 } /* Name.Function */
+.codehilite .nl { color: #268bd2 } /* Name.Label */
+.codehilite .nn { color: #268bd2 } /* Name.Namespace */
+.codehilite .nx { color: #839496 } /* Name.Other */
+.codehilite .py { color: #839496 } /* Name.Property */
+.codehilite .nt { color: #268bd2 } /* Name.Tag */
+.codehilite .nv { color: #268bd2 } /* Name.Variable */
+.codehilite .ow { color: #859900 } /* Operator.Word */
+.codehilite .w { color: #839496 } /* Text.Whitespace */
+.codehilite .mb { color: #2aa198 } /* Literal.Number.Bin */
+.codehilite .mf { color: #2aa198 } /* Literal.Number.Float */
+.codehilite .mh { color: #2aa198 } /* Literal.Number.Hex */
+.codehilite .mi { color: #2aa198 } /* Literal.Number.Integer */
+.codehilite .mo { color: #2aa198 } /* Literal.Number.Oct */
+.codehilite .sa { color: #2aa198 } /* Literal.String.Affix */
+.codehilite .sb { color: #2aa198 } /* Literal.String.Backtick */
+.codehilite .sc { color: #2aa198 } /* Literal.String.Char */
+.codehilite .dl { color: #2aa198 } /* Literal.String.Delimiter */
+.codehilite .sd { color: #586e75 } /* Literal.String.Doc */
+.codehilite .s2 { color: #2aa198 } /* Literal.String.Double */
+.codehilite .se { color: #2aa198 } /* Literal.String.Escape */
+.codehilite .sh { color: #2aa198 } /* Literal.String.Heredoc */
+.codehilite .si { color: #2aa198 } /* Literal.String.Interpol */
+.codehilite .sx { color: #2aa198 } /* Literal.String.Other */
+.codehilite .sr { color: #cb4b16 } /* Literal.String.Regex */
+.codehilite .s1 { color: #2aa198 } /* Literal.String.Single */
+.codehilite .ss { color: #2aa198 } /* Literal.String.Symbol */
+.codehilite .bp { color: #268bd2 } /* Name.Builtin.Pseudo */
+.codehilite .fm { color: #268bd2 } /* Name.Function.Magic */
+.codehilite .vc { color: #268bd2 } /* Name.Variable.Class */
+.codehilite .vg { color: #268bd2 } /* Name.Variable.Global */
+.codehilite .vi { color: #268bd2 } /* Name.Variable.Instance */
+.codehilite .vm { color: #268bd2 } /* Name.Variable.Magic */
+.codehilite .il { color: #2aa198 } /* Literal.Number.Integer.Long */
diff --git a/gidocgen/templates/basic/solarized-light.css b/gidocgen/templates/basic/solarized-light.css
new file mode 100644
index 0000000..f1fa80f
--- /dev/null
+++ b/gidocgen/templates/basic/solarized-light.css
@@ -0,0 +1,88 @@
+/*
+ * SPDX-FileCopyrightText: 2014 John Louis Del Rosario, Hank Gay, John Mastro, Brandon Bennett
+ * SPDX-License-Identifier: MIT
+ */
+
+pre { line-height: 125%; }
+td.linenos pre { color: #93a1a1; background-color: #eee8d5; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: #93a1a1; background-color: #eee8d5; padding-left: 5px; padding-right: 5px; }
+td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+.codehilite .hll { background-color: #eee8d5 }
+.codehilite { background: #fdf6e3; color: #657b83 }
+.codehilite .c { color: #93a1a1; font-style: italic } /* Comment */
+.codehilite .err { color: #657b83; background-color: #dc322f } /* Error */
+.codehilite .esc { color: #657b83 } /* Escape */
+.codehilite .g { color: #657b83 } /* Generic */
+.codehilite .k { color: #859900 } /* Keyword */
+.codehilite .l { color: #657b83 } /* Literal */
+.codehilite .n { color: #657b83 } /* Name */
+.codehilite .o { color: #93a1a1 } /* Operator */
+.codehilite .x { color: #657b83 } /* Other */
+.codehilite .p { color: #657b83 } /* Punctuation */
+.codehilite .ch { color: #93a1a1; font-style: italic } /* Comment.Hashbang */
+.codehilite .cm { color: #93a1a1; font-style: italic } /* Comment.Multiline */
+.codehilite .cp { color: #d33682 } /* Comment.Preproc */
+.codehilite .cpf { color: #93a1a1 } /* Comment.PreprocFile */
+.codehilite .c1 { color: #93a1a1; font-style: italic } /* Comment.Single */
+.codehilite .cs { color: #93a1a1; font-style: italic } /* Comment.Special */
+.codehilite .gd { color: #dc322f } /* Generic.Deleted */
+.codehilite .ge { color: #657b83; font-style: italic } /* Generic.Emph */
+.codehilite .gr { color: #dc322f } /* Generic.Error */
+.codehilite .gh { color: #657b83; font-weight: bold } /* Generic.Heading */
+.codehilite .gi { color: #859900 } /* Generic.Inserted */
+.codehilite .go { color: #657b83 } /* Generic.Output */
+.codehilite .gp { color: #657b83 } /* Generic.Prompt */
+.codehilite .gs { color: #657b83; font-weight: bold } /* Generic.Strong */
+.codehilite .gu { color: #657b83; text-decoration: underline } /* Generic.Subheading */
+.codehilite .gt { color: #268bd2 } /* Generic.Traceback */
+.codehilite .kc { color: #2aa198 } /* Keyword.Constant */
+.codehilite .kd { color: #2aa198 } /* Keyword.Declaration */
+.codehilite .kn { color: #cb4b16 } /* Keyword.Namespace */
+.codehilite .kp { color: #859900 } /* Keyword.Pseudo */
+.codehilite .kr { color: #859900 } /* Keyword.Reserved */
+.codehilite .kt { color: #b58900 } /* Keyword.Type */
+.codehilite .ld { color: #657b83 } /* Literal.Date */
+.codehilite .m { color: #2aa198 } /* Literal.Number */
+.codehilite .s { color: #2aa198 } /* Literal.String */
+.codehilite .na { color: #657b83 } /* Name.Attribute */
+.codehilite .nb { color: #268bd2 } /* Name.Builtin */
+.codehilite .nc { color: #268bd2 } /* Name.Class */
+.codehilite .no { color: #268bd2 } /* Name.Constant */
+.codehilite .nd { color: #268bd2 } /* Name.Decorator */
+.codehilite .ni { color: #268bd2 } /* Name.Entity */
+.codehilite .ne { color: #268bd2 } /* Name.Exception */
+.codehilite .nf { color: #268bd2 } /* Name.Function */
+.codehilite .nl { color: #268bd2 } /* Name.Label */
+.codehilite .nn { color: #268bd2 } /* Name.Namespace */
+.codehilite .nx { color: #657b83 } /* Name.Other */
+.codehilite .py { color: #657b83 } /* Name.Property */
+.codehilite .nt { color: #268bd2 } /* Name.Tag */
+.codehilite .nv { color: #268bd2 } /* Name.Variable */
+.codehilite .ow { color: #859900 } /* Operator.Word */
+.codehilite .w { color: #657b83 } /* Text.Whitespace */
+.codehilite .mb { color: #2aa198 } /* Literal.Number.Bin */
+.codehilite .mf { color: #2aa198 } /* Literal.Number.Float */
+.codehilite .mh { color: #2aa198 } /* Literal.Number.Hex */
+.codehilite .mi { color: #2aa198 } /* Literal.Number.Integer */
+.codehilite .mo { color: #2aa198 } /* Literal.Number.Oct */
+.codehilite .sa { color: #2aa198 } /* Literal.String.Affix */
+.codehilite .sb { color: #2aa198 } /* Literal.String.Backtick */
+.codehilite .sc { color: #2aa198 } /* Literal.String.Char */
+.codehilite .dl { color: #2aa198 } /* Literal.String.Delimiter */
+.codehilite .sd { color: #93a1a1 } /* Literal.String.Doc */
+.codehilite .s2 { color: #2aa198 } /* Literal.String.Double */
+.codehilite .se { color: #2aa198 } /* Literal.String.Escape */
+.codehilite .sh { color: #2aa198 } /* Literal.String.Heredoc */
+.codehilite .si { color: #2aa198 } /* Literal.String.Interpol */
+.codehilite .sx { color: #2aa198 } /* Literal.String.Other */
+.codehilite .sr { color: #cb4b16 } /* Literal.String.Regex */
+.codehilite .s1 { color: #2aa198 } /* Literal.String.Single */
+.codehilite .ss { color: #2aa198 } /* Literal.String.Symbol */
+.codehilite .bp { color: #268bd2 } /* Name.Builtin.Pseudo */
+.codehilite .fm { color: #268bd2 } /* Name.Function.Magic */
+.codehilite .vc { color: #268bd2 } /* Name.Variable.Class */
+.codehilite .vg { color: #268bd2 } /* Name.Variable.Global */
+.codehilite .vi { color: #268bd2 } /* Name.Variable.Instance */
+.codehilite .vm { color: #268bd2 } /* Name.Variable.Magic */
+.codehilite .il { color: #2aa198 } /* Literal.Number.Integer.Long */
diff --git a/gidocgen/templates/basic/style.css b/gidocgen/templates/basic/style.css
index 5a6f35f..a7be6ab 100644
--- a/gidocgen/templates/basic/style.css
+++ b/gidocgen/templates/basic/style.css
@@ -4,7 +4,9 @@
  * SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
  */
 
-@import url("pygment.css");
+@import url("solarized-light.css") (prefers-color-scheme: light);
+@import url("solarized-dark.css") (prefers-color-scheme: dark);
+
 @import url("fonts.css");
 
 /*********************************
@@ -83,11 +85,6 @@
     --box-text-color: #fff;
     --heading-docblock-color: #b7b7b7;
   }
-
-  /* fix dark theme syntax highlighting with a filter (for now) */
-  .highlight pre span {
-       filter: brightness(6);
-  }
 }
 
 /*********************************


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]