Files
wekan/client/components/main/uiFont.css
T
Lauri Ojansivu b77a1663d8 Remove Member Settings / Font / Text background color.
A colour painted behind the text needs elements to sit on, and neither choice
of them looks good. On the boxes - which is what it did, from <body> - it
painted the whole window: the board canvas and the empty space under the lists,
which is a page background and not a text background. On the elements that
actually carry text it striped every heading, menu row and paragraph with a
full-width band. A setting nobody can make look good is worse than no setting.

The wheel and its Unset button are gone from the popup, nothing reads
profile.uiTextBgColor, and no stylesheet rule paints it. A profile that already
has a colour is cleaned rather than left dormant: setUiColors unsets the field
on every call, whatever it is passed - and it still accepts the argument, so an
older client cannot fail against a newer server. The schema key stays declared
for exactly one reason: a modifier touching a key SimpleSchema does not know is
rejected, which would leave those profiles the only ones that could not be
cleaned.

The text colour beside it stays.

Thanks to xet7 !
2026-08-14 18:20:31 +03:00

76 lines
4.0 KiB
CSS

/* Member Settings / Font (#4759): apply the user's chosen UI font. The class lives
* on <body> and the --wekan-ui-font variable is set by uiFont.js only for a
* validated, whitelisted font. Form controls are listed explicitly because their
* UA default font-family does not inherit. Icon fonts (Font Awesome etc.) set their
* own font-family on the element, so they are unaffected. */
body.has-ui-font,
body.has-ui-font button,
body.has-ui-font input,
body.has-ui-font textarea,
body.has-ui-font select,
body.has-ui-font .wekan-form-control {
font-family: var(--wekan-ui-font) !important;
}
/* Font size preset (#4759): scale the root font size. Elements using relative units
* (em/rem/%) scale with it; the variable is a percentage set by uiFont.js only for a
* known preset. 'default'/unset removes it.
*
* #6587: this is on <html>, and it used to be on <body>. `rem` is measured against
* the ROOT element, so a size on body never reached it — and a board's type is
* written in rem (px would not follow this setting at all, and vw would change with
* the window), which is why minicards were the part of the UI that ignored the
* preset. Everything relative to body still scales, because body inherits from the
* root; putting the size on BOTH would compound the two. */
html.has-ui-font-size {
font-size: var(--wekan-ui-font-size) !important;
}
/* ...and that percentage is only half of it, because it can only reach text
* whose size is written in a RELATIVE unit. WeKan writes most of its sizes in
* px, and px is absolute: no root percentage moves it. So the setting scaled the
* minicards and the page headings - the parts written in rem - and left the
* header bar, the left menu, the lists and every popup exactly as they were.
* `html, body, input, select, textarea, button` even re-stated 14px, so the body
* took the stock size straight back off the scaled root.
*
* Every px `font-size` and `line-height` in the client stylesheets is therefore
* written
*
* font-size: calc(14px * var(--wekan-ui-font-scale, 1));
*
* and uiFont.js publishes the preset as that number. The fallback is 1 and the
* variable is REMOVED for 'default', so an instance where nobody touched the
* setting computes exactly the sizes it always did. line-height is scaled with
* the size on purpose: 21px of type in an 18px line box is the same setting
* half-applied. tests/uiFonts.test.cjs fails on any bare px text size, so a new
* one cannot quietly opt out of the setting. */
/* Text color (#4759): the variable is a validated hex set by uiFont.js.
*
* EVERY element, not just <body> and the form controls. Colour is inherited, so
* setting it on the body reached only text that had no colour of its own - and
* WeKan gives most of its text a colour of its own: the header bar's buttons,
* the left menu's rows, a minicard's title, a list header. Choosing green
* recoloured the page heading and the menu and left the rest exactly as it was,
* which is the same "half a setting" the size preset had.
*
* `.fa` is left out because it is not text: those elements are Font Awesome
* GLYPHS, drawn with `color` because that is how an icon font works. The ones
* that are meant to follow their label already say `color: inherit` and so
* follow this anyway; the ones with a colour of their own - a red alert, a
* green tick - keep saying what they mean. */
body.has-ui-text-color,
body.has-ui-text-color *:not(.fa) {
color: var(--wekan-ui-text-color) !important;
}
/* There was a "text background color" here (#4759), a colour painted behind the
* text. It is REMOVED. A background needs elements to sit on, and neither choice
* of them looks right: on the boxes (its first form, `body`) it painted the whole
* window - the board canvas, the space under the lists - which is a page
* background and not a text one; on the elements that carry text it striped every
* heading, menu row and paragraph with a full-width band. A setting that cannot be
* made to look good is worse than no setting, so it is gone rather than tuned
* again. The text COLOUR above stays. */