This is an automated email from the ASF dual-hosted git repository.
potiuk 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 931da1dc0f Fix syntax highlighting contrast and namespace colors
(#1344) (#1421)
931da1dc0f is described below
commit 931da1dc0f8f6e407e6c3944e1d72b573addf6e7
Author: Siddhant_Ulekar <[email protected]>
AuthorDate: Sat Feb 21 13:34:30 2026 +0530
Fix syntax highlighting contrast and namespace colors (#1344) (#1421)
- Updated _highlights.scss to use theme-aware fallback color
- Removed redundant .nn color override in _dark.scss
- Adjusted pygments_style to prevent CSS conflicts
---
landing-pages/site/assets/scss/_highlights.scss | 47 ++-
landing-pages/site/assets/scss/pygments/_dark.scss | 387 ++++++++++++++++-----
2 files changed, 336 insertions(+), 98 deletions(-)
diff --git a/landing-pages/site/assets/scss/_highlights.scss
b/landing-pages/site/assets/scss/_highlights.scss
index 8351f3eb43..1407969144 100644
--- a/landing-pages/site/assets/scss/_highlights.scss
+++ b/landing-pages/site/assets/scss/_highlights.scss
@@ -48,21 +48,41 @@
background-color: #ffffcc;
}
- .lnt, .ln {
+ .lnt,
+ .ln {
margin-right: 0.4em;
padding: 0 0.4em 0 0.4em;
color: #7f7f7f;
}
- .k, .kc, .kd, .kn, .kp, .kr {
+ .k,
+ .kc,
+ .kd,
+ .kn,
+ .kp,
+ .kr {
color: #0000ff;
}
- .kt, .nc {
+ .kt,
+ .nc {
color: #2b91af;
}
- .s, .sa, .sb, .sc, .dl, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss {
+ .s,
+ .sa,
+ .sb,
+ .sc,
+ .dl,
+ .sd,
+ .s2,
+ .se,
+ .sh,
+ .si,
+ .sx,
+ .sr,
+ .s1,
+ .ss {
color: #a31515;
}
@@ -70,11 +90,16 @@
color: #0000ff;
}
- .c, .ch, .cm, .c1, .cs {
+ .c,
+ .ch,
+ .cm,
+ .c1,
+ .cs {
color: #008000;
}
- .cp, .cpf {
+ .cp,
+ .cpf {
color: #0000ff;
}
@@ -82,7 +107,10 @@
font-style: italic;
}
- .gh, .gp, .gs, .gu {
+ .gh,
+ .gp,
+ .gs,
+ .gu {
font-weight: bold;
}
}
@@ -95,7 +123,7 @@ pre {
width: 100%;
span {
- @extend .monotext--brownish-grey;
+ color: var(--bs-body-color);
}
}
@@ -108,7 +136,8 @@ pre {
background-color: #6e7681;
}
- .lnt, .ln {
+ .lnt,
+ .ln {
color: #6e7681;
}
}
diff --git a/landing-pages/site/assets/scss/pygments/_dark.scss
b/landing-pages/site/assets/scss/pygments/_dark.scss
index 08af580109..50a1d41dff 100644
--- a/landing-pages/site/assets/scss/pygments/_dark.scss
+++ b/landing-pages/site/assets/scss/pygments/_dark.scss
@@ -36,93 +36,302 @@
*/
[data-bs-theme="dark"] {
-// Scope Pygments to .rst-content only (don't override Chroma for blog
markdown)
-.rst-content {
-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; }
-td.linenos .special { color: #e6edf3; background-color: #6e7681; padding-left:
5px; padding-right: 5px; }
-span.linenos.special { color: #e6edf3; background-color: #6e7681;
padding-left: 5px; padding-right: 5px; }
-.highlight .hll { background-color: #6e7681 }
-.highlight { background: #0d1117; color: #E6EDF3 }
-.highlight .c { color: #8B949E; font-style: italic } /* Comment */
-.highlight .err { color: #F85149 } /* Error */
-.highlight .esc { color: #E6EDF3 } /* Escape */
-.highlight .g { color: #E6EDF3 } /* Generic */
-.highlight .k { color: #FF7B72 } /* Keyword */
-.highlight .l { color: #A5D6FF } /* Literal */
-.highlight .n { color: #E6EDF3 } /* Name */
-.highlight .o { color: #FF7B72; font-weight: bold } /* Operator */
-.highlight .x { color: #E6EDF3 } /* Other */
-.highlight .p { color: #E6EDF3 } /* Punctuation */
-.highlight .ch { color: #8B949E; font-style: italic } /* Comment.Hashbang */
-.highlight .cm { color: #8B949E; font-style: italic } /* Comment.Multiline */
-.highlight .cp { color: #8B949E; font-weight: bold; font-style: italic } /*
Comment.Preproc */
-.highlight .cpf { color: #8B949E; font-style: italic } /* Comment.PreprocFile
*/
-.highlight .c1 { color: #8B949E; font-style: italic } /* Comment.Single */
-.highlight .cs { color: #8B949E; font-weight: bold; font-style: italic } /*
Comment.Special */
-.highlight .gd { color: #FFA198; background-color: #490202 } /*
Generic.Deleted */
-.highlight .ge { color: #E6EDF3; font-style: italic } /* Generic.Emph */
-.highlight .ges { color: #E6EDF3; font-weight: bold; font-style: italic } /*
Generic.EmphStrong */
-.highlight .gr { color: #FFA198 } /* Generic.Error */
-.highlight .gh { color: #79C0FF; font-weight: bold } /* Generic.Heading */
-.highlight .gi { color: #56D364; background-color: #0F5323 } /*
Generic.Inserted */
-.highlight .go { color: #8B949E } /* Generic.Output */
-.highlight .gp { color: #8B949E } /* Generic.Prompt */
-.highlight .gs { color: #E6EDF3; font-weight: bold } /* Generic.Strong */
-.highlight .gu { color: #79C0FF } /* Generic.Subheading */
-.highlight .gt { color: #FF7B72 } /* Generic.Traceback */
-.highlight .g-Underline { color: #E6EDF3; text-decoration: underline } /*
Generic.Underline */
-.highlight .kc { color: #79C0FF } /* Keyword.Constant */
-.highlight .kd { color: #FF7B72 } /* Keyword.Declaration */
-.highlight .kn { color: #FF7B72 } /* Keyword.Namespace */
-.highlight .kp { color: #79C0FF } /* Keyword.Pseudo */
-.highlight .kr { color: #FF7B72 } /* Keyword.Reserved */
-.highlight .kt { color: #FF7B72 } /* Keyword.Type */
-.highlight .ld { color: #79C0FF } /* Literal.Date */
-.highlight .m { color: #A5D6FF } /* Literal.Number */
-.highlight .s { color: #A5D6FF } /* Literal.String */
-.highlight .na { color: #E6EDF3 } /* Name.Attribute */
-.highlight .nb { color: #E6EDF3 } /* Name.Builtin */
-.highlight .nc { color: #F0883E; font-weight: bold } /* Name.Class */
-.highlight .no { color: #79C0FF; font-weight: bold } /* Name.Constant */
-.highlight .nd { color: #D2A8FF; font-weight: bold } /* Name.Decorator */
-.highlight .ni { color: #FFA657 } /* Name.Entity */
-.highlight .ne { color: #F0883E; font-weight: bold } /* Name.Exception */
-.highlight .nf { color: #D2A8FF; font-weight: bold } /* Name.Function */
-.highlight .nl { color: #79C0FF; font-weight: bold } /* Name.Label */
-.highlight .nn { color: #FF7B72 } /* Name.Namespace */
-.highlight .nx { color: #E6EDF3 } /* Name.Other */
-.highlight .py { color: #79C0FF } /* Name.Property */
-.highlight .nt { color: #7EE787 } /* Name.Tag */
-.highlight .nv { color: #79C0FF } /* Name.Variable */
-.highlight .ow { color: #FF7B72; font-weight: bold } /* Operator.Word */
-.highlight .pm { color: #E6EDF3 } /* Punctuation.Marker */
-.highlight .w { color: #6E7681 } /* Text.Whitespace */
-.highlight .mb { color: #A5D6FF } /* Literal.Number.Bin */
-.highlight .mf { color: #A5D6FF } /* Literal.Number.Float */
-.highlight .mh { color: #A5D6FF } /* Literal.Number.Hex */
-.highlight .mi { color: #A5D6FF } /* Literal.Number.Integer */
-.highlight .mo { color: #A5D6FF } /* Literal.Number.Oct */
-.highlight .sa { color: #79C0FF } /* Literal.String.Affix */
-.highlight .sb { color: #A5D6FF } /* Literal.String.Backtick */
-.highlight .sc { color: #A5D6FF } /* Literal.String.Char */
-.highlight .dl { color: #79C0FF } /* Literal.String.Delimiter */
-.highlight .sd { color: #A5D6FF } /* Literal.String.Doc */
-.highlight .s2 { color: #A5D6FF } /* Literal.String.Double */
-.highlight .se { color: #79C0FF } /* Literal.String.Escape */
-.highlight .sh { color: #79C0FF } /* Literal.String.Heredoc */
-.highlight .si { color: #A5D6FF } /* Literal.String.Interpol */
-.highlight .sx { color: #A5D6FF } /* Literal.String.Other */
-.highlight .sr { color: #79C0FF } /* Literal.String.Regex */
-.highlight .s1 { color: #A5D6FF } /* Literal.String.Single */
-.highlight .ss { color: #A5D6FF } /* Literal.String.Symbol */
-.highlight .bp { color: #E6EDF3 } /* Name.Builtin.Pseudo */
-.highlight .fm { color: #D2A8FF; font-weight: bold } /* Name.Function.Magic */
-.highlight .vc { color: #79C0FF } /* Name.Variable.Class */
-.highlight .vg { color: #79C0FF } /* Name.Variable.Global */
-.highlight .vi { color: #79C0FF } /* Name.Variable.Instance */
-.highlight .vm { color: #79C0FF } /* Name.Variable.Magic */
-.highlight .il { color: #A5D6FF } /* Literal.Number.Integer.Long */
-}
+ // Scope Pygments to .rst-content only (don't override Chroma for blog
markdown)
+ .rst-content {
+ 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;
+ }
+ td.linenos .special {
+ color: #e6edf3;
+ background-color: #6e7681;
+ padding-left: 5px;
+ padding-right: 5px;
+ }
+ span.linenos.special {
+ color: #e6edf3;
+ background-color: #6e7681;
+ padding-left: 5px;
+ padding-right: 5px;
+ }
+ .highlight .hll {
+ background-color: #6e7681;
+ }
+ .highlight {
+ background: #0d1117;
+ color: #e6edf3;
+ }
+ .highlight .c {
+ color: #8b949e;
+ font-style: italic;
+ } /* Comment */
+ .highlight .err {
+ color: #f85149;
+ } /* Error */
+ .highlight .esc {
+ color: #e6edf3;
+ } /* Escape */
+ .highlight .g {
+ color: #e6edf3;
+ } /* Generic */
+ .highlight .k {
+ color: #ff7b72;
+ } /* Keyword */
+ .highlight .l {
+ color: #a5d6ff;
+ } /* Literal */
+ .highlight .n {
+ color: #e6edf3;
+ } /* Name */
+ .highlight .o {
+ color: #ff7b72;
+ font-weight: bold;
+ } /* Operator */
+ .highlight .x {
+ color: #e6edf3;
+ } /* Other */
+ .highlight .p {
+ color: #e6edf3;
+ } /* Punctuation */
+ .highlight .ch {
+ color: #8b949e;
+ font-style: italic;
+ } /* Comment.Hashbang */
+ .highlight .cm {
+ color: #8b949e;
+ font-style: italic;
+ } /* Comment.Multiline */
+ .highlight .cp {
+ color: #8b949e;
+ font-weight: bold;
+ font-style: italic;
+ } /* Comment.Preproc */
+ .highlight .cpf {
+ color: #8b949e;
+ font-style: italic;
+ } /* Comment.PreprocFile */
+ .highlight .c1 {
+ color: #8b949e;
+ font-style: italic;
+ } /* Comment.Single */
+ .highlight .cs {
+ color: #8b949e;
+ font-weight: bold;
+ font-style: italic;
+ } /* Comment.Special */
+ .highlight .gd {
+ color: #ffa198;
+ background-color: #490202;
+ } /* Generic.Deleted */
+ .highlight .ge {
+ color: #e6edf3;
+ font-style: italic;
+ } /* Generic.Emph */
+ .highlight .ges {
+ color: #e6edf3;
+ font-weight: bold;
+ font-style: italic;
+ } /* Generic.EmphStrong */
+ .highlight .gr {
+ color: #ffa198;
+ } /* Generic.Error */
+ .highlight .gh {
+ color: #79c0ff;
+ font-weight: bold;
+ } /* Generic.Heading */
+ .highlight .gi {
+ color: #56d364;
+ background-color: #0f5323;
+ } /* Generic.Inserted */
+ .highlight .go {
+ color: #8b949e;
+ } /* Generic.Output */
+ .highlight .gp {
+ color: #8b949e;
+ } /* Generic.Prompt */
+ .highlight .gs {
+ color: #e6edf3;
+ font-weight: bold;
+ } /* Generic.Strong */
+ .highlight .gu {
+ color: #79c0ff;
+ } /* Generic.Subheading */
+ .highlight .gt {
+ color: #ff7b72;
+ } /* Generic.Traceback */
+ .highlight .g-Underline {
+ color: #e6edf3;
+ text-decoration: underline;
+ } /* Generic.Underline */
+ .highlight .kc {
+ color: #79c0ff;
+ } /* Keyword.Constant */
+ .highlight .kd {
+ color: #ff7b72;
+ } /* Keyword.Declaration */
+ .highlight .kn {
+ color: #ff7b72;
+ } /* Keyword.Namespace */
+ .highlight .kp {
+ color: #79c0ff;
+ } /* Keyword.Pseudo */
+ .highlight .kr {
+ color: #ff7b72;
+ } /* Keyword.Reserved */
+ .highlight .kt {
+ color: #ff7b72;
+ } /* Keyword.Type */
+ .highlight .ld {
+ color: #79c0ff;
+ } /* Literal.Date */
+ .highlight .m {
+ color: #a5d6ff;
+ } /* Literal.Number */
+ .highlight .s {
+ color: #a5d6ff;
+ } /* Literal.String */
+ .highlight .na {
+ color: #e6edf3;
+ } /* Name.Attribute */
+ .highlight .nb {
+ color: #e6edf3;
+ } /* Name.Builtin */
+ .highlight .nc {
+ color: #f0883e;
+ font-weight: bold;
+ } /* Name.Class */
+ .highlight .no {
+ color: #79c0ff;
+ font-weight: bold;
+ } /* Name.Constant */
+ .highlight .nd {
+ color: #d2a8ff;
+ font-weight: bold;
+ } /* Name.Decorator */
+ .highlight .ni {
+ color: #ffa657;
+ } /* Name.Entity */
+ .highlight .ne {
+ color: #f0883e;
+ font-weight: bold;
+ } /* Name.Exception */
+ .highlight .nf {
+ color: #d2a8ff;
+ font-weight: bold;
+ } /* Name.Function */
+ .highlight .nl {
+ color: #79c0ff;
+ font-weight: bold;
+ } /* Name.Label */
+
+ .highlight .nx {
+ color: #e6edf3;
+ } /* Name.Other */
+ .highlight .py {
+ color: #79c0ff;
+ } /* Name.Property */
+ .highlight .nt {
+ color: #7ee787;
+ } /* Name.Tag */
+ .highlight .nv {
+ color: #79c0ff;
+ } /* Name.Variable */
+ .highlight .ow {
+ color: #ff7b72;
+ font-weight: bold;
+ } /* Operator.Word */
+ .highlight .pm {
+ color: #e6edf3;
+ } /* Punctuation.Marker */
+ .highlight .w {
+ color: #6e7681;
+ } /* Text.Whitespace */
+ .highlight .mb {
+ color: #a5d6ff;
+ } /* Literal.Number.Bin */
+ .highlight .mf {
+ color: #a5d6ff;
+ } /* Literal.Number.Float */
+ .highlight .mh {
+ color: #a5d6ff;
+ } /* Literal.Number.Hex */
+ .highlight .mi {
+ color: #a5d6ff;
+ } /* Literal.Number.Integer */
+ .highlight .mo {
+ color: #a5d6ff;
+ } /* Literal.Number.Oct */
+ .highlight .sa {
+ color: #79c0ff;
+ } /* Literal.String.Affix */
+ .highlight .sb {
+ color: #a5d6ff;
+ } /* Literal.String.Backtick */
+ .highlight .sc {
+ color: #a5d6ff;
+ } /* Literal.String.Char */
+ .highlight .dl {
+ color: #79c0ff;
+ } /* Literal.String.Delimiter */
+ .highlight .sd {
+ color: #a5d6ff;
+ } /* Literal.String.Doc */
+ .highlight .s2 {
+ color: #a5d6ff;
+ } /* Literal.String.Double */
+ .highlight .se {
+ color: #79c0ff;
+ } /* Literal.String.Escape */
+ .highlight .sh {
+ color: #79c0ff;
+ } /* Literal.String.Heredoc */
+ .highlight .si {
+ color: #a5d6ff;
+ } /* Literal.String.Interpol */
+ .highlight .sx {
+ color: #a5d6ff;
+ } /* Literal.String.Other */
+ .highlight .sr {
+ color: #79c0ff;
+ } /* Literal.String.Regex */
+ .highlight .s1 {
+ color: #a5d6ff;
+ } /* Literal.String.Single */
+ .highlight .ss {
+ color: #a5d6ff;
+ } /* Literal.String.Symbol */
+ .highlight .bp {
+ color: #e6edf3;
+ } /* Name.Builtin.Pseudo */
+ .highlight .fm {
+ color: #d2a8ff;
+ font-weight: bold;
+ } /* Name.Function.Magic */
+ .highlight .vc {
+ color: #79c0ff;
+ } /* Name.Variable.Class */
+ .highlight .vg {
+ color: #79c0ff;
+ } /* Name.Variable.Global */
+ .highlight .vi {
+ color: #79c0ff;
+ } /* Name.Variable.Instance */
+ .highlight .vm {
+ color: #79c0ff;
+ } /* Name.Variable.Magic */
+ .highlight .il {
+ color: #a5d6ff;
+ } /* Literal.Number.Integer.Long */
+ }
}