Skip to content

Commit d72080c

Browse files
authored
Merge pull request #7409 from Calinou/abbr-add-mobile-display
2 parents d37226e + b57807b commit d72080c

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

_static/css/custom.css

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
--copybtn-tooltip-background-color: #24292f;
113113
--copybtn-box-shadow: 0 1px 0 rgba(27,31,36,0.04), inset 0 1px 0 rgba(255,255,255,0.25);
114114
--copybtn-border-color-success: #2da44e;
115-
115+
116116
--contribute-background-color: #d7dee8;
117117
--contribute-text-color: #646e72;
118118

@@ -1714,7 +1714,7 @@ p + .classref-constant {
17141714
left: 3.5px;
17151715
top: 3.5px;
17161716
color: var(--copybtn-icon-color);
1717-
pointer-events: none;
1717+
pointer-events: none;
17181718
}
17191719
.highlight button.copybtn.success {
17201720
border-color: var(--copybtn-border-color-success);
@@ -1729,3 +1729,29 @@ p + .classref-constant {
17291729
border-radius: 6px;
17301730
padding: 0.5em 0.75em;
17311731
}
1732+
1733+
/* Allow :abbr: tags' content to be displayed on mobile platforms by tapping the word */
1734+
@media (hover: none), (hover: on-demand), (-moz-touch-enabled: 1), (pointer:coarse) {
1735+
/* Do not enable on desktop platforms to avoid doubling the tooltip */
1736+
abbr[title] {
1737+
position: relative;
1738+
}
1739+
1740+
abbr[title]:hover::after,
1741+
abbr[title]:focus::after {
1742+
content: attr(title);
1743+
1744+
position: absolute;
1745+
left: 0;
1746+
bottom: -32px;
1747+
width: auto;
1748+
white-space: nowrap;
1749+
1750+
background-color: #1e1e1e;
1751+
color: #fff;
1752+
border-radius: 3px;
1753+
box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.4);
1754+
font-size: 14px;
1755+
padding: 3px 5px;
1756+
}
1757+
}

0 commit comments

Comments
 (0)