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

Better Tooltips #897

Open
Linkaaaaa opened this issue Jun 12, 2024 · 1 comment
Open

Better Tooltips #897

Linkaaaaa opened this issue Jun 12, 2024 · 1 comment
Labels
discussion Open discussion on a subjet enhancement New feature or request

Comments

@Linkaaaaa
Copy link
Contributor

We currently use 2 types of tooltips, ideally we would use one that is the same for everything.
They should work similarly to the bootstrap one but they need to handle moving/disappearing elements for the combat replay section.

@Zerthox
Copy link
Contributor

Zerthox commented Jun 12, 2024

Quick CSS pseudo-element based tooltips for anything with a title attribute.

[title] {
    position: relative;
}
[title]::before, [title]::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    transition: .2s opacity;
    z-index: 100;
    pointer-events: none;
}
[title]:hover::before, [title]:hover::after {
    opacity: 1;
}
[title]::after {
    content: attr(title);
    top: 0;
    padding: 0.25rem 0.5rem;
    background-color: #000;
    border-radius: 0.25rem;
    color: #fff;
    text-align: center;
    transform: translate3d(-50%, -100%, 0);
}
[title]::before {
    content: "";
    top: 0;
    margin-left: -0.4rem;
    border-style: solid;
    border-width: 0.4rem 0.4rem 0;
    border-color: transparent;
    border-top-color: #000;
}

Problems:

  • We cant have overflow: hidden on the parent (we have that e.g. on player names)
  • Parent cant be an image (we have that e.g. for combat replay rotation)

@EliphasNUIT EliphasNUIT added enhancement New feature or request discussion Open discussion on a subjet labels Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Open discussion on a subjet enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants