go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.36k stars 5.43k forks source link

Bold text no longer displayed as bold #24835

Closed wolfbeast closed 1 year ago

wolfbeast commented 1 year ago

Description

With one of the recent updates of our self-hosted Gitea (probably when moving to 1.19.3 from 1.18.*) some formatting no longer applies. Most notably, headers and bold text is no longer rendered as such.

I checked the CSS involced and found:

b, strong, h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
}
b, strong {
    font-weight: bolder;
}

It seems the --font-weight-bold value is not filled properly or set to a bad value. This occurs in the Pale Moon web browser. It does not occur in Edge.

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

https://repo.palemoon.org/MoonchildProductions/UXP/issues/2252#issuecomment-36448 Image1

Git Version

2.39.2, Wire Protocol Version 2 Enabled

Operating System

CentOS

How are you running Gitea?

x86_64 Linux binary downloaded from gitea.io

Database

MySQL

wxiaoguang commented 1 year ago

I am 99.99% sure it's related to your browser & font system ....

Does #24305 help? (a test link https://codepen.io/silverwind/pen/jOeBmvj ) , ps: there is also a following PR #24827 to reset the bold value to 600 from 601.

wolfbeast commented 1 year ago

Yeah the test link gives inconsistent results. It weirdly renders 600 slightly bolder (semi-bold) but 601 and 610 as if it's not bold ... o.O -- not sure what's going on with Segoe UI there...

Image1

700 is proper bold. IIRC that is also the weight I'd always had to use when menually setting these values in my web design way back when. having it at 600 would work on my system, obviously (Windows 10 22H2, Radeon graphics). But.. why not just use the normal keywords instead of fine-tuning? font-weight: bold is a thing, you know :)

The linked issue doesn't really give a solution how to solve this in my installation though. I'd be happy to just set it to 600 or bold, respectively. How would I override this non-functional default?

wxiaoguang commented 1 year ago

But.. why not just use the normal keywords instead of fine-tuning? font-weight: bold is a thing, you know :)

The context is here : https://github.com/go-gitea/gitea/issues/24305#issuecomment-1520392895

wxiaoguang commented 1 year ago

The linked issue doesn't really give a solution how to solve this in my installation though. I'd be happy to just set it to 600 or bold, respectively. How would I override this non-functional default?

ps: there is also a following PR #24827 to reset the bold value to 600 from 601.

Here it is.

wolfbeast commented 1 year ago

Thanks, but... how do I apply that to my system? I'm a binary user -- I tend to use it stock (since I had nightmares previously using custom templates)

wxiaoguang commented 1 year ago

After the PR gets merged and backported, you can use nightly build.

For "custom template", if you only use something like custom/templates/custom/header.tmpl to inject JS/CSS, there won't be any nightmare, because this file will never conflict with the builtin ones.

image

wolfbeast commented 1 year ago

Thanks, I appreciate the help!

wolfbeast commented 1 year ago

FTR I went the custom template route (not comfortable running a nightly on a pivotal production repo):

<style>
:root {
  --font-weight-bold: 600;
}
</style>

Which fixes the issue on my setup. I'm thinking this may be a quirk of the Segoe font specifically? Either way, since it's already addressed in the PR otherwise I'll just close this.