This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 83d067195f Better code syntax highlighting in light & dark mode
83d067195f is described below

commit 83d067195f7ff65d93589e29889ea8d63e448ca9
Author: Kaxil Naik <[email protected]>
AuthorDate: Wed Dec 17 21:36:30 2025 +0000

    Better code syntax highlighting in light & dark mode
---
 landing-pages/site/assets/scss/_highlights.scss    |  5 +-
 .../site/assets/scss/_markdown-content.scss        |  6 --
 landing-pages/site/assets/scss/pygments/_dark.scss | 10 ++-
 .../site/assets/scss/pygments/_light.scss          | 83 ++++++++++++++++++++++
 4 files changed, 91 insertions(+), 13 deletions(-)

diff --git a/landing-pages/site/assets/scss/_highlights.scss 
b/landing-pages/site/assets/scss/_highlights.scss
index f631b46308..44e42dbf33 100644
--- a/landing-pages/site/assets/scss/_highlights.scss
+++ b/landing-pages/site/assets/scss/_highlights.scss
@@ -17,6 +17,7 @@
  * under the License.
  */
 @import "colors";
+@import "pygments/light";
 @import "pygments/dark";
 
 .chroma, .highlight {
@@ -112,9 +113,5 @@ pre {
   pre {
     background-color: #0d1117;
     border-color: rgba(255, 255, 255, 0.1);
-
-    span {
-      color: #E6EDF3;
-    }
   }
 }
diff --git a/landing-pages/site/assets/scss/_markdown-content.scss 
b/landing-pages/site/assets/scss/_markdown-content.scss
index 1e0d3b0b02..00676b9806 100644
--- a/landing-pages/site/assets/scss/_markdown-content.scss
+++ b/landing-pages/site/assets/scss/_markdown-content.scss
@@ -17,8 +17,6 @@
  * under the License.
  */
 
-@import "pygments/dark";
-
 .markdown-content {
   h1, h2, h3, h4, h5 {
     @extend .subtitle__large--greyish-brown;
@@ -99,9 +97,5 @@
   pre {
     background-color: #0d1117 !important;
     border-color: rgba(255, 255, 255, 0.1);
-
-    span {
-      color: #E6EDF3;
-    }
   }
 }
diff --git a/landing-pages/site/assets/scss/pygments/_dark.scss 
b/landing-pages/site/assets/scss/pygments/_dark.scss
index 8c42469020..19e52d7ae3 100644
--- a/landing-pages/site/assets/scss/pygments/_dark.scss
+++ b/landing-pages/site/assets/scss/pygments/_dark.scss
@@ -25,14 +25,17 @@
  * DO NOT EDIT THIS FILE MANUALLY - IT IS GENERATED
  *
  * To regenerate:
- *   cd sphinx_airflow_theme/demo
- *   uv run pygmentize -S github-dark -f html -a ".highlight" > 
../../landing-pages/site/assets/scss/pygments/_dark.scss
+ *   1. Generate the base styles:
+ *      cd sphinx_airflow_theme/demo
+ *      uv run pygmentize -S github-dark -f html -a ".highlight" > 
/tmp/dark.scss
+ *   2. Wrap the output in [data-bs-theme="dark"] selector and add to this file
  *
  * To list available themes: uv run pygmentize -L styles
  *
- * Generated: 2025-11-07
+ * Generated: 2025-12-17
  */
 
+[data-bs-theme="dark"] {
 pre { line-height: 125%; }
 td.linenos .normal { color: #6e7681; background-color: #0d1117; padding-left: 
5px; padding-right: 5px; }
 span.linenos { color: #6e7681; background-color: #0d1117; padding-left: 5px; 
padding-right: 5px; }
@@ -119,3 +122,4 @@ span.linenos.special { color: #e6edf3; background-color: 
#6e7681; padding-left:
 .highlight .vi { color: #79C0FF } /* Name.Variable.Instance */
 .highlight .vm { color: #79C0FF } /* Name.Variable.Magic */
 .highlight .il { color: #A5D6FF } /* Literal.Number.Integer.Long */
+}
diff --git a/landing-pages/site/assets/scss/pygments/_light.scss 
b/landing-pages/site/assets/scss/pygments/_light.scss
new file mode 100644
index 0000000000..7a8b42f33d
--- /dev/null
+++ b/landing-pages/site/assets/scss/pygments/_light.scss
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Generated using: pygmentize -S vs -f html -a '.highlight'
+
+/*
+ * Pygments Syntax Highlighting - Visual Studio (Light) Theme
+ *
+ * DO NOT EDIT THIS FILE MANUALLY - IT IS GENERATED
+ *
+ * To regenerate:
+ *   1. Generate the base styles:
+ *      cd sphinx_airflow_theme/demo
+ *      uv run pygmentize -S vs -f html -a ".highlight" > /tmp/light.scss
+ *   2. Wrap the output in [data-bs-theme="light"] selector and add to this 
file
+ *
+ * To list available themes: uv run pygmentize -L styles
+ *
+ * Generated: 2025-12-17
+ */
+
+[data-bs-theme="light"] {
+  pre { line-height: 125%; }
+  td.linenos .normal { color: inherit; background-color: transparent; 
padding-left: 5px; padding-right: 5px; }
+  span.linenos { color: inherit; background-color: transparent; padding-left: 
5px; padding-right: 5px; }
+  td.linenos .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; }
+  .highlight .hll { background-color: #ffffcc }
+  .highlight { background: #ffffff; }
+  .highlight .c { color: #008000 } /* Comment */
+  .highlight .err { border: 1px solid #F00 } /* Error */
+  .highlight .k { color: #00F } /* Keyword */
+  .highlight .ch { color: #008000 } /* Comment.Hashbang */
+  .highlight .cm { color: #008000 } /* Comment.Multiline */
+  .highlight .cp { color: #00F } /* Comment.Preproc */
+  .highlight .cpf { color: #008000 } /* Comment.PreprocFile */
+  .highlight .c1 { color: #008000 } /* Comment.Single */
+  .highlight .cs { color: #008000 } /* Comment.Special */
+  .highlight .ge { font-style: italic } /* Generic.Emph */
+  .highlight .ges { font-weight: bold; font-style: italic } /* 
Generic.EmphStrong */
+  .highlight .gh { font-weight: bold } /* Generic.Heading */
+  .highlight .gp { font-weight: bold } /* Generic.Prompt */
+  .highlight .gs { font-weight: bold } /* Generic.Strong */
+  .highlight .gu { font-weight: bold } /* Generic.Subheading */
+  .highlight .kc { color: #00F } /* Keyword.Constant */
+  .highlight .kd { color: #00F } /* Keyword.Declaration */
+  .highlight .kn { color: #00F } /* Keyword.Namespace */
+  .highlight .kp { color: #00F } /* Keyword.Pseudo */
+  .highlight .kr { color: #00F } /* Keyword.Reserved */
+  .highlight .kt { color: #2B91AF } /* Keyword.Type */
+  .highlight .s { color: #A31515 } /* Literal.String */
+  .highlight .nc { color: #2B91AF } /* Name.Class */
+  .highlight .ow { color: #00F } /* Operator.Word */
+  .highlight .sa { color: #A31515 } /* Literal.String.Affix */
+  .highlight .sb { color: #A31515 } /* Literal.String.Backtick */
+  .highlight .sc { color: #A31515 } /* Literal.String.Char */
+  .highlight .dl { color: #A31515 } /* Literal.String.Delimiter */
+  .highlight .sd { color: #A31515 } /* Literal.String.Doc */
+  .highlight .s2 { color: #A31515 } /* Literal.String.Double */
+  .highlight .se { color: #A31515 } /* Literal.String.Escape */
+  .highlight .sh { color: #A31515 } /* Literal.String.Heredoc */
+  .highlight .si { color: #A31515 } /* Literal.String.Interpol */
+  .highlight .sx { color: #A31515 } /* Literal.String.Other */
+  .highlight .sr { color: #A31515 } /* Literal.String.Regex */
+  .highlight .s1 { color: #A31515 } /* Literal.String.Single */
+  .highlight .ss { color: #A31515 } /* Literal.String.Symbol */
+}

Reply via email to