css: Adjust week number borders

We should generally avoid setting padding without subtracting with
the border width. On high contrast style, week numbers receive a
1px border width without subtracting it from the padding. This
causes a layout shift and makes the sidebar wider.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/624>
This commit is contained in:
Hari Rana
2025-08-18 20:00:19 -04:00
parent 534fb3a83c
commit 6252069d26
2 changed files with 9 additions and 2 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
datechooser .weeknum {
--border-width: 1px;
color: var(--window-fg-color);
background-color: rgb(from var(--window-fg-color) r g b / 5%);
border: 1px solid rgb(from currentColor r g b / 50%);
}
calendar-view.month-view {
+7 -1
View File
@@ -91,10 +91,16 @@ datechooser navigator button {
/* week numbers, with a style resembling GNOME Shell's */
datechooser .weeknum {
--padding: 4px;
--_border-width: var(--border-width, 0px);
--_padding: calc(var(--padding) - var(--_border-width));
font-size: smaller;
font-weight: bold;
margin: 6px;
padding: 4px;
padding: var(--_padding);
border: var(--_border-width) solid rgb(from currentColor r g b / 50%);
border-radius: 5px;
background-color: rgb(from var(--insensitive-fg-color) r g b / 10%);
color: var(--insensitive-fg-color);