mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Reported on /sign-in and /sign-up: making the window taller made every element
taller and every gap wider; making it shorter shrank them. That is what vh does -
`padding: 3vh 3vw`, `margin-top: 6vh`, `min-height: 4.5vh` - the box is a
percentage of the WINDOW, so the page reflows continuously as you drag the edge
and the same layout looks different on every screen.
It was not only those two pages. 355 such values across 24 stylesheets, on
padding, margin, gap, height, line-height, font-size, border-radius and
box-shadow. They are now the pixel sizes they rendered at on the window they were
tuned for (1vh -> 9px, 1vw -> 14px), so each page looks as it did at that size and
stays that size everywhere else.
Two of them were documented bugs already: minicard.css carries two comments
explaining that the global `.viewer { min-height: 2.5vh }` "reserves a big empty
band under a one-line title, so half of every minicard was white space" on tall
screens. That floor is 22px now, and the modal body's 20vh is 180px.
Viewport units are still right for three things and are kept: a full-viewport box
(100vh/100vw), a CAP that stops content overflowing a small screen (min(), max(),
clamp()), and max-/min-width limits. 274 such uses remain, all deliberate.
The conversion was a token substitution - it cannot move or delete a rule - and
brace balance was asserted unchanged for every file before writing it.
Tests: tests/noViewportSpacing.test.cjs scans every stylesheet under client/ and
fails on any size or spacing measured in vh/vw, while still permitting the three
legitimate shapes (it checks both directions). It blanks block comments first, so
the two minicard.css comments ABOUT this bug are not reported as uses of it. One
existing test pinned the literal `2.5vh` global floor; it now pins a px floor, and
the dependency it documents - that the minicard override compensates for a global
floor - is unchanged.
Thanks to xet7 !
29 lines
567 B
CSS
29 lines
567 B
CSS
.broken-cards-card-wrapper {
|
|
margin-top: 0;
|
|
margin-bottom: 12px;
|
|
border-width: 6px !important;
|
|
border-color: #808080 !important;
|
|
border-style: solid;
|
|
border-radius: 10px;
|
|
padding: 18px 28px;
|
|
background-color: #fff;
|
|
}
|
|
.broken-cards-wrapper {
|
|
max-width: min(500px, 65vw);
|
|
margin-inline-end: auto;
|
|
margin-inline-start: auto;
|
|
}
|
|
.broken-cards-card-title {
|
|
font-weight: bold;
|
|
}
|
|
.broken-cards-context {
|
|
display: inline-block;
|
|
}
|
|
.broken-cards-context-separator {
|
|
font-weight: bold;
|
|
}
|
|
.broken-cards-null {
|
|
color: #8b0000;
|
|
font-style: italic;
|
|
}
|