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

Don't add cursor: pointer to vars when variable highlighting is inactive #4870

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

twiss
Copy link

@twiss twiss commented Jan 8, 2025

In exported documents, variable highlighting is inactive, and clicking on vars doesn't do anything. So, I think we shouldn't set cursor: pointer on them.

This seems to possibly have been a mistake and only intended for variables with a data type hover bubble, but even there, clicking on them doesn't do anything so setting cursor: pointer on them still doesn't particularly make sense, IMHO.

For non-exported documents when highlighting is active, src/styles/var.css.js will still set cursor: pointer, so this shouldn't break that case.

@sidvishnoi sidvishnoi self-requested a review January 8, 2025 17:01
@sidvishnoi
Copy link
Member

sidvishnoi commented Jan 10, 2025

Thanks for the PR @twiss.
I'm wondering if we should instead support var highlighting on generated docs: #3765.

Just to clear my understanding: With var highlighting on, I think we agree we should continue showing cursor: pointer. But if there's vars outside highlighting, even if they have data-type, I think there's no reason to show pointer?

@twiss
Copy link
Author

twiss commented Jan 12, 2025

I think #3765 would be a great addition, yeah, though I think it's in principle orthogonal from this change indeed in the sense that that change should be made in src/core/highlight-vars.js (by removing the removeOnSave, among other things), whereas this file could/should still be changed in the exact same way (although the effect will be less visible, it'll just remove a redundant CSS rule at that point).

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