Skip to content

Commit

Permalink
fix: prevent linebreak on tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Sep 15, 2024
1 parent 10062d3 commit f50e102
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions packages/ui/src/components/Tooltip/Tooltip.module.css
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
.tooltip {
position: relative;
position: relative;
}

.tooltip:before {
content: attr(data-title);
padding: 0.2em 0.75em;
background-color: rgba(45, 55, 72, 0.95);
color: #fff;
border-radius: 0.28571429rem;
font-size: 0.833rem;
font-weight: 300;
position: absolute;
bottom: 100%;
margin-bottom: 0.75rem;
left: 50%;
transform: translateX(-50%) translateY(-25%);
transition: transform 250ms ease-in-out, opacity 250ms ease-in-out;
pointer-events: none;
opacity: 0;
z-index: 2;
content: attr(data-title);
padding: 0.2em 0.75em;
background-color: rgba(45, 55, 72, 0.95);
color: #fff;
border-radius: 0.28571429rem;
font-size: 0.833rem;
font-weight: 300;
position: absolute;
bottom: 100%;
margin-bottom: 0.75rem;
left: 50%;
transform: translateX(-50%) translateY(-25%);
transition: transform 250ms ease-in-out, opacity 250ms ease-in-out;
pointer-events: none;
opacity: 0;
z-index: 2;
white-space: nowrap;
}

.tooltip:hover:before {
transform: translateX(-50%) translateY(0);
opacity: 1;
transform: translateX(-50%) translateY(0);
opacity: 1;
}

0 comments on commit f50e102

Please sign in to comment.