Template:Tt/sandbox: Difference between revisions
Appearance
m Undo revision 387474 by AvidConanContributor (talk) That didn't work Tag: Undo |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly> | <includeonly><span class="tooltip-target" style="white-space: initial; overflow-x: initial;">{{{1}}}<span class="tooltip-container tooltip-container-above"><span class="tooltip">{{{2}}}<span class="chevron"></span></span></span></span>{{code | ||
|css= | |css= | ||
/* Target word for the tooltip to focus on */ | /* Target word for the tooltip to focus on */ | ||
.tooltip-target { | .tooltip-target { | ||
position: relative; | |||
display: inline-block; | |||
border-bottom: 0.0625em dotted; | |||
cursor: help; | |||
} | |||
} | |||
/* Container appear below target */ | |||
.tooltip-container-below { | /* CONTAINER CLASSES */ | ||
/* A so-called 'container' for the tooltip to work around in */ | |||
.tooltip-container { | |||
} | position: absolute; | ||
/* END OF CONTAINER CLASSES */ | left: 50%; | ||
transform: translateX(-50%); | |||
min-height: 1em; | |||
/* The TOOLTIP itself */ | width: 170px; | ||
.tooltip { | padding: 10px 0 8px; | ||
display: flex; | |||
justify-content: center; | |||
opacity: 1; | |||
pointer-events: none; | |||
user-select: none; | |||
-webkit-user-select: none; | |||
-ms-user-select: none; | |||
transition: 0.3s ease 0.1s; /* This is used for the hover animations */ | |||
} | |||
} | |||
/* Container appear above target */ | |||
.tooltip-container-above { | |||
/* CHEVRON CLASSES */ | bottom: 90%; | ||
/* Shared class */ | transform: translate(-50%, 3px); | ||
.chevron { | } | ||
/* Container appear below target */ | |||
.tooltip-container-below { | |||
top: 90%; | |||
transform: translate(-50%, -3px); | |||
} | |||
/* END OF CONTAINER CLASSES */ | |||
} | |||
/* When tooltip is above */ | /* The TOOLTIP itself */ | ||
.tooltip-container-above .chevron { | .tooltip { | ||
background: #fff; | |||
border-radius: 4px; | |||
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6)); | |||
} | padding: 6px 9px; | ||
max-width: 100%; | |||
/* When tooltip is below */ | height: min-content; | ||
.tooltip-container-below .chevron { | word-wrap: break-word; | ||
z-index: 999; | |||
} | |||
} | |||
/* END OF CHEVRON CLASSES */ | /* CHEVRON CLASSES */ | ||
/* Shared class */ | |||
.chevron { | |||
/* HOVER ANIMATION CLASSES */ | position: absolute; | ||
/* tooltip fade-in */ | left: 50%; | ||
transform: translateX(-50%); | |||
width: 0; | |||
height: 0; | |||
border-style: solid; | |||
z-index: 998; | |||
} | |||
/* When tooltip is above */ | |||
.tooltip-container-above .chevron { | |||
top: 95%; | |||
border-width: 9px 9px 0 9px; | |||
} | border-color: #fff transparent transparent transparent; | ||
} | |||
/* | |||
/* When tooltip is below */ | |||
.tooltip-container-below .chevron { | |||
bottom: 95%; | |||
border-width: 0 9px 9px 9px; | |||
border-color: transparent transparent #fff transparent; | |||
} | |||
/* END OF CHEVRON CLASSES */ | |||
/* HOVER ANIMATION CLASSES */ | |||
/* END OF HOVER ANIMATION CLASSES */ | /* Above tooltip fade-in */ | ||
.tooltip-target:hover .tooltip-container { | |||
}}</includeonly><noinclude>We love {{tt/sandbox|DC|Detective Conan}}<ref>qwoidjqwoi</ref><ref>e9qjr</ref></noinclude> | opacity: 1; | ||
transform: translate(-50%, 0); | |||
pointer-events: auto; | |||
user-select: auto; | |||
-webkit-user-select: auto; | |||
-ms-user-select: auto; | |||
} | |||
/* Text bold on hover */ | |||
.tooltip-target:hover { | |||
border-bottom: 0.0625em dashed; | |||
} | |||
/* END OF HOVER ANIMATION CLASSES */ | |||
}}</includeonly><noinclude>We love {{tt/sandbox|DC|Detective Conan<ref>wjdid</ref>}}<ref>qwoidjqwoi</ref><ref>e9qjr</ref></noinclude> | |||