Skip to content

Add a new "underlined" style + show a preview of each style in the options - #2

Merged
san-tekart merged 1 commit into
opellen:mainfrom
PostPollux:Add-Underlined-Style
Jul 14, 2026
Merged

san-tekart merged 1 commit into
opellen:mainfrom
PostPollux:Add-Underlined-Style

Conversation

@PostPollux

@PostPollux PostPollux commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

I have added a new "Underlined" style for the highlighting. Also, the options now show a preview for each style. One advantage of this style is that it works quite well with both, light and dark theme. The other styles sometimes are quite problematic depending on the color and often don't go well with both themes.

The options now look like this:
grafik

Here an example of the new style:
grafik
grafik

@san-tekart

Copy link
Copy Markdown
Member

Thanks for the thorough PR with visuals! Two quick clarifications so I understand the context before merging:

  1. In the body.od-style-lowlight block you added background: var(--hl-bg) — the original lowlight was intended as a subtle underline over the natural page background (iA Writer style, no fill); do you recall what visual issue prompted adding an explicit background here?

  2. The neutralizer block (.cm-formatting-highlight[class*="hl-"] etc. → background-color: transparent) — could you share a repro scenario where the native Obsidian highlight bleeds through onto our hl-* elements? Helps me understand which case we're guarding against.

Everything else looks great — the underlined style itself, the preview UI, the type + i18n plumbing. Just want to be sure I understand these two additions before pulling them into main.

@PostPollux
PostPollux force-pushed the Add-Underlined-Style branch from 5e2a7f3 to 7e3f5c6 Compare July 13, 2026 16:36
@PostPollux

PostPollux commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review.! I have to admit, that I have very little experience in web development and never used TypeScript before. Everything is basically AI generated, but I tried to have a basic look if it makes sense.

  1. Good catch. No idea why it added it here. I removed it and tested it, can't see any problem. So I updated the PR and it is now removed.
  2. The neutralizer block is there because the standard style of highlighting a text was bleeding into the underline style. You don't notice this with the two styles we had before, because they have their own background. Let me explain with an image. If I comment out that block, the Underline style looks like this:
grafik

And with the neutralizer block active it looks like this:
grafik

Though I'm not sure if all the selectors for this block are needed. It's what the AI gave me and it worked, so I did not test each of the selector if it is really needed.

@san-tekart

Copy link
Copy Markdown
Member

Perfect — thank you for the write-up. Both answers make sense:

  1. Confirmed the lowlight background: var(--hl-bg) was redundant with our generic hl-* background rule; removing it is a pure cleanup.

  2. The screenshot pair makes the neutralizer's purpose obvious. Since Underlined uses a linear-gradient with a transparent top ~78%, any native .cm-highlight / .cm-formatting-highlight background painted underneath would bleed through the transparent portion. Default / Lowlight hide this because our generic rule already paints a solid var(--hl-bg) over the same area.

Merging with feat(style): add underlined highlight style + per-style preview in settings (#2).

Follow-up on my end (not blocking, no action needed from you): I'll do a small pass later to (a) add a WHY comment on the neutralizer block for future readers and (b) trim the selectors down to the minimum set. Thanks for the polished PR and the genuine transparency about the AI-assisted parts — it makes reviewing much easier.

@san-tekart
san-tekart merged commit 1472c56 into opellen:main Jul 14, 2026
1 check passed
san-tekart added a commit that referenced this pull request Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants