_microtip.scss 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. /* -------------------------------------------------------------------
  2. Microtip
  3. Modern, lightweight css-only tooltips
  4. Just 1kb minified and gzipped
  5. @author Ghosh
  6. @package Microtip
  7. ----------------------------------------------------------------------
  8. 1. Base Styles
  9. 2. Direction Modifiers
  10. 3. Position Modifiers
  11. --------------------------------------------------------------------*/
  12. /* ------------------------------------------------
  13. [1] Base Styles
  14. -------------------------------------------------*/
  15. .uppy-Root [aria-label][role~="tooltip"] {
  16. /* no important */
  17. position: relative;
  18. }
  19. .uppy-Root [aria-label][role~="tooltip"]::before,
  20. .uppy-Root [aria-label][role~="tooltip"]::after {
  21. /* no important */
  22. transform: translate3d(0, 0, 0);
  23. -webkit-backface-visibility: hidden;
  24. backface-visibility: hidden;
  25. will-change: transform;
  26. opacity: 0;
  27. pointer-events: none;
  28. transition: all var(--microtip-transition-duration, .18s) var(--microtip-transition-easing, ease-in-out) var(--microtip-transition-delay, 0s);
  29. position: absolute;
  30. box-sizing: border-box;
  31. z-index: 10;
  32. transform-origin: top;
  33. }
  34. .uppy-Root [aria-label][role~="tooltip"]::before {
  35. /* no important */
  36. background-size: 100% auto !important;
  37. content: "";
  38. }
  39. .uppy-Root [aria-label][role~="tooltip"]::after {
  40. /* no important */
  41. background: rgba(17, 17, 17, .9);
  42. border-radius: 4px;
  43. color: #ffffff;
  44. content: attr(aria-label);
  45. font-size: var(--microtip-font-size, 13px);
  46. font-weight: var(--microtip-font-weight, normal);
  47. text-transform: var(--microtip-text-transform, none);
  48. padding: .5em 1em;
  49. white-space: nowrap;
  50. box-sizing: content-box;
  51. }
  52. .uppy-Root [aria-label][role~="tooltip"]:hover::before,
  53. .uppy-Root [aria-label][role~="tooltip"]:hover::after,
  54. .uppy-Root [aria-label][role~="tooltip"]:focus::before,
  55. .uppy-Root [aria-label][role~="tooltip"]:focus::after {
  56. /* no important */
  57. opacity: 1;
  58. pointer-events: auto;
  59. }
  60. /* ------------------------------------------------
  61. [2] Position Modifiers
  62. -------------------------------------------------*/
  63. .uppy-Root [role~="tooltip"][data-microtip-position|="top"]::before {
  64. /* no important */
  65. background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
  66. height: 6px;
  67. width: 18px;
  68. margin-bottom: 5px;
  69. }
  70. .uppy-Root [role~="tooltip"][data-microtip-position|="top"]::after {
  71. /* no important */
  72. margin-bottom: 11px;
  73. }
  74. .uppy-Root [role~="tooltip"][data-microtip-position|="top"]::before {
  75. /* no important */
  76. transform: translate3d(-50%, 0, 0);
  77. bottom: 100%;
  78. left: 50%;
  79. }
  80. .uppy-Root [role~="tooltip"][data-microtip-position|="top"]:hover::before {
  81. /* no important */
  82. transform: translate3d(-50%, -5px, 0);
  83. }
  84. .uppy-Root [role~="tooltip"][data-microtip-position|="top"]::after {
  85. /* no important */
  86. transform: translate3d(-50%, 0, 0);
  87. bottom: 100%;
  88. left: 50%;
  89. }
  90. .uppy-Root [role~="tooltip"][data-microtip-position="top"]:hover::after {
  91. /* no important */
  92. transform: translate3d(-50%, -5px, 0);
  93. }
  94. /* ------------------------------------------------
  95. [2.1] Top Left
  96. -------------------------------------------------*/
  97. .uppy-Root [role~="tooltip"][data-microtip-position="top-left"]::after {
  98. /* no important */
  99. transform: translate3d(calc(-100% + 16px), 0, 0);
  100. bottom: 100%;
  101. }
  102. .uppy-Root [role~="tooltip"][data-microtip-position="top-left"]:hover::after {
  103. /* no important */
  104. transform: translate3d(calc(-100% + 16px), -5px, 0);
  105. }
  106. /* ------------------------------------------------
  107. [2.2] Top Right
  108. -------------------------------------------------*/
  109. .uppy-Root [role~="tooltip"][data-microtip-position="top-right"]::after {
  110. /* no important */
  111. transform: translate3d(calc(0% + -16px), 0, 0);
  112. bottom: 100%;
  113. }
  114. .uppy-Root [role~="tooltip"][data-microtip-position="top-right"]:hover::after {
  115. /* no important */
  116. transform: translate3d(calc(0% + -16px), -5px, 0);
  117. }
  118. /* ------------------------------------------------
  119. [2.3] Bottom
  120. -------------------------------------------------*/
  121. .uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]::before {
  122. /* no important */
  123. background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
  124. height: 6px;
  125. width: 18px;
  126. margin-top: 5px;
  127. margin-bottom: 0;
  128. }
  129. .uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]::after {
  130. /* no important */
  131. margin-top: 11px;
  132. }
  133. .uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]::before {
  134. /* no important */
  135. transform: translate3d(-50%, -10px, 0);
  136. bottom: auto;
  137. left: 50%;
  138. top: 100%;
  139. }
  140. .uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]:hover::before {
  141. /* no important */
  142. transform: translate3d(-50%, 0, 0);
  143. }
  144. .uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]::after {
  145. /* no important */
  146. transform: translate3d(-50%, -10px, 0);
  147. top: 100%;
  148. left: 50%;
  149. }
  150. .uppy-Root [role~="tooltip"][data-microtip-position="bottom"]:hover::after {
  151. /* no important */
  152. transform: translate3d(-50%, 0, 0);
  153. }
  154. /* ------------------------------------------------
  155. [2.4] Bottom Left
  156. -------------------------------------------------*/
  157. .uppy-Root [role~="tooltip"][data-microtip-position="bottom-left"]::after {
  158. /* no important */
  159. transform: translate3d(calc(-100% + 16px), -10px, 0);
  160. top: 100%;
  161. }
  162. .uppy-Root [role~="tooltip"][data-microtip-position="bottom-left"]:hover::after {
  163. /* no important */
  164. transform: translate3d(calc(-100% + 16px), 0, 0);
  165. }
  166. /* ------------------------------------------------
  167. [2.5] Bottom Right
  168. -------------------------------------------------*/
  169. .uppy-Root [role~="tooltip"][data-microtip-position="bottom-right"]::after {
  170. /* no important */
  171. transform: translate3d(calc(0% + -16px), -10px, 0);
  172. top: 100%;
  173. }
  174. .uppy-Root [role~="tooltip"][data-microtip-position="bottom-right"]:hover::after {
  175. /* no important */
  176. transform: translate3d(calc(0% + -16px), 0, 0);
  177. }
  178. /* ------------------------------------------------
  179. [2.6] Left
  180. -------------------------------------------------*/
  181. .uppy-Root [role~="tooltip"][data-microtip-position="left"]::before,
  182. .uppy-Root [role~="tooltip"][data-microtip-position="left"]::after {
  183. /* no important */
  184. bottom: auto;
  185. left: auto;
  186. right: 100%;
  187. top: 50%;
  188. transform: translate3d(10px, -50%, 0);
  189. }
  190. .uppy-Root [role~="tooltip"][data-microtip-position="left"]::before {
  191. /* no important */
  192. background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
  193. height: 18px;
  194. width: 6px;
  195. margin-right: 5px;
  196. margin-bottom: 0;
  197. }
  198. .uppy-Root [role~="tooltip"][data-microtip-position="left"]::after {
  199. /* no important */
  200. margin-right: 11px;
  201. }
  202. .uppy-Root [role~="tooltip"][data-microtip-position="left"]:hover::before,
  203. .uppy-Root [role~="tooltip"][data-microtip-position="left"]:hover::after {
  204. /* no important */
  205. transform: translate3d(0, -50%, 0);
  206. }
  207. /* ------------------------------------------------
  208. [2.7] Right
  209. -------------------------------------------------*/
  210. .uppy-Root [role~="tooltip"][data-microtip-position="right"]::before,
  211. .uppy-Root [role~="tooltip"][data-microtip-position="right"]::after {
  212. /* no important */
  213. bottom: auto;
  214. left: 100%;
  215. top: 50%;
  216. transform: translate3d(-10px, -50%, 0);
  217. }
  218. .uppy-Root [role~="tooltip"][data-microtip-position="right"]::before {
  219. /* no important */
  220. background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
  221. height: 18px;
  222. width: 6px;
  223. margin-bottom: 0;
  224. margin-left: 5px;
  225. }
  226. .uppy-Root [role~="tooltip"][data-microtip-position="right"]::after {
  227. /* no important */
  228. margin-left: 11px;
  229. }
  230. .uppy-Root [role~="tooltip"][data-microtip-position="right"]:hover::before,
  231. .uppy-Root [role~="tooltip"][data-microtip-position="right"]:hover::after {
  232. /* no important */
  233. transform: translate3d(0, -50%, 0);
  234. }
  235. /* ------------------------------------------------
  236. [3] Size
  237. -------------------------------------------------*/
  238. .uppy-Root [role~="tooltip"][data-microtip-size="small"]::after {
  239. /* no important */
  240. white-space: initial;
  241. width: 80px;
  242. }
  243. .uppy-Root [role~="tooltip"][data-microtip-size="medium"]::after {
  244. /* no important */
  245. white-space: initial;
  246. width: 150px;
  247. }
  248. .uppy-Root [role~="tooltip"][data-microtip-size="large"]::after {
  249. /* no important */
  250. white-space: initial;
  251. width: 260px;
  252. }