Files
wekan/client/components/main/myCards.css
T
Lauri Ojansivu d03cd03007 Stop elements resizing with the browser window, this time inside clamp().
Reported on a board in mobile mode in desktop Firefox: widening the window made the
swimlanes, lists and cards taller; narrowing it shrank them again. The same complaint
as /sign-in and /sign-up, and the same cause - a size measured against the WINDOW
instead of being a size.

The earlier sweep converted 355 bare `vh`/`vw` values but explicitly ALLOWED
`min()`, `max()` and `clamp()`, on the grounds that they are caps. `clamp()` is not.
It is only a cap at its two ends; between them it tracks the viewport exactly like a
bare `vw`. So `font-size: clamp(18px, 2.5vw, 32px)` on a swimlane header, a list
header and a minicard is a font that grows with the window - and since those rows are
sized by their text, the rows grow with it. There were 75 of these across 17
stylesheets, 36 of them in the mobile-mode board rules.

All 75 are converted to the size they already rendered at on a phone - the lower bound
of each clamp. That is the value these rules were designed around (below ~800px the
clamp was pinned to it anyway), it is in line with the rest of the UI's fixed sizes,
and picking the upper bound instead would have made every phone bigger than it is
today.

Also converted, same behaviour by other spellings:

  * `.board-sidebar { width: clamp(320px, 30vw, 560px) }` -> a fixed 420px. Its own
    comment recorded 420px as the intended width; the clamp was added to stop a bare
    30vw doubling on wide screens, but it still resized in between.
  * `min-height: 3vh` on the mobile minicard -> 24px.
  * `min-height: 60vh` on a collapsed list -> 540px, which is exactly what the
    `height: 540px` on the very next line already says.
  * `min-height: 60vh` (settings body) -> 540px; `min-height: 14vh` (search popover)
    -> 126px.
  * `max-width: 13vw` on a minicard custom-field chip -> 160px.

tests/noViewportSpacing.test.cjs no longer allows clamp() or a viewport `min-*`, and
says why. What stays allowed is a full-viewport box (100vh/100vw), a `max-height` /
`max-width` cap, and `min(400px, 52vw)` - a shrink-only cap, flat at the px above the
crossover width and giving way only below it so a box fits a narrow screen. It never
grows with the window, so it is not this bug; `max(...)`, which does grow without
bound, is not allowed. Both argument orders are accepted.

tests/sidebarWidth.test.cjs required `clamp()` for the sidebar - that was the fix for
the doubling, and it is now the thing being removed. It asks for a fixed px width and
no viewport unit at all, which is a stronger form of what it was guarding.

Tests: 1321 passing.

Thanks to xet7 !
2026-07-25 22:08:38 +03:00

75 lines
1.5 KiB
CSS

.my-cards-board-wrapper {
border-radius: 0 0 7px 7px;
min-width: min(400px, 52vw);
margin-bottom: 23px;
margin-inline-end: auto;
margin-inline-start: auto;
border-width: 4px;
border-style: solid;
border-color: #a2a2a2;
}
.my-cards-board-title {
font-size: 1.2rem;
font-weight: bold;
padding: 6px 10px;
background-color: #808080;
color: #fff;
}
.my-cards-swimlane-title {
font-size: 1rem;
font-weight: bold;
padding: 6px 10px;
padding-bottom: 5px;
margin-top: 0;
margin-bottom: 6px;
text-align: center;
}
.swimlane-default-color {
background-color: #d3d3d3;
}
.my-cards-list-title {
font-weight: bold;
font-size: 1rem;
text-align: center;
margin-bottom: 8px;
}
.my-cards-list-wrapper {
margin: 12px 18px;
border-radius: 10px;
display: inline-grid;
min-width: min(250px, 32vw);
max-width: min(350px, 45vw);
}
.my-cards-card-wrapper {
margin-top: 0;
margin-bottom: 12px;
}
.my-cards-dueat-list-wrapper {
max-width: min(500px, 65vw);
margin-inline-end: auto;
margin-inline-start: auto;
}
.my-cards-board-table thead {
border-bottom: 3px solid #4d4d4d;
background-color: transparent;
}
.my-cards-board-table th,
.my-cards-board-table td {
border: 0;
}
.my-cards-board-table tr {
border-bottom: 2px solid #a2a2a2;
}
.my-cards-card-title-table {
font-weight: bold;
padding-inline-start: 2px;
max-width: 243px;
}
.my-cards-board-badge {
width: 36px;
height: 24px;
float: inline-start;
border-radius: 5px;
margin-inline-end: 5px;
}