After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780328 - GtkCalendar: Style classes are not documented
GtkCalendar: Style classes are not documented
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkCalendar
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-03-20 20:19 UTC by Daniel Boles
Modified: 2018-05-02 18:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Boles 2017-03-20 20:19:58 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?
Comment 1 Daniel Boles 2017-03-20 20:20:29 UTC
,view is another
Comment 2 Daniel Boles 2017-03-20 20:43:14 UTC
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.
Comment 3 Daniel Boles 2017-03-20 22:35:34 UTC
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.
Comment 4 GNOME Infrastructure Team 2018-05-02 18:18:53 UTC
-- 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.