Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

alert-word: Fix color contrast in dark mode.

faithlee4e9a256b25d8
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index 9f3231c7e09..98d35488dc0 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -1161,7 +1161,7 @@
--color-background-popover: light-dark(hsl(0deg 0% 100%), hsl(0deg 0% 17%));
--color-background-alert-word: light-dark(
hsl(18deg 100% 84%),
- hsl(22deg 70% 35%)
+ hsl(18deg 100% 75%)
);
--color-buddy-list-highlighted-user: var(
--color-background-hover-narrow-filter
@@ -1874,6 +1874,7 @@
transparent,
var(--color-markdown-pre-border)
);
+ --color-text-alert-word: light-dark(currentcolor, hsl(0deg 0% 0%));
--color-markdown-link: light-dark(
hsl(200deg 100% 40%),
var(--color-text-generic-link)
@@ -1884,6 +1885,14 @@
var(--color-text-generic-link-interactive)
);
--color-markdown-code-link-hover: var(--color-markdown-link-hover);
+ --color-markdown-link-alert-word: light-dark(
+ hsl(200deg 100% 40%),
+ hsl(210deg 100% 25%)
+ );
+ --color-markdown-link-alert-word-hover: light-dark(
+ hsl(200deg 100% 25%),
+ hsl(210deg 100% 18%)
+ );
--color-background-image-thumbnail: light-dark(
hsl(0deg 0% 0% / 3%),
hsl(0deg 0% 100% / 3%)
diff --git a/web/styles/rendered_markdown.css b/web/styles/rendered_markdown.css
index c8ce3e56efa..b1921d87e13 100644
--- a/web/styles/rendered_markdown.css
+++ b/web/styles/rendered_markdown.css
@@ -349,6 +349,7 @@
.alert-word {
background-color: var(--color-background-alert-word);
+ color: var(--color-text-alert-word);
}
/* Timestamps */
@@ -873,6 +874,26 @@
color: var(--color-markdown-code-link-hover);
}
}
+
+ /* Link styles that are also related to alert words */
+ &:has(.alert-word) {
+ &:hover,
+ &:focus {
+ text-decoration-color: var(
+ --color-markdown-link-alert-word-hover
+ );
+ }
+ }
+
+ & .alert-word {
+ color: var(--color-markdown-link-alert-word);
+ font-weight: 500;
+ }
+
+ &:hover .alert-word,
+ &:focus .alert-word {
+ color: var(--color-markdown-link-alert-word-hover);
+ }
}
& pre {