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: prevent background overflow on link hover #226

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

welpo
Copy link
Owner

@welpo welpo commented Dec 2, 2023

Summary

This PR addresses a UI bug where additional space was highlighted when hovering over a hyperlink that starts at a newline or crosses a newline boundary.

The issue was fixed by adding a max-width to the ::before pseudo-element for links. I'm not sure why this works, but it does.

Related issue

Fixes #225 and #184.

Changes

The max-width property has been added to the ::before pseudo-element for anchor tags to ensure proper rendering of the hover effect across Webkit and Chromium-based browsers.

Additionally, I simplified the CSS. But the bugfix is just the max-width.

With this change, on Chromium and WebKit browsers, multi-line links render as though the ::before element were absent.

Firefox rendering remains identical.

Accessibility

No changes.

Screenshots

Before:

before

After:

after

Type of change

  • Bug fix (fixes an issue without altering functionality)
  • New feature (adds non-breaking functionality)
  • Breaking change (alters existing functionality)
  • UI/UX improvement (enhances user interface without altering functionality)
  • Refactor (improves code quality without altering functionality)
  • Documentation update
  • Other (please describe below)

Checklist

  • I have verified the accessibility of my changes
  • I have tested all possible scenarios for this change
  • I have updated theme.toml with a sane default for the feature
  • I have made corresponding changes to the documentation:
    • Updated config.toml comments
    • Updated theme.toml comments
    • Updated "Mastering tabi" post in English
    • (Optional) Updated "Mastering tabi" post in Spanish
    • (Optional) Updated "Mastering tabi" post in Catalan

@welpo welpo added the bug Something isn't working label Dec 2, 2023
@welpo welpo merged commit 6b69cf7 into main Dec 2, 2023
1 check passed
@welpo welpo deleted the fix/hover-link-background-overflow branch December 2, 2023 18:54
Smtbook pushed a commit to Smtbook/zola-theme-tabi that referenced this pull request Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hrefs at the start of new lines highlight in incorrect places
1 participant