perf: new tooltip and fix background on/off hot reload

This commit is contained in:
David Ralph
2021-04-21 14:52:05 +01:00
parent 98d6ef115c
commit 9b43063935
12 changed files with 124 additions and 72 deletions

View File

@@ -0,0 +1,12 @@
import React from 'react';
import './tooltip.scss';
export default function Tooltip(props) {
return (
<div className='tooltip'>
{props.children}
<span className='tooltipTitle'>{props.title}</span>
</div>
);
}

View File

@@ -0,0 +1,28 @@
// todo: possibly add tooltip placement option
.tooltip {
position: relative;
display: inline-block;
.tooltipTitle {
width: 60px;
background-color: #000000;
color: #ffffff;
text-align: center;
font-size: 0.6rem;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
top: 100%;
left: 50%;
margin-left: -30px;
visibility: hidden;
opacity: 0;
transition: opacity 0.8s;
}
}
.tooltip:hover .tooltipTitle {
visibility: visible;
opacity: 1;
}