Skip to content

[3.0] Theme split (wave 4, part 19) — point calendar.css at the design tokens - #9443

Merged
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/calendar-css-tokens
Aug 10, 2026
Merged

[3.0] Theme split (wave 4, part 19) — point calendar.css at the design tokens#9443
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/calendar-css-tokens

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Part of the #7933 split, wave 4.
Calendar area.

index.css was converted when the design tokens landed. calendar.css was left behind and
still carried 33 hard-coded colours, so restyling the calendar means editing a
stylesheet rather than a variable, and dark.css and the colour variants have nothing to
reach for.

Seven of them already had a token elsewhere in the theme, so those just point at it:

was now
#ddd (11 borders) var(--window-border-color)
#f0f4f7 (2 table backgrounds) var(--window-bg)

The rest get named tokens of their own, keeping the value they have now:

--calendar-th-bg:            #e7eaef;
--calendar-today-bg:         #fff;
--calendar-disabled-bg:      #eee;
--calendar-day-bg_hover:     rgba(97, 135, 166, 0.2);
--calendar-event-bg:         rgba(30, 245, 20, 0.1);
--calendar-event-bg_hover:   rgba(30, 245, 20, 0.2);
--calendar-holiday-bg:       rgba(23, 110, 245, 0.1);
--calendar-holiday-bg_hover: rgba(23, 110, 245, 0.2);
--calendar-birthday-bg:      rgba(102, 0, 255, 0.1);
--calendar-birthday-bg_hover: rgba(153, 51, 255, 0.2);
--calendar-link-color:       #999;
--calendar-link-color_hover: #555;
--calendar-title-link-color: #555;
--calendar-event-meta-color: #777;
Where this differs from the theme branch

It gives some of these different values — the header row follows the title bar instead of
being its own grey, today's cell takes the lightest primary tint, and holidays hang off
--primary-color-hue so a variant re-tints them. Those change how the calendar looks and
belong with that change, not with naming what is already there. The names match, so
re-pointing them later is a one-line edit each.

The event and birthday colours are the same colour in both, but written as hsla() there.
hsl(117, 92%, 52%) comes out as rgb(31, 245, 20), one off the rgb(30, 245, 20) in use,
so the literals stay for now.

Checked

The acceptance test for a token conversion is that nothing moves. Every rule in
calendar.css that sets a colour, a background or a border was applied to a probe element
and its computed values read, on both versions — 35 rules, 0 differences, including the
:hover and .calendar_today.events / .holidays / .birthdays rules that cannot be
sampled off the page directly. Computed styles on 18 elements of the month view are
identical too.

(The calendar needs #9405 to render at all on a stock install, so it was checked with that
merged in locally.)

calendar.rtl.css keeps its four white separator borders — there is no token that means
that, and the file is due to go when the calendar moves to logical properties.

Issues References (Fixes|Related|Closes)

Part of #7933

Co-Authored-By: live627 john@jbrock.us

index.css was converted when the tokens landed, but calendar.css was
left behind and still carried 33 hard-coded colours. Restyling the
calendar therefore meant editing a stylesheet rather than a variable, and
dark.css and the colour variants have nothing to reach for.

Seven of them already had a token elsewhere in the theme - the #ddd
borders and the #f0f4f7 table backgrounds are the window ones - so those
just point at it. The rest get named tokens of their own, keeping the
value they have now so that nothing changes on screen.

The theme branch gives some of these different values: the header row
follows the title bar rather than being its own grey, today's cell takes
the lightest primary tint, and holidays hang off the primary hue so a
variant re-tints them. Those are a change to how the calendar looks and
belong with that change, not with naming what is already there.

Every rule in calendar.css that sets a colour, a background or a border
was applied to a probe element and its computed values read, on both
versions: 35 rules, including the hover and calendar_today ones, all
identical.

calendar.rtl.css keeps its four white separator borders. There is no
token that means that, and the file is due to go when the calendar moves
to logical properties.

Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants