diff --git a/hint.base.css b/hint.base.css index 07f44b9..48711b6 100644 --- a/hint.base.css +++ b/hint.base.css @@ -1,6 +1,6 @@ -/*! Hint.css (base version) - v2.7.0 - 2021-10-01 +/*! Hint.css (base version) - v3.0.0 - 2023-11-29 * https://kushagra.dev/lab/hint/ -* Copyright (c) 2021 Kushagra Gour */ +* Copyright (c) 2023 Kushagra Gour */ /*-------------------------------------*\ HINT.css - A CSS tooltip library @@ -23,60 +23,63 @@ * Classes added: * 1) hint */ -[class*="hint--"] { +[class*=hint--] { position: relative; display: inline-block; /** - * tooltip arrow - */ + * tooltip arrow + */ /** - * tooltip body - */ } - [class*="hint--"]:before, [class*="hint--"]:after { - position: absolute; - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - visibility: hidden; - opacity: 0; - z-index: 1000000; - pointer-events: none; - -webkit-transition: 0.3s ease; - -moz-transition: 0.3s ease; - transition: 0.3s ease; - -webkit-transition-delay: 0ms; - -moz-transition-delay: 0ms; - transition-delay: 0ms; } - [class*="hint--"]:hover:before, [class*="hint--"]:hover:after { - visibility: visible; - opacity: 1; } - [class*="hint--"]:hover:before, [class*="hint--"]:hover:after { - -webkit-transition-delay: 100ms; - -moz-transition-delay: 100ms; - transition-delay: 100ms; } - [class*="hint--"]:before { - content: ''; - position: absolute; - background: transparent; - border: 6px solid transparent; - z-index: 1000001; } - [class*="hint--"]:after { - background: #383838; - color: white; - padding: 8px 10px; - font-size: 12px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 12px; - white-space: nowrap; } - [class*="hint--"][aria-label]:after { - content: attr(aria-label); } - [class*="hint--"][data-hint]:after { - content: attr(data-hint); } - -[aria-label='']:before, [aria-label='']:after, -[data-hint='']:before, -[data-hint='']:after { - display: none !important; } + * tooltip body + */ +} +[class*=hint--]:before, [class*=hint--]:after { + position: absolute; + transform: translate3d(0, 0, 0); + visibility: hidden; + opacity: 0; + z-index: 1000000; + pointer-events: none; + transition: 0.3s ease; + transition-delay: 0ms; +} +[class*=hint--]:hover:before, [class*=hint--]:hover:after { + visibility: visible; + opacity: 1; +} +[class*=hint--]:hover:before, [class*=hint--]:hover:after { + transition-delay: 100ms; +} +[class*=hint--]:before { + content: ""; + position: absolute; + background: transparent; + border: 6px solid transparent; + background-color: hsl(0, 0%, 22%); + clip-path: polygon(0% 0%, 100% 0%, 100% 100%); + z-index: 1000001; +} +[class*=hint--]:after { + background: hsl(0, 0%, 22%); + color: white; + padding: 8px 10px; + font-size: 1rem; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + line-height: 1rem; + white-space: nowrap; +} +[class*=hint--][aria-label]:after { + content: attr(aria-label); +} +[class*=hint--][data-hint]:after { + content: attr(data-hint); +} + +[aria-label=""]:before, [aria-label=""]:after, +[data-hint=""]:before, +[data-hint=""]:after { + display: none !important; +} /** * source: hint-position.scss @@ -89,260 +92,229 @@ * 3) hint--left * 4) hint--right */ -/** - * set default color for tooltip arrows - */ -.hint--top-left:before { - border-top-color: #383838; } - -.hint--top-right:before { - border-top-color: #383838; } - -.hint--top:before { - border-top-color: #383838; } - -.hint--bottom-left:before { - border-bottom-color: #383838; } - -.hint--bottom-right:before { - border-bottom-color: #383838; } - -.hint--bottom:before { - border-bottom-color: #383838; } - -.hint--left:before { - border-left-color: #383838; } - -.hint--right:before { - border-right-color: #383838; } - /** * top tooltip */ +.hint--top { + --rotation: 135deg; +} .hint--top:before { - margin-bottom: -11px; } - + margin-bottom: -5.5px; + transform: rotate(var(--rotation)); +} .hint--top:before, .hint--top:after { bottom: 100%; - left: 50%; } - + left: 50%; +} .hint--top:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--top:after { - -webkit-transform: translateX(-50%); - -moz-transform: translateX(-50%); - transform: translateX(-50%); } - + transform: translateX(-50%); +} .hint--top:hover:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--top:hover:after { - -webkit-transform: translateX(-50%) translateY(-8px); - -moz-transform: translateX(-50%) translateY(-8px); - transform: translateX(-50%) translateY(-8px); } + transform: translateX(-50%) translateY(-8px); +} /** * bottom tooltip */ +.hint--bottom { + --rotation: -45deg; +} .hint--bottom:before { - margin-top: -11px; } - + margin-top: -5.5px; + transform: rotate(var(--rotation)); +} .hint--bottom:before, .hint--bottom:after { top: 100%; - left: 50%; } - + left: 50%; +} .hint--bottom:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--bottom:after { - -webkit-transform: translateX(-50%); - -moz-transform: translateX(-50%); - transform: translateX(-50%); } - + transform: translateX(-50%); +} .hint--bottom:hover:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--bottom:hover:after { - -webkit-transform: translateX(-50%) translateY(8px); - -moz-transform: translateX(-50%) translateY(8px); - transform: translateX(-50%) translateY(8px); } + transform: translateX(-50%) translateY(8px); +} /** * right tooltip */ +.hint--right { + --rotation: -135deg; +} .hint--right:before { - margin-left: -11px; - margin-bottom: -6px; } - + margin-left: -5.5px; + margin-bottom: -6px; + transform: rotate(var(--rotation)); +} .hint--right:after { - margin-bottom: -14px; } - + margin-bottom: calc(-1 * (1rem + 16px) / 2); +} .hint--right:before, .hint--right:after { left: 100%; - bottom: 50%; } - + bottom: 50%; +} .hint--right:hover:before { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } - + transform: translateX(8px) rotate(var(--rotation)); +} .hint--right:hover:after { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } + transform: translateX(8px); +} /** * left tooltip */ +.hint--left { + --rotation: 45deg; +} .hint--left:before { - margin-right: -11px; - margin-bottom: -6px; } - + margin-right: -5.5px; + margin-bottom: -6px; + transform: rotate(var(--rotation)); +} .hint--left:after { - margin-bottom: -14px; } - + margin-bottom: calc(-1 * (1rem + 16px) / 2); +} .hint--left:before, .hint--left:after { right: 100%; - bottom: 50%; } - + bottom: 50%; +} .hint--left:hover:before { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } - + transform: translateX(-8px) rotate(var(--rotation)); +} .hint--left:hover:after { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } + transform: translateX(-8px); +} /** * top-left tooltip */ +.hint--top-left { + --rotation: 135deg; +} .hint--top-left:before { - margin-bottom: -11px; } - + margin-bottom: -5.5px; + transform: rotate(var(--rotation)); +} .hint--top-left:before, .hint--top-left:after { bottom: 100%; - left: 50%; } - + left: 50%; +} .hint--top-left:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--top-left:after { - -webkit-transform: translateX(-100%); - -moz-transform: translateX(-100%); - transform: translateX(-100%); } - + transform: translateX(-100%); +} .hint--top-left:after { - margin-left: 12px; } - + margin-left: 12px; +} .hint--top-left:hover:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--top-left:hover:after { - -webkit-transform: translateX(-100%) translateY(-8px); - -moz-transform: translateX(-100%) translateY(-8px); - transform: translateX(-100%) translateY(-8px); } + transform: translateX(-100%) translateY(-8px); +} /** * top-right tooltip */ +.hint--top-right { + --rotation: 135deg; +} .hint--top-right:before { - margin-bottom: -11px; } - + margin-bottom: -5.5px; + transform: rotate(var(--rotation)); +} .hint--top-right:before, .hint--top-right:after { bottom: 100%; - left: 50%; } - + left: 50%; +} .hint--top-right:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--top-right:after { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - transform: translateX(0); } - + transform: translateX(0); +} .hint--top-right:after { - margin-left: -12px; } - + margin-left: -12px; +} .hint--top-right:hover:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--top-right:hover:after { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } + transform: translateY(-8px); +} /** * bottom-left tooltip */ +.hint--bottom-left { + --rotation: -45deg; +} .hint--bottom-left:before { - margin-top: -11px; } - + margin-top: -5.5px; + transform: rotate(var(--rotation)); +} .hint--bottom-left:before, .hint--bottom-left:after { top: 100%; - left: 50%; } - + left: 50%; +} .hint--bottom-left:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--bottom-left:after { - -webkit-transform: translateX(-100%); - -moz-transform: translateX(-100%); - transform: translateX(-100%); } - + transform: translateX(-100%); +} .hint--bottom-left:after { - margin-left: 12px; } - + margin-left: 12px; +} .hint--bottom-left:hover:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--bottom-left:hover:after { - -webkit-transform: translateX(-100%) translateY(8px); - -moz-transform: translateX(-100%) translateY(8px); - transform: translateX(-100%) translateY(8px); } + transform: translateX(-100%) translateY(8px); +} /** * bottom-right tooltip */ +.hint--bottom-right { + --rotation: -45deg; +} .hint--bottom-right:before { - margin-top: -11px; } - + margin-top: -5.5px; + transform: rotate(var(--rotation)); +} .hint--bottom-right:before, .hint--bottom-right:after { top: 100%; - left: 50%; } - + left: 50%; +} .hint--bottom-right:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--bottom-right:after { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - transform: translateX(0); } - + transform: translateX(0); +} .hint--bottom-right:after { - margin-left: -12px; } - + margin-left: -12px; +} .hint--bottom-right:hover:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--bottom-right:hover:after { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } + transform: translateY(8px); +} /** * source: hint-sizes.scss @@ -354,23 +326,34 @@ * 1) hint--small * 2) hint--medium * 3) hint--large + * 4) hint--fit * */ .hint--small:after, .hint--medium:after, -.hint--large:after { +.hint--large:after, +.hint--fit:after { + box-sizing: border-box; white-space: normal; line-height: 1.4em; - word-wrap: break-word; } + word-wrap: break-word; +} .hint--small:after { - width: 80px; } + width: 80px; +} .hint--medium:after { - width: 150px; } + width: 150px; +} .hint--large:after { - width: 300px; } + width: 300px; +} + +.hint--fit:after { + width: 100%; +} /** * source: hint-always.scss @@ -383,84 +366,53 @@ */ .hint--always:after, .hint--always:before { opacity: 1; - visibility: visible; } - + visibility: visible; +} .hint--always.hint--top:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--always.hint--top:after { - -webkit-transform: translateX(-50%) translateY(-8px); - -moz-transform: translateX(-50%) translateY(-8px); - transform: translateX(-50%) translateY(-8px); } - + transform: translateX(-50%) translateY(-8px); +} .hint--always.hint--top-left:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--always.hint--top-left:after { - -webkit-transform: translateX(-100%) translateY(-8px); - -moz-transform: translateX(-100%) translateY(-8px); - transform: translateX(-100%) translateY(-8px); } - + transform: translateX(-100%) translateY(-8px); +} .hint--always.hint--top-right:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--always.hint--top-right:after { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px); +} .hint--always.hint--bottom:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--always.hint--bottom:after { - -webkit-transform: translateX(-50%) translateY(8px); - -moz-transform: translateX(-50%) translateY(8px); - transform: translateX(-50%) translateY(8px); } - + transform: translateX(-50%) translateY(8px); +} .hint--always.hint--bottom-left:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--always.hint--bottom-left:after { - -webkit-transform: translateX(-100%) translateY(8px); - -moz-transform: translateX(-100%) translateY(8px); - transform: translateX(-100%) translateY(8px); } - + transform: translateX(-100%) translateY(8px); +} .hint--always.hint--bottom-right:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--always.hint--bottom-right:after { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px); +} .hint--always.hint--left:before { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } - + transform: translateX(-8px) rotate(var(--rotation)); +} .hint--always.hint--left:after { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } - + transform: translateX(-8px); +} .hint--always.hint--right:before { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } - + transform: translateX(8px) rotate(var(--rotation)); +} .hint--always.hint--right:after { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } + transform: translateX(8px); +} \ No newline at end of file diff --git a/hint.base.min.css b/hint.base.min.css index 9623874..4dcf996 100644 --- a/hint.base.min.css +++ b/hint.base.min.css @@ -1,5 +1,5 @@ -/*! Hint.css (base version) - v2.7.0 - 2021-10-01 +/*! Hint.css (base version) - v3.0.0 - 2023-11-29 * https://kushagra.dev/lab/hint/ -* Copyright (c) 2021 Kushagra Gour */ +* Copyright (c) 2023 Kushagra Gour */ -[class*=hint--]{position:relative;display:inline-block}[class*=hint--]:after,[class*=hint--]:before{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;-webkit-transition:.3s ease;-moz-transition:.3s ease;transition:.3s ease;-webkit-transition-delay:0s;-moz-transition-delay:0s;transition-delay:0s}[class*=hint--]:hover:after,[class*=hint--]:hover:before{visibility:visible;opacity:1;-webkit-transition-delay:.1s;-moz-transition-delay:.1s;transition-delay:.1s}[class*=hint--]:before{content:'';position:absolute;background:0 0;border:6px solid transparent;z-index:1000001}[class*=hint--]:after{background:#383838;color:#fff;padding:8px 10px;font-size:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:12px;white-space:nowrap}[class*=hint--][aria-label]:after{content:attr(aria-label)}[class*=hint--][data-hint]:after{content:attr(data-hint)}[aria-label='']:after,[aria-label='']:before,[data-hint='']:after,[data-hint='']:before{display:none!important}.hint--top-left:before,.hint--top-right:before,.hint--top:before{border-top-color:#383838}.hint--bottom-left:before,.hint--bottom-right:before,.hint--bottom:before{border-bottom-color:#383838}.hint--top:after,.hint--top:before{bottom:100%;left:50%}.hint--top:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--top:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top:hover:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--bottom:after,.hint--bottom:before{top:100%;left:50%}.hint--bottom:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--bottom:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom:hover:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--right:before{border-right-color:#383838;margin-left:-11px;margin-bottom:-6px}.hint--right:after{margin-bottom:-14px}.hint--right:after,.hint--right:before{left:100%;bottom:50%}.hint--right:hover:after,.hint--right:hover:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--left:before{border-left-color:#383838;margin-right:-11px;margin-bottom:-6px}.hint--left:after{margin-bottom:-14px}.hint--left:after,.hint--left:before{right:100%;bottom:50%}.hint--left:hover:after,.hint--left:hover:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--top-left:after,.hint--top-left:before{bottom:100%;left:50%}.hint--top-left:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--top-left:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top-left:hover:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--top-right:after,.hint--top-right:before{bottom:100%;left:50%}.hint--top-right:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--top-right:hover:after,.hint--top-right:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--bottom-left:after,.hint--bottom-left:before{top:100%;left:50%}.hint--bottom-left:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--bottom-left:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom-left:hover:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--bottom-right:after,.hint--bottom-right:before{top:100%;left:50%}.hint--bottom-right:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--bottom-right:hover:after,.hint--bottom-right:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--large:after,.hint--medium:after,.hint--small:after{white-space:normal;line-height:1.4em;word-wrap:break-word}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--always.hint--top-left:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top-left:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--always.hint--top-right:after,.hint--always.hint--top-right:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--bottom:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--always.hint--bottom-left:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom-left:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--always.hint--bottom-right:after,.hint--always.hint--bottom-right:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--left:after,.hint--always.hint--left:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--always.hint--right:after,.hint--always.hint--right:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)} \ No newline at end of file +[class*=hint--]{position:relative;display:inline-block}[class*=hint--]:after,[class*=hint--]:before{position:absolute;transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;transition:.3s ease;transition-delay:0s}[class*=hint--]:hover:after,[class*=hint--]:hover:before{visibility:visible;opacity:1;transition-delay:.1s}[class*=hint--]:before{content:"";position:absolute;background:#383838;border:6px solid transparent;clip-path:polygon(0 0,100% 0,100% 100%);z-index:1000001}[class*=hint--]:after{background:#383838;color:#fff;padding:8px 10px;font-size:1rem;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1rem;white-space:nowrap}[class*=hint--][aria-label]:after{content:attr(aria-label)}[class*=hint--][data-hint]:after{content:attr(data-hint)}[aria-label=""]:after,[aria-label=""]:before,[data-hint=""]:after,[data-hint=""]:before{display:none!important}.hint--top{--rotation:135deg}.hint--top:after,.hint--top:before{bottom:100%;left:50%}.hint--top:before{margin-bottom:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--top:after{transform:translateX(-50%)}.hint--top:hover:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--top:hover:after{transform:translateX(-50%) translateY(-8px)}.hint--bottom{--rotation:-45deg}.hint--bottom:after,.hint--bottom:before{top:100%;left:50%}.hint--bottom:before{margin-top:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--bottom:after{transform:translateX(-50%)}.hint--bottom:hover:before{transform:translateY(8px) rotate(var(--rotation))}.hint--bottom:hover:after{transform:translateX(-50%) translateY(8px)}.hint--right{--rotation:-135deg}.hint--right:before{margin-left:-5.5px;margin-bottom:-6px;transform:rotate(var(--rotation))}.hint--right:after{margin-bottom:calc(-1 * (1rem + 16px)/ 2)}.hint--right:after,.hint--right:before{left:100%;bottom:50%}.hint--right:hover:before{transform:translateX(8px) rotate(var(--rotation))}.hint--right:hover:after{transform:translateX(8px)}.hint--left{--rotation:45deg}.hint--left:before{margin-right:-5.5px;margin-bottom:-6px;transform:rotate(var(--rotation))}.hint--left:after{margin-bottom:calc(-1 * (1rem + 16px)/ 2)}.hint--left:after,.hint--left:before{right:100%;bottom:50%}.hint--left:hover:before{transform:translateX(-8px) rotate(var(--rotation))}.hint--left:hover:after{transform:translateX(-8px)}.hint--top-left{--rotation:135deg}.hint--top-left:after,.hint--top-left:before{bottom:100%;left:50%}.hint--top-left:before{margin-bottom:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--top-left:after{transform:translateX(-100%);margin-left:12px}.hint--top-left:hover:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--top-left:hover:after{transform:translateX(-100%) translateY(-8px)}.hint--top-right{--rotation:135deg}.hint--top-right:after,.hint--top-right:before{bottom:100%;left:50%}.hint--top-right:before{margin-bottom:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--top-right:after{transform:translateX(0);margin-left:-12px}.hint--top-right:hover:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--top-right:hover:after{transform:translateY(-8px)}.hint--bottom-left{--rotation:-45deg}.hint--bottom-left:after,.hint--bottom-left:before{top:100%;left:50%}.hint--bottom-left:before{margin-top:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--bottom-left:after{transform:translateX(-100%);margin-left:12px}.hint--bottom-left:hover:before{transform:translateY(8px) rotate(var(--rotation))}.hint--bottom-left:hover:after{transform:translateX(-100%) translateY(8px)}.hint--bottom-right{--rotation:-45deg}.hint--bottom-right:after,.hint--bottom-right:before{top:100%;left:50%}.hint--bottom-right:before{margin-top:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--bottom-right:after{transform:translateX(0);margin-left:-12px}.hint--bottom-right:hover:before{transform:translateY(8px) rotate(var(--rotation))}.hint--bottom-right:hover:after{transform:translateY(8px)}.hint--fit:after,.hint--large:after,.hint--medium:after,.hint--small:after{box-sizing:border-box;white-space:normal;line-height:1.4em;word-wrap:break-word}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}.hint--fit:after{width:100%}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--always.hint--top:after{transform:translateX(-50%) translateY(-8px)}.hint--always.hint--top-left:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--always.hint--top-left:after{transform:translateX(-100%) translateY(-8px)}.hint--always.hint--top-right:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--always.hint--top-right:after{transform:translateY(-8px)}.hint--always.hint--bottom:before{transform:translateY(8px) rotate(var(--rotation))}.hint--always.hint--bottom:after{transform:translateX(-50%) translateY(8px)}.hint--always.hint--bottom-left:before{transform:translateY(8px) rotate(var(--rotation))}.hint--always.hint--bottom-left:after{transform:translateX(-100%) translateY(8px)}.hint--always.hint--bottom-right:before{transform:translateY(8px) rotate(var(--rotation))}.hint--always.hint--bottom-right:after{transform:translateY(8px)}.hint--always.hint--left:before{transform:translateX(-8px) rotate(var(--rotation))}.hint--always.hint--left:after{transform:translateX(-8px)}.hint--always.hint--right:before{transform:translateX(8px) rotate(var(--rotation))}.hint--always.hint--right:after{transform:translateX(8px)} \ No newline at end of file diff --git a/hint.css b/hint.css index 83fece9..ecb646f 100644 --- a/hint.css +++ b/hint.css @@ -1,6 +1,6 @@ -/*! Hint.css - v2.7.0 - 2021-10-01 +/*! Hint.css - v3.0.0 - 2023-11-29 * https://kushagra.dev/lab/hint/ -* Copyright (c) 2021 Kushagra Gour */ +* Copyright (c) 2023 Kushagra Gour */ /*-------------------------------------*\ HINT.css - A CSS tooltip library @@ -23,60 +23,63 @@ * Classes added: * 1) hint */ -[class*="hint--"] { +[class*=hint--] { position: relative; display: inline-block; /** - * tooltip arrow - */ + * tooltip arrow + */ /** - * tooltip body - */ } - [class*="hint--"]:before, [class*="hint--"]:after { - position: absolute; - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - visibility: hidden; - opacity: 0; - z-index: 1000000; - pointer-events: none; - -webkit-transition: 0.3s ease; - -moz-transition: 0.3s ease; - transition: 0.3s ease; - -webkit-transition-delay: 0ms; - -moz-transition-delay: 0ms; - transition-delay: 0ms; } - [class*="hint--"]:hover:before, [class*="hint--"]:hover:after { - visibility: visible; - opacity: 1; } - [class*="hint--"]:hover:before, [class*="hint--"]:hover:after { - -webkit-transition-delay: 100ms; - -moz-transition-delay: 100ms; - transition-delay: 100ms; } - [class*="hint--"]:before { - content: ''; - position: absolute; - background: transparent; - border: 6px solid transparent; - z-index: 1000001; } - [class*="hint--"]:after { - background: #383838; - color: white; - padding: 8px 10px; - font-size: 12px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 12px; - white-space: nowrap; } - [class*="hint--"][aria-label]:after { - content: attr(aria-label); } - [class*="hint--"][data-hint]:after { - content: attr(data-hint); } - -[aria-label='']:before, [aria-label='']:after, -[data-hint='']:before, -[data-hint='']:after { - display: none !important; } + * tooltip body + */ +} +[class*=hint--]:before, [class*=hint--]:after { + position: absolute; + transform: translate3d(0, 0, 0); + visibility: hidden; + opacity: 0; + z-index: 1000000; + pointer-events: none; + transition: 0.3s ease; + transition-delay: 0ms; +} +[class*=hint--]:hover:before, [class*=hint--]:hover:after { + visibility: visible; + opacity: 1; +} +[class*=hint--]:hover:before, [class*=hint--]:hover:after { + transition-delay: 100ms; +} +[class*=hint--]:before { + content: ""; + position: absolute; + background: transparent; + border: 6px solid transparent; + background-color: hsl(0, 0%, 22%); + clip-path: polygon(0% 0%, 100% 0%, 100% 100%); + z-index: 1000001; +} +[class*=hint--]:after { + background: hsl(0, 0%, 22%); + color: white; + padding: 8px 10px; + font-size: 1rem; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + line-height: 1rem; + white-space: nowrap; +} +[class*=hint--][aria-label]:after { + content: attr(aria-label); +} +[class*=hint--][data-hint]:after { + content: attr(data-hint); +} + +[aria-label=""]:before, [aria-label=""]:after, +[data-hint=""]:before, +[data-hint=""]:after { + display: none !important; +} /** * source: hint-position.scss @@ -89,260 +92,229 @@ * 3) hint--left * 4) hint--right */ -/** - * set default color for tooltip arrows - */ -.hint--top-left:before { - border-top-color: #383838; } - -.hint--top-right:before { - border-top-color: #383838; } - -.hint--top:before { - border-top-color: #383838; } - -.hint--bottom-left:before { - border-bottom-color: #383838; } - -.hint--bottom-right:before { - border-bottom-color: #383838; } - -.hint--bottom:before { - border-bottom-color: #383838; } - -.hint--left:before { - border-left-color: #383838; } - -.hint--right:before { - border-right-color: #383838; } - /** * top tooltip */ +.hint--top { + --rotation: 135deg; +} .hint--top:before { - margin-bottom: -11px; } - + margin-bottom: -5.5px; + transform: rotate(var(--rotation)); +} .hint--top:before, .hint--top:after { bottom: 100%; - left: 50%; } - + left: 50%; +} .hint--top:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--top:after { - -webkit-transform: translateX(-50%); - -moz-transform: translateX(-50%); - transform: translateX(-50%); } - + transform: translateX(-50%); +} .hint--top:hover:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--top:hover:after { - -webkit-transform: translateX(-50%) translateY(-8px); - -moz-transform: translateX(-50%) translateY(-8px); - transform: translateX(-50%) translateY(-8px); } + transform: translateX(-50%) translateY(-8px); +} /** * bottom tooltip */ +.hint--bottom { + --rotation: -45deg; +} .hint--bottom:before { - margin-top: -11px; } - + margin-top: -5.5px; + transform: rotate(var(--rotation)); +} .hint--bottom:before, .hint--bottom:after { top: 100%; - left: 50%; } - + left: 50%; +} .hint--bottom:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--bottom:after { - -webkit-transform: translateX(-50%); - -moz-transform: translateX(-50%); - transform: translateX(-50%); } - + transform: translateX(-50%); +} .hint--bottom:hover:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--bottom:hover:after { - -webkit-transform: translateX(-50%) translateY(8px); - -moz-transform: translateX(-50%) translateY(8px); - transform: translateX(-50%) translateY(8px); } + transform: translateX(-50%) translateY(8px); +} /** * right tooltip */ +.hint--right { + --rotation: -135deg; +} .hint--right:before { - margin-left: -11px; - margin-bottom: -6px; } - + margin-left: -5.5px; + margin-bottom: -6px; + transform: rotate(var(--rotation)); +} .hint--right:after { - margin-bottom: -14px; } - + margin-bottom: calc(-1 * (1rem + 16px) / 2); +} .hint--right:before, .hint--right:after { left: 100%; - bottom: 50%; } - + bottom: 50%; +} .hint--right:hover:before { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } - + transform: translateX(8px) rotate(var(--rotation)); +} .hint--right:hover:after { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } + transform: translateX(8px); +} /** * left tooltip */ +.hint--left { + --rotation: 45deg; +} .hint--left:before { - margin-right: -11px; - margin-bottom: -6px; } - + margin-right: -5.5px; + margin-bottom: -6px; + transform: rotate(var(--rotation)); +} .hint--left:after { - margin-bottom: -14px; } - + margin-bottom: calc(-1 * (1rem + 16px) / 2); +} .hint--left:before, .hint--left:after { right: 100%; - bottom: 50%; } - + bottom: 50%; +} .hint--left:hover:before { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } - + transform: translateX(-8px) rotate(var(--rotation)); +} .hint--left:hover:after { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } + transform: translateX(-8px); +} /** * top-left tooltip */ +.hint--top-left { + --rotation: 135deg; +} .hint--top-left:before { - margin-bottom: -11px; } - + margin-bottom: -5.5px; + transform: rotate(var(--rotation)); +} .hint--top-left:before, .hint--top-left:after { bottom: 100%; - left: 50%; } - + left: 50%; +} .hint--top-left:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--top-left:after { - -webkit-transform: translateX(-100%); - -moz-transform: translateX(-100%); - transform: translateX(-100%); } - + transform: translateX(-100%); +} .hint--top-left:after { - margin-left: 12px; } - + margin-left: 12px; +} .hint--top-left:hover:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--top-left:hover:after { - -webkit-transform: translateX(-100%) translateY(-8px); - -moz-transform: translateX(-100%) translateY(-8px); - transform: translateX(-100%) translateY(-8px); } + transform: translateX(-100%) translateY(-8px); +} /** * top-right tooltip */ +.hint--top-right { + --rotation: 135deg; +} .hint--top-right:before { - margin-bottom: -11px; } - + margin-bottom: -5.5px; + transform: rotate(var(--rotation)); +} .hint--top-right:before, .hint--top-right:after { bottom: 100%; - left: 50%; } - + left: 50%; +} .hint--top-right:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--top-right:after { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - transform: translateX(0); } - + transform: translateX(0); +} .hint--top-right:after { - margin-left: -12px; } - + margin-left: -12px; +} .hint--top-right:hover:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--top-right:hover:after { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } + transform: translateY(-8px); +} /** * bottom-left tooltip */ +.hint--bottom-left { + --rotation: -45deg; +} .hint--bottom-left:before { - margin-top: -11px; } - + margin-top: -5.5px; + transform: rotate(var(--rotation)); +} .hint--bottom-left:before, .hint--bottom-left:after { top: 100%; - left: 50%; } - + left: 50%; +} .hint--bottom-left:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--bottom-left:after { - -webkit-transform: translateX(-100%); - -moz-transform: translateX(-100%); - transform: translateX(-100%); } - + transform: translateX(-100%); +} .hint--bottom-left:after { - margin-left: 12px; } - + margin-left: 12px; +} .hint--bottom-left:hover:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--bottom-left:hover:after { - -webkit-transform: translateX(-100%) translateY(8px); - -moz-transform: translateX(-100%) translateY(8px); - transform: translateX(-100%) translateY(8px); } + transform: translateX(-100%) translateY(8px); +} /** * bottom-right tooltip */ +.hint--bottom-right { + --rotation: -45deg; +} .hint--bottom-right:before { - margin-top: -11px; } - + margin-top: -5.5px; + transform: rotate(var(--rotation)); +} .hint--bottom-right:before, .hint--bottom-right:after { top: 100%; - left: 50%; } - + left: 50%; +} .hint--bottom-right:before { - left: calc(50% - 6px); } - + left: calc(50% - 6px); +} .hint--bottom-right:after { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - transform: translateX(0); } - + transform: translateX(0); +} .hint--bottom-right:after { - margin-left: -12px; } - + margin-left: -12px; +} .hint--bottom-right:hover:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--bottom-right:hover:after { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } + transform: translateY(8px); +} /** * source: hint-sizes.scss @@ -354,23 +326,34 @@ * 1) hint--small * 2) hint--medium * 3) hint--large + * 4) hint--fit * */ .hint--small:after, .hint--medium:after, -.hint--large:after { +.hint--large:after, +.hint--fit:after { + box-sizing: border-box; white-space: normal; line-height: 1.4em; - word-wrap: break-word; } + word-wrap: break-word; +} .hint--small:after { - width: 80px; } + width: 80px; +} .hint--medium:after { - width: 150px; } + width: 150px; +} .hint--large:after { - width: 300px; } + width: 300px; +} + +.hint--fit:after { + width: 100%; +} /** * source: hint-theme.scss @@ -378,13 +361,15 @@ * Defines basic theme for tooltips. * */ -[class*="hint--"] { +[class*=hint--] { /** - * tooltip body - */ } - [class*="hint--"]:after { - text-shadow: 0 -1px 0px black; - box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3); } + * tooltip body + */ +} +[class*=hint--]:after { + text-shadow: 0 1px 0px black; + box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3); +} /** * source: hint-color-types.scss @@ -402,125 +387,45 @@ * Error */ .hint--error:after { - background-color: #b34e4d; - text-shadow: 0 -1px 0px #592726; } - -.hint--error.hint--top-left:before { - border-top-color: #b34e4d; } - -.hint--error.hint--top-right:before { - border-top-color: #b34e4d; } - -.hint--error.hint--top:before { - border-top-color: #b34e4d; } - -.hint--error.hint--bottom-left:before { - border-bottom-color: #b34e4d; } - -.hint--error.hint--bottom-right:before { - border-bottom-color: #b34e4d; } - -.hint--error.hint--bottom:before { - border-bottom-color: #b34e4d; } - -.hint--error.hint--left:before { - border-left-color: #b34e4d; } - -.hint--error.hint--right:before { - border-right-color: #b34e4d; } + background-color: hsl(1, 40%, 50%); + text-shadow: 0 1px 0px #592726; +} +.hint--error:before { + background-color: hsl(1, 40%, 50%); +} /** * Warning */ .hint--warning:after { - background-color: #c09854; - text-shadow: 0 -1px 0px #6c5328; } - -.hint--warning.hint--top-left:before { - border-top-color: #c09854; } - -.hint--warning.hint--top-right:before { - border-top-color: #c09854; } - -.hint--warning.hint--top:before { - border-top-color: #c09854; } - -.hint--warning.hint--bottom-left:before { - border-bottom-color: #c09854; } - -.hint--warning.hint--bottom-right:before { - border-bottom-color: #c09854; } - -.hint--warning.hint--bottom:before { - border-bottom-color: #c09854; } - -.hint--warning.hint--left:before { - border-left-color: #c09854; } - -.hint--warning.hint--right:before { - border-right-color: #c09854; } + background-color: hsl(38, 46%, 54%); + text-shadow: 0 1px 0px #6c5328; +} +.hint--warning:before { + background-color: hsl(38, 46%, 54%); +} /** * Info */ .hint--info:after { - background-color: #3986ac; - text-shadow: 0 -1px 0px #1a3c4d; } - -.hint--info.hint--top-left:before { - border-top-color: #3986ac; } - -.hint--info.hint--top-right:before { - border-top-color: #3986ac; } - -.hint--info.hint--top:before { - border-top-color: #3986ac; } - -.hint--info.hint--bottom-left:before { - border-bottom-color: #3986ac; } - -.hint--info.hint--bottom-right:before { - border-bottom-color: #3986ac; } - -.hint--info.hint--bottom:before { - border-bottom-color: #3986ac; } - -.hint--info.hint--left:before { - border-left-color: #3986ac; } - -.hint--info.hint--right:before { - border-right-color: #3986ac; } + background-color: hsl(200, 50%, 45%); + text-shadow: 0 1px 0px #1a3c4d; +} +.hint--info:before { + background-color: hsl(200, 50%, 45%); +} /** * Success */ .hint--success:after { - background-color: #458746; - text-shadow: 0 -1px 0px #1a321a; } - -.hint--success.hint--top-left:before { - border-top-color: #458746; } - -.hint--success.hint--top-right:before { - border-top-color: #458746; } - -.hint--success.hint--top:before { - border-top-color: #458746; } - -.hint--success.hint--bottom-left:before { - border-bottom-color: #458746; } - -.hint--success.hint--bottom-right:before { - border-bottom-color: #458746; } - -.hint--success.hint--bottom:before { - border-bottom-color: #458746; } - -.hint--success.hint--left:before { - border-left-color: #458746; } - -.hint--success.hint--right:before { - border-right-color: #458746; } + background-color: hsl(121, 32%, 40%); + text-shadow: 0 1px 0px #1a321a; +} +.hint--success:before { + background-color: hsl(121, 32%, 40%); +} /** * source: hint-always.scss @@ -533,87 +438,56 @@ */ .hint--always:after, .hint--always:before { opacity: 1; - visibility: visible; } - + visibility: visible; +} .hint--always.hint--top:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--always.hint--top:after { - -webkit-transform: translateX(-50%) translateY(-8px); - -moz-transform: translateX(-50%) translateY(-8px); - transform: translateX(-50%) translateY(-8px); } - + transform: translateX(-50%) translateY(-8px); +} .hint--always.hint--top-left:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--always.hint--top-left:after { - -webkit-transform: translateX(-100%) translateY(-8px); - -moz-transform: translateX(-100%) translateY(-8px); - transform: translateX(-100%) translateY(-8px); } - + transform: translateX(-100%) translateY(-8px); +} .hint--always.hint--top-right:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px) rotate(var(--rotation)); +} .hint--always.hint--top-right:after { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - + transform: translateY(-8px); +} .hint--always.hint--bottom:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--always.hint--bottom:after { - -webkit-transform: translateX(-50%) translateY(8px); - -moz-transform: translateX(-50%) translateY(8px); - transform: translateX(-50%) translateY(8px); } - + transform: translateX(-50%) translateY(8px); +} .hint--always.hint--bottom-left:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--always.hint--bottom-left:after { - -webkit-transform: translateX(-100%) translateY(8px); - -moz-transform: translateX(-100%) translateY(8px); - transform: translateX(-100%) translateY(8px); } - + transform: translateX(-100%) translateY(8px); +} .hint--always.hint--bottom-right:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px) rotate(var(--rotation)); +} .hint--always.hint--bottom-right:after { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - + transform: translateY(8px); +} .hint--always.hint--left:before { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } - + transform: translateX(-8px) rotate(var(--rotation)); +} .hint--always.hint--left:after { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } - + transform: translateX(-8px); +} .hint--always.hint--right:before { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } - + transform: translateX(8px) rotate(var(--rotation)); +} .hint--always.hint--right:after { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } + transform: translateX(8px); +} /** * source: hint-rounded.scss @@ -624,8 +498,12 @@ * 1) hint--rounded * */ +.hint--rounded:before { + border-radius: 0 4px 0 0; +} .hint--rounded:after { - border-radius: 4px; } + border-radius: 4px; +} /** * source: hint-effects.scss @@ -638,18 +516,46 @@ * */ .hint--no-animate:before, .hint--no-animate:after { - -webkit-transition-duration: 0ms; - -moz-transition-duration: 0ms; - transition-duration: 0ms; } + transition-duration: 0ms; +} .hint--bounce:before, .hint--bounce:after { - -webkit-transition: opacity 0.3s ease, visibility 0.3s ease, -webkit-transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24); - -moz-transition: opacity 0.3s ease, visibility 0.3s ease, -moz-transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24); - transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24); } - + transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24); +} + +@supports (transition-timing-function: linear(0, 1)) { + .hint--bounce:before, .hint--bounce:after { + --spring-easing: linear( + 0, + 0.009, + 0.035 2.1%, + 0.141 4.4%, + 0.723 12.9%, + 0.938, + 1.077 20.4%, + 1.121, + 1.149 24.3%, + 1.159, + 1.163 27%, + 1.154, + 1.129 32.8%, + 1.051 39.6%, + 1.017 43.1%, + 0.991, + 0.977 51%, + 0.975 57.1%, + 0.997 69.8%, + 1.003 76.9%, + 1 + ); + transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.5s var(--spring-easing); + } +} .hint--no-shadow:before, .hint--no-shadow:after { text-shadow: initial; - box-shadow: initial; } + box-shadow: initial; +} .hint--no-arrow:before { - display: none; } + display: none; +} \ No newline at end of file diff --git a/hint.min.css b/hint.min.css index 6fafb55..77e62c4 100644 --- a/hint.min.css +++ b/hint.min.css @@ -1,5 +1,27 @@ -/*! Hint.css - v2.7.0 - 2021-10-01 +/*! Hint.css - v3.0.0 - 2023-11-29 * https://kushagra.dev/lab/hint/ -* Copyright (c) 2021 Kushagra Gour */ +* Copyright (c) 2023 Kushagra Gour */ -[class*=hint--]{position:relative;display:inline-block}[class*=hint--]:after,[class*=hint--]:before{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;-webkit-transition:.3s ease;-moz-transition:.3s ease;transition:.3s ease;-webkit-transition-delay:0s;-moz-transition-delay:0s;transition-delay:0s}[class*=hint--]:hover:after,[class*=hint--]:hover:before{visibility:visible;opacity:1;-webkit-transition-delay:.1s;-moz-transition-delay:.1s;transition-delay:.1s}[class*=hint--]:before{content:'';position:absolute;background:0 0;border:6px solid transparent;z-index:1000001}[class*=hint--]:after{background:#383838;color:#fff;padding:8px 10px;font-size:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:12px;white-space:nowrap;text-shadow:0 -1px 0 #000;box-shadow:4px 4px 8px rgba(0,0,0,.3)}[class*=hint--][aria-label]:after{content:attr(aria-label)}[class*=hint--][data-hint]:after{content:attr(data-hint)}[aria-label='']:after,[aria-label='']:before,[data-hint='']:after,[data-hint='']:before{display:none!important}.hint--top-left:before,.hint--top-right:before,.hint--top:before{border-top-color:#383838}.hint--bottom-left:before,.hint--bottom-right:before,.hint--bottom:before{border-bottom-color:#383838}.hint--top:after,.hint--top:before{bottom:100%;left:50%}.hint--top:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--top:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top:hover:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--bottom:after,.hint--bottom:before{top:100%;left:50%}.hint--bottom:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--bottom:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom:hover:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--right:before{border-right-color:#383838;margin-left:-11px;margin-bottom:-6px}.hint--right:after{margin-bottom:-14px}.hint--right:after,.hint--right:before{left:100%;bottom:50%}.hint--right:hover:after,.hint--right:hover:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--left:before{border-left-color:#383838;margin-right:-11px;margin-bottom:-6px}.hint--left:after{margin-bottom:-14px}.hint--left:after,.hint--left:before{right:100%;bottom:50%}.hint--left:hover:after,.hint--left:hover:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--top-left:after,.hint--top-left:before{bottom:100%;left:50%}.hint--top-left:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--top-left:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top-left:hover:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--top-right:after,.hint--top-right:before{bottom:100%;left:50%}.hint--top-right:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--top-right:hover:after,.hint--top-right:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--bottom-left:after,.hint--bottom-left:before{top:100%;left:50%}.hint--bottom-left:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--bottom-left:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom-left:hover:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--bottom-right:after,.hint--bottom-right:before{top:100%;left:50%}.hint--bottom-right:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--bottom-right:hover:after,.hint--bottom-right:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--large:after,.hint--medium:after,.hint--small:after{white-space:normal;line-height:1.4em;word-wrap:break-word}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}.hint--error:after{background-color:#b34e4d;text-shadow:0 -1px 0 #592726}.hint--error.hint--top-left:before,.hint--error.hint--top-right:before,.hint--error.hint--top:before{border-top-color:#b34e4d}.hint--error.hint--bottom-left:before,.hint--error.hint--bottom-right:before,.hint--error.hint--bottom:before{border-bottom-color:#b34e4d}.hint--error.hint--left:before{border-left-color:#b34e4d}.hint--error.hint--right:before{border-right-color:#b34e4d}.hint--warning:after{background-color:#c09854;text-shadow:0 -1px 0 #6c5328}.hint--warning.hint--top-left:before,.hint--warning.hint--top-right:before,.hint--warning.hint--top:before{border-top-color:#c09854}.hint--warning.hint--bottom-left:before,.hint--warning.hint--bottom-right:before,.hint--warning.hint--bottom:before{border-bottom-color:#c09854}.hint--warning.hint--left:before{border-left-color:#c09854}.hint--warning.hint--right:before{border-right-color:#c09854}.hint--info:after{background-color:#3986ac;text-shadow:0 -1px 0 #1a3c4d}.hint--info.hint--top-left:before,.hint--info.hint--top-right:before,.hint--info.hint--top:before{border-top-color:#3986ac}.hint--info.hint--bottom-left:before,.hint--info.hint--bottom-right:before,.hint--info.hint--bottom:before{border-bottom-color:#3986ac}.hint--info.hint--left:before{border-left-color:#3986ac}.hint--info.hint--right:before{border-right-color:#3986ac}.hint--success:after{background-color:#458746;text-shadow:0 -1px 0 #1a321a}.hint--success.hint--top-left:before,.hint--success.hint--top-right:before,.hint--success.hint--top:before{border-top-color:#458746}.hint--success.hint--bottom-left:before,.hint--success.hint--bottom-right:before,.hint--success.hint--bottom:before{border-bottom-color:#458746}.hint--success.hint--left:before{border-left-color:#458746}.hint--success.hint--right:before{border-right-color:#458746}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--always.hint--top-left:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top-left:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--always.hint--top-right:after,.hint--always.hint--top-right:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--bottom:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--always.hint--bottom-left:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom-left:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--always.hint--bottom-right:after,.hint--always.hint--bottom-right:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--left:after,.hint--always.hint--left:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--always.hint--right:after,.hint--always.hint--right:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--rounded:after{border-radius:4px}.hint--no-animate:after,.hint--no-animate:before{-webkit-transition-duration:0s;-moz-transition-duration:0s;transition-duration:0s}.hint--bounce:after,.hint--bounce:before{-webkit-transition:opacity .3s ease,visibility .3s ease,-webkit-transform .3s cubic-bezier(.71,1.7,.77,1.24);-moz-transition:opacity .3s ease,visibility .3s ease,-moz-transform .3s cubic-bezier(.71,1.7,.77,1.24);transition:opacity .3s ease,visibility .3s ease,transform .3s cubic-bezier(.71,1.7,.77,1.24)}.hint--no-shadow:after,.hint--no-shadow:before{text-shadow:initial;box-shadow:initial}.hint--no-arrow:before{display:none} \ No newline at end of file +[class*=hint--]{position:relative;display:inline-block}[class*=hint--]:after,[class*=hint--]:before{position:absolute;transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;transition:.3s ease;transition-delay:0s}[class*=hint--]:hover:after,[class*=hint--]:hover:before{visibility:visible;opacity:1;transition-delay:.1s}[class*=hint--]:before{content:"";position:absolute;background:#383838;border:6px solid transparent;clip-path:polygon(0 0,100% 0,100% 100%);z-index:1000001}[class*=hint--]:after{background:#383838;color:#fff;padding:8px 10px;font-size:1rem;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1rem;white-space:nowrap;text-shadow:0 1px 0 #000;box-shadow:4px 4px 8px rgba(0,0,0,.3)}.hint--error:after,.hint--error:before{background-color:#b24e4c}[class*=hint--][aria-label]:after{content:attr(aria-label)}[class*=hint--][data-hint]:after{content:attr(data-hint)}[aria-label=""]:after,[aria-label=""]:before,[data-hint=""]:after,[data-hint=""]:before{display:none!important}.hint--top{--rotation:135deg}.hint--top:after,.hint--top:before{bottom:100%;left:50%}.hint--top:before{margin-bottom:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--top:after{transform:translateX(-50%)}.hint--top:hover:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--top:hover:after{transform:translateX(-50%) translateY(-8px)}.hint--bottom{--rotation:-45deg}.hint--bottom:after,.hint--bottom:before{top:100%;left:50%}.hint--bottom:before{margin-top:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--bottom:after{transform:translateX(-50%)}.hint--bottom:hover:before{transform:translateY(8px) rotate(var(--rotation))}.hint--bottom:hover:after{transform:translateX(-50%) translateY(8px)}.hint--right{--rotation:-135deg}.hint--right:before{margin-left:-5.5px;margin-bottom:-6px;transform:rotate(var(--rotation))}.hint--right:after{margin-bottom:calc(-1 * (1rem + 16px)/ 2)}.hint--right:after,.hint--right:before{left:100%;bottom:50%}.hint--right:hover:before{transform:translateX(8px) rotate(var(--rotation))}.hint--right:hover:after{transform:translateX(8px)}.hint--left{--rotation:45deg}.hint--left:before{margin-right:-5.5px;margin-bottom:-6px;transform:rotate(var(--rotation))}.hint--left:after{margin-bottom:calc(-1 * (1rem + 16px)/ 2)}.hint--left:after,.hint--left:before{right:100%;bottom:50%}.hint--left:hover:before{transform:translateX(-8px) rotate(var(--rotation))}.hint--left:hover:after{transform:translateX(-8px)}.hint--top-left{--rotation:135deg}.hint--top-left:after,.hint--top-left:before{bottom:100%;left:50%}.hint--top-left:before{margin-bottom:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--top-left:after{transform:translateX(-100%);margin-left:12px}.hint--top-left:hover:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--top-left:hover:after{transform:translateX(-100%) translateY(-8px)}.hint--top-right{--rotation:135deg}.hint--top-right:after,.hint--top-right:before{bottom:100%;left:50%}.hint--top-right:before{margin-bottom:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--top-right:after{transform:translateX(0);margin-left:-12px}.hint--top-right:hover:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--top-right:hover:after{transform:translateY(-8px)}.hint--bottom-left{--rotation:-45deg}.hint--bottom-left:after,.hint--bottom-left:before{top:100%;left:50%}.hint--bottom-left:before{margin-top:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--bottom-left:after{transform:translateX(-100%);margin-left:12px}.hint--bottom-left:hover:before{transform:translateY(8px) rotate(var(--rotation))}.hint--bottom-left:hover:after{transform:translateX(-100%) translateY(8px)}.hint--bottom-right{--rotation:-45deg}.hint--bottom-right:after,.hint--bottom-right:before{top:100%;left:50%}.hint--bottom-right:before{margin-top:-5.5px;transform:rotate(var(--rotation));left:calc(50% - 6px)}.hint--bottom-right:after{transform:translateX(0);margin-left:-12px}.hint--bottom-right:hover:before{transform:translateY(8px) rotate(var(--rotation))}.hint--bottom-right:hover:after{transform:translateY(8px)}.hint--fit:after,.hint--large:after,.hint--medium:after,.hint--small:after{box-sizing:border-box;white-space:normal;line-height:1.4em;word-wrap:break-word}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}.hint--fit:after{width:100%}.hint--error:after{text-shadow:0 1px 0 #592726}.hint--warning:after,.hint--warning:before{background-color:#bf9853}.hint--warning:after{text-shadow:0 1px 0 #6c5328}.hint--info:after,.hint--info:before{background-color:#3985ac}.hint--info:after{text-shadow:0 1px 0 #1a3c4d}.hint--success:after,.hint--success:before{background-color:#458646}.hint--success:after{text-shadow:0 1px 0 #1a321a}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--always.hint--top:after{transform:translateX(-50%) translateY(-8px)}.hint--always.hint--top-left:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--always.hint--top-left:after{transform:translateX(-100%) translateY(-8px)}.hint--always.hint--top-right:before{transform:translateY(-8px) rotate(var(--rotation))}.hint--always.hint--top-right:after{transform:translateY(-8px)}.hint--always.hint--bottom:before{transform:translateY(8px) rotate(var(--rotation))}.hint--always.hint--bottom:after{transform:translateX(-50%) translateY(8px)}.hint--always.hint--bottom-left:before{transform:translateY(8px) rotate(var(--rotation))}.hint--always.hint--bottom-left:after{transform:translateX(-100%) translateY(8px)}.hint--always.hint--bottom-right:before{transform:translateY(8px) rotate(var(--rotation))}.hint--always.hint--bottom-right:after{transform:translateY(8px)}.hint--always.hint--left:before{transform:translateX(-8px) rotate(var(--rotation))}.hint--always.hint--left:after{transform:translateX(-8px)}.hint--always.hint--right:before{transform:translateX(8px) rotate(var(--rotation))}.hint--always.hint--right:after{transform:translateX(8px)}.hint--rounded:before{border-radius:0 4px 0 0}.hint--rounded:after{border-radius:4px}.hint--no-animate:after,.hint--no-animate:before{transition-duration:0s}.hint--bounce:after,.hint--bounce:before{transition:opacity .3s ease,visibility .3s ease,transform .3s cubic-bezier(.71,1.7,.77,1.24)}@supports (transition-timing-function:linear(0,1)){.hint--bounce:after,.hint--bounce:before{--spring-easing:linear( + 0, + 0.009, + 0.035 2.1%, + 0.141 4.4%, + 0.723 12.9%, + 0.938, + 1.077 20.4%, + 1.121, + 1.149 24.3%, + 1.159, + 1.163 27%, + 1.154, + 1.129 32.8%, + 1.051 39.6%, + 1.017 43.1%, + 0.991, + 0.977 51%, + 0.975 57.1%, + 0.997 69.8%, + 1.003 76.9%, + 1 + );transition:opacity .3s ease,visibility .3s ease,transform .5s var(--spring-easing)}}.hint--no-shadow:after,.hint--no-shadow:before{text-shadow:initial;box-shadow:initial}.hint--no-arrow:before{display:none} \ No newline at end of file