Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
markdown: Express Markdown code/pre colors as CSS vars.
Karl Stolleyf1a5fffae95d
diff --git a/web/styles/dark_theme.css b/web/styles/dark_theme.cssindex 60e3020a030..59559d284fc 100644--- a/web/styles/dark_theme.css+++ b/web/styles/dark_theme.css@@ -856,16 +856,6 @@background-color: hsl(22deg 70% 35%);}- .codehilite code,- .codehilite pre {- color: hsl(212deg 98% 82%);- background-color: hsl(212deg 0% 11%);- }-- .codehilite pre {- border: 1px solid hsl(0deg 0% 0% / 50%);- }-.codehilite .hll {background-color: hsl(0deg 0% 13%);}@@ -1246,7 +1236,6 @@}#feedback_container,- code,.typeahead.dropdown-menu {background-color: hsl(212deg 25% 15%);border-color: hsl(0deg 0% 0% / 50%);diff --git a/web/styles/rendered_markdown.css b/web/styles/rendered_markdown.cssindex e56e30dff30..31fcd1c19bd 100644--- a/web/styles/rendered_markdown.css+++ b/web/styles/rendered_markdown.css@@ -647,20 +647,20 @@}& a {- color: hsl(200deg 100% 40%);+ color: var(--color-markdown-link);text-decoration: none;& code {- color: hsl(200deg 100% 40%);+ color: var(--color-markdown-code-link);}&:hover,&:focus {- color: hsl(200deg 100% 25%);+ color: var(--color-markdown-link-hover);text-decoration: underline;& code {- color: hsl(200deg 100% 25%);+ color: var(--color-markdown-code-link-hover);}}}@@ -701,11 +701,11 @@font-size: 0.825em;unicode-bidi: embed;direction: ltr;- color: hsl(0deg 0% 0%);white-space: pre-wrap;padding: 0 4px;- background-color: hsl(0deg 0% 100%);- border: 1px solid hsl(240deg 13% 90%);+ color: var(--color-markdown-code-text);+ background-color: var(--color-markdown-code-background);+ border: 1px solid var(--color-markdown-code-border);border-radius: 3px;}@@ -801,6 +801,16 @@display: block !important;border: none !important;background: none !important;++ & code,+ & pre {+ color: var(--color-markdown-pre-text);+ background-color: var(--color-markdown-pre-background);+ }++ & pre {+ border: 1px solid var(--color-markdown-pre-border);+ }}/* Both the horizontal scrollbar in <pre/> as well asdiff --git a/web/styles/zulip.css b/web/styles/zulip.cssindex 07365e50048..a38b51b4c3d 100644--- a/web/styles/zulip.css+++ b/web/styles/zulip.css@@ -282,6 +282,18 @@ body {--color-text-personal-menu-some-status: hsl(0deg 0% 40%);--color-text-sidebar-heading: hsl(0deg 0% 43%);+ /* Markdown code colors */+ --color-markdown-code-text: hsl(0deg 0% 0%);+ --color-markdown-code-background: hsl(0deg 0% 100%);+ --color-markdown-code-border: hsl(240deg 13% 90%);+ --color-markdown-pre-text: hsl(0deg 0% 20%);+ --color-markdown-pre-background: hsl(0deg 0% 100%);+ --color-markdown-pre-border: hsl(0deg 0% 0% / 15%);+ --color-markdown-link: hsl(200deg 100% 40%);+ --color-markdown-link-hover: hsl(200deg 100% 25%);+ --color-markdown-code-link: var(--color-markdown-link);+ --color-markdown-code-link-hover: var(--color-markdown-link-hover);+/* Icon colors */--color-icon-bot: hsl(180deg 8% 65% / 100%);--color-message-action-visible: hsl(216deg 43% 20% / 50%);@@ -566,6 +578,16 @@ body {hsl(0deg 0% 11%));+ /* Markdown code colors */+ /* Note that Markdown code-link colors are identical+ to light theme, and so are not redeclared here. */+ --color-markdown-code-text: var(--color-text-message-default);+ --color-markdown-code-background: hsl(212deg 25% 15%);+ --color-markdown-code-border: hsl(0deg 0% 0% / 50%);+ --color-markdown-pre-text: hsl(212deg 98% 82%);+ --color-markdown-pre-background: hsl(212deg 0% 11%);+ --color-markdown-pre-border: hsl(0deg 0% 0% / 50%);+/* Icon colors */--color-icon-bot: hsl(180deg 5% 50% / 100%);--color-message-action-visible: hsl(217deg 41% 90% / 50%);