From 6252069d260a887985560379b8d388d5b509bf84 Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Mon, 18 Aug 2025 19:36:41 -0400 Subject: [PATCH] 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: --- src/theme/style-hc.css | 3 ++- src/theme/style.css | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/theme/style-hc.css b/src/theme/style-hc.css index 781a4f6f..30468c54 100644 --- a/src/theme/style-hc.css +++ b/src/theme/style-hc.css @@ -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 { diff --git a/src/theme/style.css b/src/theme/style.css index 2a972fd2..22c32a90 100644 --- a/src/theme/style.css +++ b/src/theme/style.css @@ -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);