Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(theme): hover color for code links inside custom containers #3467

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

skirtles-code
Copy link
Contributor

Custom containers set a different text color for <a> and <code> elements, depending on the type of container.

Currently the a:hover doesn't take account of a nested code tag. There's an existing selector for .vp-doc a:hover > code that sets color: var(--vp-code-link-hover-color), which is ultimately one of the brand colors.

Hovered code in a link ends up purple. This screenshot comes from the VitePress docs (the mouse cursor isn't shown):

Code link hover

In practice, this only currently impacts warning and danger containers, as the other containers use the main brand colors anyway. I've applied the same fix to all containers for consistency.

I've used a:hover > code in the selectors, as that's what's used elsewhere, though I'm unsure whether the > is really necessary. These selectors won't work with more complex markdown, such as [***`Example`***](foo), but I've tried to remain consistent with the existing selectors, which also don't handle this.

@brc-dd brc-dd merged commit d529ed4 into vuejs:main Jan 17, 2024
7 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants