|
| 1 | +[wt-tooltip-content]:not([wt-tooltip-content=""]) { |
| 2 | + position: relative; |
| 3 | +} |
| 4 | + |
| 5 | +[wt-tooltip-content]:not([wt-tooltip-content=""])::after { |
| 6 | + content: attr(wt-tooltip-content); |
| 7 | + position: absolute; |
| 8 | + box-sizing: border-box; |
| 9 | + left: 50%; |
| 10 | + bottom: 100%; |
| 11 | + transform: translateX(-50%) scale(0); |
| 12 | + transform-origin: bottom center; |
| 13 | + z-index: 1070; |
| 14 | + margin: 0 0 10px; |
| 15 | + padding: 8px 11px; |
| 16 | + font-size: 14px; |
| 17 | + line-height: 1em; |
| 18 | + color: white; |
| 19 | + text-shadow: 0px 0px 3px rgba(0, 0, 0, 0.5); |
| 20 | + white-space: nowrap; |
| 21 | + pointer-events: none; |
| 22 | + background-color: rgba(64, 64, 64, 0.75); |
| 23 | + border-radius: 3px; |
| 24 | + opacity: 0; |
| 25 | + transition: all 0.08s ease; |
| 26 | +} |
| 27 | + |
| 28 | +[wt-tooltip-content]:not([wt-tooltip-content=""]):hover::after { |
| 29 | + transform: translateX(-50%) scale(1); |
| 30 | + opacity: 1; |
| 31 | +} |
| 32 | + |
| 33 | +[wt-tooltip-content]:not([wt-tooltip-content=""])::before { |
| 34 | + content: ""; |
| 35 | + box-sizing: border-box; |
| 36 | + width: 14px; |
| 37 | + height: 7px; |
| 38 | + position: absolute; |
| 39 | + top: -10px; |
| 40 | + left: 50%; |
| 41 | + transform: scale(0); |
| 42 | + transform-origin: top center; |
| 43 | + z-index: 1070; |
| 44 | + margin-left: -7px; |
| 45 | + border-top: 7px solid rgba(64, 64, 64, 0.75); |
| 46 | + border-left: 7px solid transparent; |
| 47 | + border-right: 7px solid transparent; |
| 48 | + opacity: 0; |
| 49 | + transition: all 0.08s ease; |
| 50 | +} |
| 51 | + |
| 52 | +[wt-tooltip-content]:not([wt-tooltip-content=""]):hover::before { |
| 53 | + transform: scale(1); |
| 54 | + opacity: 1; |
| 55 | +} |
| 56 | + |
| 57 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=bottom]::after { |
| 58 | + top: 100%; |
| 59 | + bottom: auto; |
| 60 | + margin: 10px 0 0; |
| 61 | + transform-origin: top center; |
| 62 | +} |
| 63 | + |
| 64 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=align-right]::after, |
| 65 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=align-left]::after { |
| 66 | + transform: scale(0); |
| 67 | + -webkit-backdrop-filter: blur(1px); |
| 68 | +} |
| 69 | + |
| 70 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=align-right]:hover::after, |
| 71 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=align-left]:hover::after { |
| 72 | + transform: scale(1); |
| 73 | +} |
| 74 | + |
| 75 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=align-right]::after { |
| 76 | + margin-left: -16px; |
| 77 | + transform-origin: left top; |
| 78 | +} |
| 79 | + |
| 80 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=align-left]::after { |
| 81 | + right: 50%; |
| 82 | + left: auto; |
| 83 | + margin-right: -16px; |
| 84 | + transform-origin: right top; |
| 85 | +} |
| 86 | + |
| 87 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=bottom]::before { |
| 88 | + bottom: -10px; |
| 89 | + top: auto; |
| 90 | + transform-origin: center bottom; |
| 91 | + border-bottom: 7px solid rgba(64, 64, 64, 0.75); |
| 92 | + border-top: none; |
| 93 | +} |
| 94 | + |
| 95 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=align-left][wt-tooltip-position~=bottom]::after { |
| 96 | + transform-origin: left top; |
| 97 | +} |
| 98 | + |
| 99 | +[wt-tooltip-content]:not([wt-tooltip-content=""])[wt-tooltip-position~=align-right][wt-tooltip-position~=bottom]::after { |
| 100 | + transform-origin: right top; |
| 101 | +} |
| 102 | + |
| 103 | +.svg-symbols { |
| 104 | + display: none; |
| 105 | +} |
| 106 | + |
| 107 | +body { |
| 108 | + margin: 0; |
| 109 | + font-family: lato, sans-serif; |
| 110 | + font-size: 16px; |
| 111 | + display: flex; |
| 112 | + justify-content: center; |
| 113 | + align-items: center; |
| 114 | + flex-wrap: wrap; |
| 115 | + height: 100vh; |
| 116 | + background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/436544/wyperfeld.jpg); |
| 117 | + background-size: cover; |
| 118 | + background-position: center top; |
| 119 | +} |
| 120 | + |
| 121 | +.example-element { |
| 122 | + height: 36px; |
| 123 | + width: 36px; |
| 124 | + margin: 6px; |
| 125 | + color: rgba(255, 255, 255, 0.5); |
| 126 | +} |
| 127 | + |
| 128 | +.example-element:hover { |
| 129 | + color: white; |
| 130 | +} |
| 131 | + |
| 132 | +.example-element svg { |
| 133 | + height: 100%; |
| 134 | + width: 100%; |
| 135 | + fill: currentColor; |
| 136 | +} |
0 commit comments