Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tooltip.sass « partial « sass « assets - github.com/monkeyWzr/hugo-theme-cactus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1d35fafeb89310d378e30c8653a47437ee7133d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// ref: https://github.com/primer/primer/blob/master/modules/primer-tooltips/lib/tooltips.scss
.tooltipped
  position: relative
  
// This is the tooltip bubble
.tooltipped::after
  position: absolute
  z-index: 1000000
  display: none
  padding: .2em .5em
  -webkit-font-smoothing: subpixel-antialiased
  color: $color-background
  font-display: swap // @stylint ignore
  font-weight: 400
  font-size: $font-size * 0.8
  font-family: $font-family-body
  line-height: $line-height
  text-rendering: geometricPrecision
  text-align: center
  word-wrap: break-word
  white-space: pre
  content: attr(aria-label)
  background: $color-text
  border-radius: 3px
  opacity: 0
  
// This is the tooltip arrow
.tooltipped::before
  position: absolute
  z-index: 1000001
  display: none
  width: 0
  height: 0
  color: $color-text
  pointer-events: none
  content: ''
  border: 6px solid transparent
  opacity: 0
  
// delay animation for tooltip
@keyframes tooltip-appear
  from
    opacity: 0
  to
    opacity: 1
    
// This will indicate when we'll activate the tooltip
.tooltipped:hover,
.tooltipped:active,
.tooltipped:focus
  &::before,
  &::after
    display: inline-block
    text-decoration: none
    animation-name: tooltip-appear
    animation-duration: 0.1s
    animation-fill-mode: forwards
    animation-timing-function: ease-in
    
// Tooltipped south
.tooltipped-s,
.tooltipped-sw
  &::after
    top: 100%
    right: 50%
    margin-top: 6px
  &::before
    top: auto
    right: 50%
    bottom: -7px
    margin-right: -6px
    border-bottom-color: $color-text
.tooltipped-sw::after
  margin-right: -16px
  
// Move the tooltip body to the center of the object.
.tooltipped-s::after
  transform: translateX(50%)