GNOME Bugzilla – Bug 780328
GtkCalendar: Style classes are not documented
Last modified: 2018-05-02 18:18:53 UTC
A bunch of style classes that get piled onto the single calendar node are queried to style various bits of the Cairo monstrosity: .day-name .day-number .week-number .header (containing year, month, and buttons) .highlight (background of day names and week numbers) .button (arrows) These are not documented. The setup is not ideal, and only a subset of properties are actually honoured, but it might be a good idea to mention them anyway?
,view is another
scattered and probably incomplete/incorrect notes: The padding of day names, day numbers, and week numbers can be controlled using CSS, by selecting on the classes .day-name, .day-number, and .week-number respectively. All dimensions of padding are honoured for .day-number, only vertical is applied for .day-name, and only horizontal is applied for .week-number. The class .highlight can also be used to style the combination of the day name and week number areas. The class .header styles the top area containing the year and month and their arrow buttons. Said arrows can be styled using .button. The :selected pseudoclass styles the currently selected date. All of these classes can be used to apply overridden background-color and foreground color properties. However, text properties such as font-style and font-weight can only be controlled on an overall level by selecting on the main calendar node.
extra notes from ochosi (thanks!) with slight tweaks The :inconsistent pseudoclass styles the out-of-range days/weeks. In-range dates just use the text/font properties of the overall calendar node. The above style classes also apply the border and box-shadow properties generally. Due to how those classes are used, padding on the calendar node can be used to alter the padding between the various internal components. Use this carefully, however, as it shifts the labels around and can result in strange shapes/sizes for the selected-date highlight.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/790.