Replace style-*.css with media queries

Libadwaita 1.9 deprecates using style-dark.css, style-hc-dark.css and
style-hc.css. This moves these styles into style.css and conditionally
loads them using media queries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/745>
This commit is contained in:
Jake Dane
2026-04-08 12:19:18 +00:00
parent 92b74849bf
commit b0321c369d
5 changed files with 20 additions and 20 deletions
-8
View File
@@ -1,8 +0,0 @@
/*
* Search
*/
searchbutton > popover listview > row:selected {
background-color: rgb(from var(--accent-bg-color) r g b / 20%);
}
View File
-9
View File
@@ -1,9 +0,0 @@
datechooser .weeknum {
--border-width: 1px;
--base-color: var(--window-fg-color);
}
calendar-view.month-view {
--raised-shade-color: var(--border-color);
--raised-shade-color-base: transparent;
}
+20
View File
@@ -142,6 +142,13 @@ datechooser .weeknum {
background-color: rgb(from var(--base-color) r g b / 5%);
color: var(--base-color);
}
/* high contrast */
@media (prefers-contrast: more) {
datechooser .weeknum {
--border-width: 1px;
--base-color: var(--window-fg-color);
}
}
/* day names */
datechooser .weekday {
@@ -377,6 +384,13 @@ calendar-view.month-view {
inset 0 -1px var(--raised-shade-color, var(--raised-shade-color-base)),
inset 0 -2px 4px var(--raised-shade-color-base);
}
/* high contrast */
@media (prefers-contrast: more) {
calendar-view.month-view {
--raised-shade-color: var(--border-color);
--raised-shade-color-base: transparent;
}
}
calendar-view.month-view > box.month-header {
padding-bottom: 6px;
@@ -443,6 +457,12 @@ searchbutton > popover > arrow {
searchbutton > popover listview > row:selected {
background-color: rgb(from var(--accent-bg-color) r g b / 11%);
}
/* dark mode */
@media (prefers-color-scheme: dark) {
searchbutton > popover listview > row:selected {
background-color: rgb(from var(--accent-bg-color) r g b / 20%);
}
}
/*
* Month selector
-3
View File
@@ -3,8 +3,5 @@
<gresource prefix="/org/gnome/calendar">
<file>events.css</file>
<file>style.css</file>
<file>style-dark.css</file>
<file>style-hc.css</file>
<file>style-hc-dark.css</file>
</gresource>
</gresources>