hint.css 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. /*! Hint.css - v2.7.0 - 2021-10-01
  2. * https://kushagra.dev/lab/hint/
  3. * Copyright (c) 2021 Kushagra Gour */
  4. /*-------------------------------------*\
  5. HINT.css - A CSS tooltip library
  6. \*-------------------------------------*/
  7. /**
  8. * HINT.css is a tooltip library made in pure CSS.
  9. *
  10. * Source: https://github.com/chinchang/hint.css
  11. * Demo: http://kushagragour.in/lab/hint/
  12. *
  13. */
  14. /**
  15. * source: hint-core.scss
  16. *
  17. * Defines the basic styling for the tooltip.
  18. * Each tooltip is made of 2 parts:
  19. * 1) body (:after)
  20. * 2) arrow (:before)
  21. *
  22. * Classes added:
  23. * 1) hint
  24. */
  25. [class*="hint--"] {
  26. position: relative;
  27. display: inline-block;
  28. /**
  29. * tooltip arrow
  30. */
  31. /**
  32. * tooltip body
  33. */ }
  34. [class*="hint--"]:before, [class*="hint--"]:after {
  35. position: absolute;
  36. -webkit-transform: translate3d(0, 0, 0);
  37. -moz-transform: translate3d(0, 0, 0);
  38. transform: translate3d(0, 0, 0);
  39. visibility: hidden;
  40. opacity: 0;
  41. z-index: 1000000;
  42. pointer-events: none;
  43. -webkit-transition: 0.3s ease;
  44. -moz-transition: 0.3s ease;
  45. transition: 0.3s ease;
  46. -webkit-transition-delay: 0ms;
  47. -moz-transition-delay: 0ms;
  48. transition-delay: 0ms; }
  49. [class*="hint--"]:hover:before, [class*="hint--"]:hover:after {
  50. visibility: visible;
  51. opacity: 1; }
  52. [class*="hint--"]:hover:before, [class*="hint--"]:hover:after {
  53. -webkit-transition-delay: 100ms;
  54. -moz-transition-delay: 100ms;
  55. transition-delay: 100ms; }
  56. [class*="hint--"]:before {
  57. content: '';
  58. position: absolute;
  59. background: transparent;
  60. border: 6px solid transparent;
  61. z-index: 1000001; }
  62. [class*="hint--"]:after {
  63. background: #383838;
  64. color: white;
  65. padding: 8px 10px;
  66. font-size: 12px;
  67. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  68. line-height: 12px;
  69. white-space: nowrap; }
  70. [class*="hint--"][aria-label]:after {
  71. content: attr(aria-label); }
  72. [class*="hint--"][data-hint]:after {
  73. content: attr(data-hint); }
  74. [aria-label='']:before, [aria-label='']:after,
  75. [data-hint='']:before,
  76. [data-hint='']:after {
  77. display: none !important; }
  78. /**
  79. * source: hint-position.scss
  80. *
  81. * Defines the positoning logic for the tooltips.
  82. *
  83. * Classes added:
  84. * 1) hint--top
  85. * 2) hint--bottom
  86. * 3) hint--left
  87. * 4) hint--right
  88. */
  89. /**
  90. * set default color for tooltip arrows
  91. */
  92. .hint--top-left:before {
  93. border-top-color: #383838; }
  94. .hint--top-right:before {
  95. border-top-color: #383838; }
  96. .hint--top:before {
  97. border-top-color: #383838; }
  98. .hint--bottom-left:before {
  99. border-bottom-color: #383838; }
  100. .hint--bottom-right:before {
  101. border-bottom-color: #383838; }
  102. .hint--bottom:before {
  103. border-bottom-color: #383838; }
  104. .hint--left:before {
  105. border-left-color: #383838; }
  106. .hint--right:before {
  107. border-right-color: #383838; }
  108. /**
  109. * top tooltip
  110. */
  111. .hint--top:before {
  112. margin-bottom: -11px; }
  113. .hint--top:before, .hint--top:after {
  114. bottom: 100%;
  115. left: 50%; }
  116. .hint--top:before {
  117. left: calc(50% - 6px); }
  118. .hint--top:after {
  119. -webkit-transform: translateX(-50%);
  120. -moz-transform: translateX(-50%);
  121. transform: translateX(-50%); }
  122. .hint--top:hover:before {
  123. -webkit-transform: translateY(-8px);
  124. -moz-transform: translateY(-8px);
  125. transform: translateY(-8px); }
  126. .hint--top:hover:after {
  127. -webkit-transform: translateX(-50%) translateY(-8px);
  128. -moz-transform: translateX(-50%) translateY(-8px);
  129. transform: translateX(-50%) translateY(-8px); }
  130. /**
  131. * bottom tooltip
  132. */
  133. .hint--bottom:before {
  134. margin-top: -11px; }
  135. .hint--bottom:before, .hint--bottom:after {
  136. top: 100%;
  137. left: 50%; }
  138. .hint--bottom:before {
  139. left: calc(50% - 6px); }
  140. .hint--bottom:after {
  141. -webkit-transform: translateX(-50%);
  142. -moz-transform: translateX(-50%);
  143. transform: translateX(-50%); }
  144. .hint--bottom:hover:before {
  145. -webkit-transform: translateY(8px);
  146. -moz-transform: translateY(8px);
  147. transform: translateY(8px); }
  148. .hint--bottom:hover:after {
  149. -webkit-transform: translateX(-50%) translateY(8px);
  150. -moz-transform: translateX(-50%) translateY(8px);
  151. transform: translateX(-50%) translateY(8px); }
  152. /**
  153. * right tooltip
  154. */
  155. .hint--right:before {
  156. margin-left: -11px;
  157. margin-bottom: -6px; }
  158. .hint--right:after {
  159. margin-bottom: -14px; }
  160. .hint--right:before, .hint--right:after {
  161. left: 100%;
  162. bottom: 50%; }
  163. .hint--right:hover:before {
  164. -webkit-transform: translateX(8px);
  165. -moz-transform: translateX(8px);
  166. transform: translateX(8px); }
  167. .hint--right:hover:after {
  168. -webkit-transform: translateX(8px);
  169. -moz-transform: translateX(8px);
  170. transform: translateX(8px); }
  171. /**
  172. * left tooltip
  173. */
  174. .hint--left:before {
  175. margin-right: -11px;
  176. margin-bottom: -6px; }
  177. .hint--left:after {
  178. margin-bottom: -14px; }
  179. .hint--left:before, .hint--left:after {
  180. right: 100%;
  181. bottom: 50%; }
  182. .hint--left:hover:before {
  183. -webkit-transform: translateX(-8px);
  184. -moz-transform: translateX(-8px);
  185. transform: translateX(-8px); }
  186. .hint--left:hover:after {
  187. -webkit-transform: translateX(-8px);
  188. -moz-transform: translateX(-8px);
  189. transform: translateX(-8px); }
  190. /**
  191. * top-left tooltip
  192. */
  193. .hint--top-left:before {
  194. margin-bottom: -11px; }
  195. .hint--top-left:before, .hint--top-left:after {
  196. bottom: 100%;
  197. left: 50%; }
  198. .hint--top-left:before {
  199. left: calc(50% - 6px); }
  200. .hint--top-left:after {
  201. -webkit-transform: translateX(-100%);
  202. -moz-transform: translateX(-100%);
  203. transform: translateX(-100%); }
  204. .hint--top-left:after {
  205. margin-left: 12px; }
  206. .hint--top-left:hover:before {
  207. -webkit-transform: translateY(-8px);
  208. -moz-transform: translateY(-8px);
  209. transform: translateY(-8px); }
  210. .hint--top-left:hover:after {
  211. -webkit-transform: translateX(-100%) translateY(-8px);
  212. -moz-transform: translateX(-100%) translateY(-8px);
  213. transform: translateX(-100%) translateY(-8px); }
  214. /**
  215. * top-right tooltip
  216. */
  217. .hint--top-right:before {
  218. margin-bottom: -11px; }
  219. .hint--top-right:before, .hint--top-right:after {
  220. bottom: 100%;
  221. left: 50%; }
  222. .hint--top-right:before {
  223. left: calc(50% - 6px); }
  224. .hint--top-right:after {
  225. -webkit-transform: translateX(0);
  226. -moz-transform: translateX(0);
  227. transform: translateX(0); }
  228. .hint--top-right:after {
  229. margin-left: -12px; }
  230. .hint--top-right:hover:before {
  231. -webkit-transform: translateY(-8px);
  232. -moz-transform: translateY(-8px);
  233. transform: translateY(-8px); }
  234. .hint--top-right:hover:after {
  235. -webkit-transform: translateY(-8px);
  236. -moz-transform: translateY(-8px);
  237. transform: translateY(-8px); }
  238. /**
  239. * bottom-left tooltip
  240. */
  241. .hint--bottom-left:before {
  242. margin-top: -11px; }
  243. .hint--bottom-left:before, .hint--bottom-left:after {
  244. top: 100%;
  245. left: 50%; }
  246. .hint--bottom-left:before {
  247. left: calc(50% - 6px); }
  248. .hint--bottom-left:after {
  249. -webkit-transform: translateX(-100%);
  250. -moz-transform: translateX(-100%);
  251. transform: translateX(-100%); }
  252. .hint--bottom-left:after {
  253. margin-left: 12px; }
  254. .hint--bottom-left:hover:before {
  255. -webkit-transform: translateY(8px);
  256. -moz-transform: translateY(8px);
  257. transform: translateY(8px); }
  258. .hint--bottom-left:hover:after {
  259. -webkit-transform: translateX(-100%) translateY(8px);
  260. -moz-transform: translateX(-100%) translateY(8px);
  261. transform: translateX(-100%) translateY(8px); }
  262. /**
  263. * bottom-right tooltip
  264. */
  265. .hint--bottom-right:before {
  266. margin-top: -11px; }
  267. .hint--bottom-right:before, .hint--bottom-right:after {
  268. top: 100%;
  269. left: 50%; }
  270. .hint--bottom-right:before {
  271. left: calc(50% - 6px); }
  272. .hint--bottom-right:after {
  273. -webkit-transform: translateX(0);
  274. -moz-transform: translateX(0);
  275. transform: translateX(0); }
  276. .hint--bottom-right:after {
  277. margin-left: -12px; }
  278. .hint--bottom-right:hover:before {
  279. -webkit-transform: translateY(8px);
  280. -moz-transform: translateY(8px);
  281. transform: translateY(8px); }
  282. .hint--bottom-right:hover:after {
  283. -webkit-transform: translateY(8px);
  284. -moz-transform: translateY(8px);
  285. transform: translateY(8px); }
  286. /**
  287. * source: hint-sizes.scss
  288. *
  289. * Defines width restricted tooltips that can span
  290. * across multiple lines.
  291. *
  292. * Classes added:
  293. * 1) hint--small
  294. * 2) hint--medium
  295. * 3) hint--large
  296. *
  297. */
  298. .hint--small:after,
  299. .hint--medium:after,
  300. .hint--large:after {
  301. white-space: normal;
  302. line-height: 1.4em;
  303. word-wrap: break-word; }
  304. .hint--small:after {
  305. width: 80px; }
  306. .hint--medium:after {
  307. width: 150px; }
  308. .hint--large:after {
  309. width: 300px; }
  310. /**
  311. * source: hint-theme.scss
  312. *
  313. * Defines basic theme for tooltips.
  314. *
  315. */
  316. [class*="hint--"] {
  317. /**
  318. * tooltip body
  319. */ }
  320. [class*="hint--"]:after {
  321. text-shadow: 0 -1px 0px black;
  322. box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3); }
  323. /**
  324. * source: hint-color-types.scss
  325. *
  326. * Contains tooltips of various types based on color differences.
  327. *
  328. * Classes added:
  329. * 1) hint--error
  330. * 2) hint--warning
  331. * 3) hint--info
  332. * 4) hint--success
  333. *
  334. */
  335. /**
  336. * Error
  337. */
  338. .hint--error:after {
  339. background-color: #b34e4d;
  340. text-shadow: 0 -1px 0px #592726; }
  341. .hint--error.hint--top-left:before {
  342. border-top-color: #b34e4d; }
  343. .hint--error.hint--top-right:before {
  344. border-top-color: #b34e4d; }
  345. .hint--error.hint--top:before {
  346. border-top-color: #b34e4d; }
  347. .hint--error.hint--bottom-left:before {
  348. border-bottom-color: #b34e4d; }
  349. .hint--error.hint--bottom-right:before {
  350. border-bottom-color: #b34e4d; }
  351. .hint--error.hint--bottom:before {
  352. border-bottom-color: #b34e4d; }
  353. .hint--error.hint--left:before {
  354. border-left-color: #b34e4d; }
  355. .hint--error.hint--right:before {
  356. border-right-color: #b34e4d; }
  357. /**
  358. * Warning
  359. */
  360. .hint--warning:after {
  361. background-color: #c09854;
  362. text-shadow: 0 -1px 0px #6c5328; }
  363. .hint--warning.hint--top-left:before {
  364. border-top-color: #c09854; }
  365. .hint--warning.hint--top-right:before {
  366. border-top-color: #c09854; }
  367. .hint--warning.hint--top:before {
  368. border-top-color: #c09854; }
  369. .hint--warning.hint--bottom-left:before {
  370. border-bottom-color: #c09854; }
  371. .hint--warning.hint--bottom-right:before {
  372. border-bottom-color: #c09854; }
  373. .hint--warning.hint--bottom:before {
  374. border-bottom-color: #c09854; }
  375. .hint--warning.hint--left:before {
  376. border-left-color: #c09854; }
  377. .hint--warning.hint--right:before {
  378. border-right-color: #c09854; }
  379. /**
  380. * Info
  381. */
  382. .hint--info:after {
  383. background-color: #3986ac;
  384. text-shadow: 0 -1px 0px #1a3c4d; }
  385. .hint--info.hint--top-left:before {
  386. border-top-color: #3986ac; }
  387. .hint--info.hint--top-right:before {
  388. border-top-color: #3986ac; }
  389. .hint--info.hint--top:before {
  390. border-top-color: #3986ac; }
  391. .hint--info.hint--bottom-left:before {
  392. border-bottom-color: #3986ac; }
  393. .hint--info.hint--bottom-right:before {
  394. border-bottom-color: #3986ac; }
  395. .hint--info.hint--bottom:before {
  396. border-bottom-color: #3986ac; }
  397. .hint--info.hint--left:before {
  398. border-left-color: #3986ac; }
  399. .hint--info.hint--right:before {
  400. border-right-color: #3986ac; }
  401. /**
  402. * Success
  403. */
  404. .hint--success:after {
  405. background-color: #458746;
  406. text-shadow: 0 -1px 0px #1a321a; }
  407. .hint--success.hint--top-left:before {
  408. border-top-color: #458746; }
  409. .hint--success.hint--top-right:before {
  410. border-top-color: #458746; }
  411. .hint--success.hint--top:before {
  412. border-top-color: #458746; }
  413. .hint--success.hint--bottom-left:before {
  414. border-bottom-color: #458746; }
  415. .hint--success.hint--bottom-right:before {
  416. border-bottom-color: #458746; }
  417. .hint--success.hint--bottom:before {
  418. border-bottom-color: #458746; }
  419. .hint--success.hint--left:before {
  420. border-left-color: #458746; }
  421. .hint--success.hint--right:before {
  422. border-right-color: #458746; }
  423. /**
  424. * source: hint-always.scss
  425. *
  426. * Defines a persisted tooltip which shows always.
  427. *
  428. * Classes added:
  429. * 1) hint--always
  430. *
  431. */
  432. .hint--always:after, .hint--always:before {
  433. opacity: 1;
  434. visibility: visible; }
  435. .hint--always.hint--top:before {
  436. -webkit-transform: translateY(-8px);
  437. -moz-transform: translateY(-8px);
  438. transform: translateY(-8px); }
  439. .hint--always.hint--top:after {
  440. -webkit-transform: translateX(-50%) translateY(-8px);
  441. -moz-transform: translateX(-50%) translateY(-8px);
  442. transform: translateX(-50%) translateY(-8px); }
  443. .hint--always.hint--top-left:before {
  444. -webkit-transform: translateY(-8px);
  445. -moz-transform: translateY(-8px);
  446. transform: translateY(-8px); }
  447. .hint--always.hint--top-left:after {
  448. -webkit-transform: translateX(-100%) translateY(-8px);
  449. -moz-transform: translateX(-100%) translateY(-8px);
  450. transform: translateX(-100%) translateY(-8px); }
  451. .hint--always.hint--top-right:before {
  452. -webkit-transform: translateY(-8px);
  453. -moz-transform: translateY(-8px);
  454. transform: translateY(-8px); }
  455. .hint--always.hint--top-right:after {
  456. -webkit-transform: translateY(-8px);
  457. -moz-transform: translateY(-8px);
  458. transform: translateY(-8px); }
  459. .hint--always.hint--bottom:before {
  460. -webkit-transform: translateY(8px);
  461. -moz-transform: translateY(8px);
  462. transform: translateY(8px); }
  463. .hint--always.hint--bottom:after {
  464. -webkit-transform: translateX(-50%) translateY(8px);
  465. -moz-transform: translateX(-50%) translateY(8px);
  466. transform: translateX(-50%) translateY(8px); }
  467. .hint--always.hint--bottom-left:before {
  468. -webkit-transform: translateY(8px);
  469. -moz-transform: translateY(8px);
  470. transform: translateY(8px); }
  471. .hint--always.hint--bottom-left:after {
  472. -webkit-transform: translateX(-100%) translateY(8px);
  473. -moz-transform: translateX(-100%) translateY(8px);
  474. transform: translateX(-100%) translateY(8px); }
  475. .hint--always.hint--bottom-right:before {
  476. -webkit-transform: translateY(8px);
  477. -moz-transform: translateY(8px);
  478. transform: translateY(8px); }
  479. .hint--always.hint--bottom-right:after {
  480. -webkit-transform: translateY(8px);
  481. -moz-transform: translateY(8px);
  482. transform: translateY(8px); }
  483. .hint--always.hint--left:before {
  484. -webkit-transform: translateX(-8px);
  485. -moz-transform: translateX(-8px);
  486. transform: translateX(-8px); }
  487. .hint--always.hint--left:after {
  488. -webkit-transform: translateX(-8px);
  489. -moz-transform: translateX(-8px);
  490. transform: translateX(-8px); }
  491. .hint--always.hint--right:before {
  492. -webkit-transform: translateX(8px);
  493. -moz-transform: translateX(8px);
  494. transform: translateX(8px); }
  495. .hint--always.hint--right:after {
  496. -webkit-transform: translateX(8px);
  497. -moz-transform: translateX(8px);
  498. transform: translateX(8px); }
  499. /**
  500. * source: hint-rounded.scss
  501. *
  502. * Defines rounded corner tooltips.
  503. *
  504. * Classes added:
  505. * 1) hint--rounded
  506. *
  507. */
  508. .hint--rounded:after {
  509. border-radius: 4px; }
  510. /**
  511. * source: hint-effects.scss
  512. *
  513. * Defines various transition effects for the tooltips.
  514. *
  515. * Classes added:
  516. * 1) hint--no-animate
  517. * 2) hint--bounce
  518. *
  519. */
  520. .hint--no-animate:before, .hint--no-animate:after {
  521. -webkit-transition-duration: 0ms;
  522. -moz-transition-duration: 0ms;
  523. transition-duration: 0ms; }
  524. .hint--bounce:before, .hint--bounce:after {
  525. -webkit-transition: opacity 0.3s ease, visibility 0.3s ease, -webkit-transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24);
  526. -moz-transition: opacity 0.3s ease, visibility 0.3s ease, -moz-transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24);
  527. transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24); }
  528. .hint--no-shadow:before, .hint--no-shadow:after {
  529. text-shadow: initial;
  530. box-shadow: initial; }
  531. .hint--no-arrow:before {
  532. display: none; }