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.

styles: Fix flatpickr dark theme in automatic mode.

Anders Kaseorgf99cff07356f
diff --git a/postcss.config.js b/postcss.config.js
index 8e4ca666396..d880538efd1 100644
--- a/postcss.config.js
+++ b/postcss.config.js
@@ -11,7 +11,7 @@ module.exports = ({file}) => ({
// the flatpickr dark theme. We do this because flatpickr themes
// are not scoped. See https://github.com/flatpickr/flatpickr/issues/2168.
require("postcss-import")({
- plugins: [require("postcss-prefixwrap")("%dark-theme-block")],
+ plugins: [require("postcss-prefixwrap")("%dark-theme")],
}),
require("postcss-nested"),
require("postcss-extend-rule"),
diff --git a/static/styles/dark_theme.css b/static/styles/dark_theme.css
index 3fc4e3106ed..7a11e138c7d 100644
--- a/static/styles/dark_theme.css
+++ b/static/styles/dark_theme.css
@@ -1,11 +1,6 @@
@import url("flatpickr/dist/themes/dark.css");
-:root.dark-theme {
- /* the following block(s) are generated by the import statements.
- See postcss.config.js for details.
- */
- @extend %dark-theme-block;
-
+%dark-theme {
color-scheme: dark;
body {
@@ -1502,13 +1497,17 @@
}
@supports (-moz-appearance: none) {
- :root.dark-theme #settings_page select {
+ %dark-theme #settings_page select {
background-color: hsla(0, 0%, 0%, 0.2);
}
}
+:root.dark-theme {
+ @extend %dark-theme;
+}
+
@media (prefers-color-scheme: dark) {
:root.color-scheme-automatic {
- @extend :root.dark-theme;
+ @extend %dark-theme;
}
}