#1150

Bug: Theming of font-style, font-weight is broken due to invalid CSS

Openidea-listopened 1mo ago

Prerequisites

Describe the issue

Currently styling of font style/weight doesn't work because you incorrectly use light-dark() to resolve appropriate tokens for those values. For example, I was playing around with stylizing italic and bold text in Markdown diffs and I saw --diffs-token-light-font-style: italic and --diffs-token-light-font-weight: bold; were set correctly. However you seem to use light-dark() to resolve appropriate theme token but light-dark() only works on <color> values (see MDN). Therefore final calculation is invalid CSS, and it gets ignored.

Reproduction

Invalid CSS is already present in this repo: https://github.com/pierrecomputer/pierre/blob/diffs-v1.4.3/packages/diffs/src/style.css#L320-L331

What browser(s) are you seeing the problem on?

Chrome

What version of @pierre/diffs are you using?

1.4.3

Activity

3
amadeus1mo ago

Lmao, great catch. I'm now like not 100% sure whether i should fix these lines or delete them altogether lol. I'll probably fix them and see if people complain about them

amadeus25d ago

We have a new syntax highlighter project in progress. So i'm just going to go ahead and leave this issue open for now, as something to revisit after we get the new highlighter out... (it's possible it might also be fixed with that change too)

ije24d ago

fixed in #1141