Template:Tooltip/styles.css: Difference between revisions

Content deleted Content added
No edit summary
Tag: Reverted
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1:
/* Wrapper{{pp-template}} */
.tooltip { position: relative; display: inline-block; }
 
/* Base: keep desktop exactly the same */
/* Term */
.tooltip-target { cursorposition: helprelative; display: inline; }
.tooltip-dotted { border-bottom: 1px dotted; currentColorcursor: help; }
 
/* --- Mobile-only synthesized tooltip (no pointer-events used) --- */
/* Dotted underline (sanitiser-safe) */
@media (hover: none) and (pointer: coarse) {
.tooltip-dotted .tooltip-target {
text-decoration: none;
border-bottom: 1px dotted currentColor;
}
 
/* Bubble text pulled from the existing title attribute */
/* Popup */
.tooltip .tooltip-body[title]::after {
content: attr(title);
position: absolute;
left position: 0absolute;
top left: 10050%;
bottom: calc(100% + 8px);
margin-top: 6px;
transform: translateYtranslateX(3px-50%);
padding: 6px 8px;
background z-index: #2221000;
color: #fff;
border-radius: 6px;
font-size: 0.875em;
line-height: 1.35;
max-width: 90vw;
box-shadow: 0 8px 24px rgba(0,0,0,.25);
z-index: 1000;
 
background: nonergba(0,0,0,0.85);
opacity: 0;
visibility color: hidden#fff;
padding: 6px 8px;
transform: translateY(3px);
border-radius: 6px4px;
}
box-shadow: 0 8px2px 24px6px rgba(0,0,0,0.253);
line-height: 1.352;
font-size: 0.875em;
max-width: 90vw26rem;
white-space: normal;
text-align: left;
 
opacity: 0;
/* Show on hover and on focus (no :focus-within) */
visibility: visiblehidden;
.tooltip:hover .tooltip-body,
}
.tooltip .tooltip-target:focus ~ .tooltip-body,
.tooltip a:focus ~ .tooltip-body,
.tooltip .tooltip-toggle:focus ~ .tooltip-body {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
 
/* TermArrow */
/* “ⓘ” toggle for link case (span, not <button>) */
.tooltip .tooltip-toggle[title]::before {
margin-left content: .25em"";
position: absolute;
padding: 0 .25em;
border left: 050%;
bottom: calc(100% + 2px);
background: none;
transform: translateYtranslateX(0-50%);
font: inherit;
border: 6px solid transparent;
line-height: 1;
border-top-color: rgba(0,0,0,0.85);
cursor: pointer;
 
color: inherit;
opacity: 0;
visibility: hidden;
}
 
/* Non-link: the <span> itself is focusable (tabindex=0) */
.tooltip-target:focus::after,
.tooltip:focus::before,
.tooltip:active::after,
.tooltip:active::before {
opacity: 1;
visibility: visible;
}
 
/* Link case: focus/active land on the surrounding <a> */
.tooltip a:focus ~> .tooltip-body[title]::after,
a:focus > .tooltip[title]::before,
a:active > .tooltip[title]::after,
a:active > .tooltip[title]::before {
opacity: 1;
visibility: visible;
}
}
 
/* Reduced-motion users (nothing to transition here, so nothing needed) */
/* Basic focus ring (omit outline-offset) */
.tooltip-target:focus,
.tooltip .tooltip-toggle:focus {
outline: 2px solid #99c2ff;
}