|
|
|
|
@@ -4,7 +4,7 @@
|
|
|
|
|
- bottom / block-end
|
|
|
|
|
- left / inline-start
|
|
|
|
|
*/
|
|
|
|
|
[role=tooltip] {
|
|
|
|
|
tooltip, tool-tip {
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 0.5rem;
|
|
|
|
|
color: #000;
|
|
|
|
|
@@ -38,7 +38,7 @@
|
|
|
|
|
will-change: filter;
|
|
|
|
|
z-index: 10;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]::before {
|
|
|
|
|
tooltip::before, tool-tip::before {
|
|
|
|
|
clip-path: inset(50%);
|
|
|
|
|
clip: rect(1px, 1px, 1px, 1px);
|
|
|
|
|
content: "; Has tooltip: ";
|
|
|
|
|
@@ -49,7 +49,7 @@
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 1px;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]::after {
|
|
|
|
|
tooltip::after, tool-tip::after {
|
|
|
|
|
background: #fff;
|
|
|
|
|
content: "";
|
|
|
|
|
inset: 0;
|
|
|
|
|
@@ -58,21 +58,29 @@
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: -1;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=top],
|
|
|
|
|
tooltip:is([tip-position=top],
|
|
|
|
|
[tip-position=block-start],
|
|
|
|
|
:not([tip-position]),
|
|
|
|
|
[tip-position=bottom],
|
|
|
|
|
[tip-position=block-end]), tool-tip:is([tip-position=top],
|
|
|
|
|
[tip-position=block-start],
|
|
|
|
|
:not([tip-position]),
|
|
|
|
|
[tip-position=bottom],
|
|
|
|
|
[tip-position=block-end]) {
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=top],
|
|
|
|
|
tooltip:is([tip-position=top],
|
|
|
|
|
[tip-position=block-start],
|
|
|
|
|
:not([tip-position])), tool-tip:is([tip-position=top],
|
|
|
|
|
[tip-position=block-start],
|
|
|
|
|
:not([tip-position])) {
|
|
|
|
|
inset-inline-start: 50%;
|
|
|
|
|
inset-block-end: calc(100% + 0.75rem + 1rem);
|
|
|
|
|
--tooltip-x: calc(50% * -1);
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=top],
|
|
|
|
|
tooltip:is([tip-position=top],
|
|
|
|
|
[tip-position=block-start],
|
|
|
|
|
:not([tip-position]))::after, tool-tip:is([tip-position=top],
|
|
|
|
|
[tip-position=block-start],
|
|
|
|
|
:not([tip-position]))::after {
|
|
|
|
|
--tooltip-pointer: conic-gradient(from -30deg at bottom, rgba(0, 0, 0, 0), #000 1deg 60deg, rgba(0, 0, 0, 0) 61deg) bottom/100% 50% no-repeat;
|
|
|
|
|
@@ -80,39 +88,45 @@
|
|
|
|
|
-webkit-border-after: 1rem solid transparent;
|
|
|
|
|
border-block-end: 1rem solid transparent;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=right],
|
|
|
|
|
tooltip:is([tip-position=right],
|
|
|
|
|
[tip-position=inline-end]), tool-tip:is([tip-position=right],
|
|
|
|
|
[tip-position=inline-end]) {
|
|
|
|
|
inset-inline-start: calc(100% + 1.5rem + 1rem);
|
|
|
|
|
inset-block-end: 50%;
|
|
|
|
|
--tooltip-y: 50%;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=right],
|
|
|
|
|
tooltip:is([tip-position=right],
|
|
|
|
|
[tip-position=inline-end])::after, tool-tip:is([tip-position=right],
|
|
|
|
|
[tip-position=inline-end])::after {
|
|
|
|
|
--tooltip-pointer: conic-gradient(from 60deg at left, rgba(0, 0, 0, 0), #000 1deg 60deg, rgba(0, 0, 0, 0) 61deg) left/50% 100% no-repeat;
|
|
|
|
|
inset-inline-start: -1rem;
|
|
|
|
|
-webkit-border-start: 1rem solid transparent;
|
|
|
|
|
border-inline-start: 1rem solid transparent;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=bottom],
|
|
|
|
|
tooltip:is([tip-position=bottom],
|
|
|
|
|
[tip-position=block-end]), tool-tip:is([tip-position=bottom],
|
|
|
|
|
[tip-position=block-end]) {
|
|
|
|
|
inset-inline-start: 50%;
|
|
|
|
|
inset-block-start: calc(100% + 0.75rem + 1rem);
|
|
|
|
|
--tooltip-x: calc(50% * -1);
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=bottom],
|
|
|
|
|
tooltip:is([tip-position=bottom],
|
|
|
|
|
[tip-position=block-end])::after, tool-tip:is([tip-position=bottom],
|
|
|
|
|
[tip-position=block-end])::after {
|
|
|
|
|
--tooltip-pointer: conic-gradient(from 150deg at top, rgba(0, 0, 0, 0), #000 1deg 60deg, rgba(0, 0, 0, 0) 61deg) top/100% 50% no-repeat;
|
|
|
|
|
inset-block-start: -1rem;
|
|
|
|
|
-webkit-border-before: 1rem solid transparent;
|
|
|
|
|
border-block-start: 1rem solid transparent;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=left],
|
|
|
|
|
tooltip:is([tip-position=left],
|
|
|
|
|
[tip-position=inline-start]), tool-tip:is([tip-position=left],
|
|
|
|
|
[tip-position=inline-start]) {
|
|
|
|
|
inset-inline-end: calc(100% + 1.5rem + 1rem);
|
|
|
|
|
inset-block-end: 50%;
|
|
|
|
|
--tooltip-y: 50%;
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]:is([tip-position=left],
|
|
|
|
|
tooltip:is([tip-position=left],
|
|
|
|
|
[tip-position=inline-start])::after, tool-tip:is([tip-position=left],
|
|
|
|
|
[tip-position=inline-start])::after {
|
|
|
|
|
--tooltip-pointer: conic-gradient(from -120deg at right, rgba(0, 0, 0, 0), #000 1deg 60deg, rgba(0, 0, 0, 0) 61deg) right/50% 100% no-repeat;
|
|
|
|
|
inset-inline-end: -1rem;
|
|
|
|
|
@@ -120,21 +134,21 @@
|
|
|
|
|
border-inline-end: 1rem solid transparent;
|
|
|
|
|
}
|
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
|
|
[role=tooltip] {
|
|
|
|
|
tooltip, tool-tip {
|
|
|
|
|
background: #1f2127;
|
|
|
|
|
color: #fff;
|
|
|
|
|
-webkit-filter: drop-shadow(0 3px 3px hsla(0, 0%, 0%, 0.5)) drop-shadow(0 12px 12px hsla(0, 0%, 0%, 0.5));
|
|
|
|
|
filter: drop-shadow(0 3px 3px hsla(0, 0%, 0%, 0.5)) drop-shadow(0 12px 12px hsla(0, 0%, 0%, 0.5));
|
|
|
|
|
}
|
|
|
|
|
[role=tooltip]::after {
|
|
|
|
|
tooltip::after, tool-tip::after {
|
|
|
|
|
background: #1f2127;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:has(> [role=tooltip]) {
|
|
|
|
|
:has(> tooltip), :has(> tool-tip) {
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
:has(> [role=tooltip]):is(:hover, :focus-visible, :active) > [role=tooltip] {
|
|
|
|
|
:has(> tooltip):is(:hover, :focus-visible, :active) > tool-tip, :has(> tooltip):is(:hover, :focus-visible, :active) > tooltip, :has(> tool-tip):is(:hover, :focus-visible, :active) > tool-tip, :has(> tool-tip):is(:hover, :focus-visible, :active) > tooltip {
|
|
|
|
|
display: block;
|
|
|
|
|
opacity: 1;
|
|
|
|
|
-webkit-transition-delay: 300ms;
|
|
|
|
|
@@ -142,16 +156,20 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (prefers-reduced-motion: no-preference) {
|
|
|
|
|
:has(> [role=tooltip]:is([tip-position=top], [tip-position=block-start], :not([tip-position]))):not(:hover):not(:active) [role=tooltip] {
|
|
|
|
|
:has(> tool-tip:is([tip-position=top], [tip-position=block-start], :not([tip-position]))):not(:hover):not(:active) tool-tip,
|
|
|
|
|
:has(> tooltip:is([tip-position=top], [tip-position=block-start], :not([tip-position]))):not(:hover):not(:active) tooltip {
|
|
|
|
|
--tooltip-y: 3px;
|
|
|
|
|
}
|
|
|
|
|
:has(> [role=tooltip]:is([tip-position=right], [tip-position=inline-end])):not(:hover):not(:active) [role=tooltip] {
|
|
|
|
|
:has(> tool-tip:is([tip-position=right], [tip-position=inline-end])):not(:hover):not(:active) tool-tip,
|
|
|
|
|
:has(> tooltip:is([tip-position=right], [tip-position=inline-end])):not(:hover):not(:active) tooltip {
|
|
|
|
|
--tooltip-x: calc(-1 * -3px * -1);
|
|
|
|
|
}
|
|
|
|
|
:has(> [role=tooltip]:is([tip-position=bottom], [tip-position=block-end])):not(:hover):not(:active) [role=tooltip] {
|
|
|
|
|
:has(> tool-tip:is([tip-position=bottom], [tip-position=block-end])):not(:hover):not(:active) tool-tip,
|
|
|
|
|
:has(> tooltip:is([tip-position=bottom], [tip-position=block-end])):not(:hover):not(:active) tooltip {
|
|
|
|
|
--tooltip-y: -3px;
|
|
|
|
|
}
|
|
|
|
|
:has(> [role=tooltip]:is([tip-position=left], [tip-position=inline-start])):not(:hover):not(:active) [role=tooltip] {
|
|
|
|
|
:has(> tool-tip:is([tip-position=left], [tip-position=inline-start])):not(:hover):not(:active) tool-tip,
|
|
|
|
|
:has(> tooltip:is([tip-position=left], [tip-position=inline-start])):not(:hover):not(:active) tooltip {
|
|
|
|
|
--tooltip-x: calc(-1 * 3px * -1);
|
|
|
|
|
}
|
|
|
|
|
}
|