Skip to content

Conversation

@kaste
Copy link
Collaborator

@kaste kaste commented Jan 5, 2026

The position variation comes from a rounding error introduced deep down in .pager-nav-symbol:top 0.07em (which is 1.68 iirc px).
The line-height fix is not doing anything as we don't have a different font-size here. If we fix the 0.07em to 2px (or any other stable px value) we have a stable position, or a stable, easy way to align the icons vertically (which is difficult as we know because of their thin and loose bottom end). top: -15 instead of top -16 decreases the gap to the card so that the h2 on the left side and the pagination on the right side have the same gap, which is or is not desirable. However the light and smaller right size tends to fly quicker (looses the connection) than the bold and heavy h2. (That's why, in the old WS/layout, the right side was usually 1px nearer to the card than the left side. Slightly falling.)

After
image

.pager-nav-symbol {
display: inline-block;
position: relative;
top: -0.07em;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 0.07 -- I did this 🤟 -- is giving the headaches.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😵‍💫

@kaste kaste merged commit e096567 into gh-pages Jan 8, 2026
2 checks passed
@kaste kaste deleted the fixup branch January 8, 2026 01:33
@kaste
Copy link
Collaborator Author

kaste commented Jan 8, 2026

Why is it that these heading elements on the left and the pager nav or dates on the right are not on the same bottom line, basically by default? Why do we even have a top -16 or now top -15 here.

Example:

image

Here I have on the left 18px, on the right 19px gap to the first card. Why is that magically 1px wrong, instead of magically just on a line? I made all these in the first place and they were never right by doing ... nothing.

@braver
Copy link
Member

braver commented Jan 8, 2026

That is a very good question I have asked myself a couple of times already. I've just been going with pushing stuff around instead of sitting down and thinking about it.

Using flex box with alignment on the baseline should "just work"™️ . Instead, the elements are end-aligned, and then everything falls apart and needs to be adjusted with paddings and relative positioning. If I change .search-results-header to align-items: baseline; and then go and remove, paddings, offsets and other align properties on child elements, everything does fall into place naturally.

Of course, this is a relatively well designed font, but still the 28px bold characters might not sit exactly on the same line as the 14px characters. This is technically correct, baseline aligned:
Scherm­afbeelding 2026-01-08 om 20 58 32

.pager-header uses align-items center, instead of end, but that's equally problematic. If I do the same thing, set it to baseline and then remove paddings, margins and positioning from the child elements, again everything falls back in line easily (only the icons need to be adjusted slightly, but that's normal):

Scherm­afbeelding 2026-01-08 om 21 02 46

Long story short, align-items: baseline is your friend :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants