crashmoney / obsidian-typewriter

Typewriter is an Obsidian theme designed for a focused writing experience.
GNU General Public License v3.0
91 stars 17 forks source link

[BUG] Unable to display bold #45

Closed froses closed 4 months ago

froses commented 4 months ago

Unable to display bold

If I mark a text as bold, the text is displayed as “normal” text.

To Reproduce

Steps to reproduce the behavior:

  1. Edit an Obsidian note in Live Preview mode.
  2. Mark some text as bold (i.e. This is a bold text) surounding it with **.
  3. The text is displayed as normal text instead of bold text.
  4. Change to reading mode: The issue persists.
  5. Reproduce steps 1-3 but using italic. The text is displayed as expected.

Information

Italic and monospaced works as expected.

Suggestions/Workarounds

DaHunch commented 4 months ago

yep - same - crossing fingers for an update soon!

crashmoney commented 4 months ago

Hi @froses and @DaHunch! I am unfortunately short on time at the moment, but hoping to resolve this rather high-priority bug ASAP. I also just noticed it yesterday all of a sudden – so not too sure what the issue could be yet.

Thanks for reporting!

laserbat commented 4 months ago

The issue is in this line. Simply removing this line fixes the issue.

This is because --font-normal should define normal font weight, not font size. In the inspector you can see how it's used by Obsidian:

  /* Font weights */
  --font-weight: var(--font-normal);
  --font-thin: 100;
  --font-extralight: 200;
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  --font-black: 900;

and then

b,
strong {
  font-weight: calc(var(--font-weight) + var(--bold-modifier));
  color: var(--bold-color);
}

Temporary workaround:

Create a css snippet with the following content:

body {
    --font-normal: 400;
}
froses commented 4 months ago

Hi, Olga,

It works for me.

Thanks a lot!

FRA

El 12 maig 2024, a les 11:14, Olga Ustiuzhanina @.***> va escriure:

The issue is in this line https://github.com/crashmoney/obsidian-typewriter/blob/e3979971c7f240332609d25b0b7ec3c2230a0844/theme.css#L298C1-L298C22. Simply removing this line fixes the issue.

This is because --font-normal should define normal font weight, not font size. In the inspector you can see how it's used by Obsidian:

/ Font weights / --font-weight: var(--font-normal); --font-thin: 100; --font-extralight: 200; --font-light: 300; --font-normal: 400; --font-medium: 500; --font-semibold: 600; --font-bold: 700; --font-extrabold: 800; --font-black: 900; and then

b, strong { font-weight: calc(var(--font-weight) + var(--bold-modifier)); color: var(--bold-color); } — Reply to this email directly, view it on GitHub https://github.com/crashmoney/obsidian-typewriter/issues/45#issuecomment-2106179211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6VTSOMVDDA75MO3OEI543ZB4XHFAVCNFSM6AAAAABHR2OHIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGE3TSMRRGE. You are receiving this because you were mentioned.

crashmoney commented 4 months ago

Hi @laserbat! Thanks for providing the fix. I've credited you accordingly in both the commit and release notes :) It looks like this recent update broke a few other themes I use too (notably iB Writer).

@froses and @DaHunch, I've committed this into main and released it. The theme should now work as intended once you update 👍🏻

DaHunch commented 4 months ago

Thanks @crashmoney - all working well again. p,.s. I so love the theme you've created - it's not an overstatement to say that to me IT IS OBSIDIAN - ie. I doubt I'd have anything close to the kind of productive relationship I have with my knowledge & projects without your theme. So thank you - it's a joy.

crashmoney commented 4 months ago

Wow @DaHunch – high praise! Thanks so much 😄