hint.css 1.45 KB
/*
 * Defines the basic styling for the tooltip.
 * Each tooltip is made of 2 parts:
 * 	1) body (:after)
 * 	2) arrow (:before)
 */

.hinted { position: relative; }

[data-hint] {
  position: absolute;
  display: inline-block;
  visibility: hidden;
  opacity: 0;
  z-index: 1000000;
  pointer-events: none;
  -webkit-transition-delay: 400ms;
  -moz-transition-delay: 400ms;
  transition-delay: 400ms;
  -webkit-transition: 0.3s ease;
  -moz-transition: 0.3s ease;
  transition: 0.3s ease;
  display: none;
  .default-font();
}

.hinted:hover [data-hint], .hinted:hover [data-hint]:after, .hinted:hover [data-hint]:before {
  visibility: visible;
  opacity: 1;
  display: inline-block;
}

[data-hint]:before {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  content: '';
  background: transparent;
  border: 6px solid transparent;
  z-index: 1000001;
}

[data-hint]:after {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  content: attr(data-hint);
  background: #383838;
  color: white;
  text-shadow: 0 -1px 0px black;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 12px;
  white-space: nowrap;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
}

/**
 * top tooltip
 */
.hint-top {
  left: 50%;
  top: 6px;
}

.hint-top:before {
  margin: 0 0 -6px -6px;
  border-top-color: #383838;
}

.hint-top:after {
  margin: 0 0 6px -18px;
}

.hint-top:before, .hint-top:after {
  bottom: 100%;
}

.hinted:hover .hint-top, .hinted:focus .hint-top {
  top: -2px;
}