Skip to content

Commit 8ba1830

Browse files
authored
Merge pull request #752 from mattico/icon-margin-padding
Icon button hit-test dead-space fix
2 parents 76c1c9e + 512826c commit 8ba1830

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/theme/book.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ function playpen_text(playpen) {
381381

382382
themePopup.addEventListener('focusout', function(e) {
383383
// e.relatedTarget is null in Safari and Firefox on macOS (see workaround below)
384-
if (!!e.relatedTarget && !themePopup.contains(e.relatedTarget)) {
384+
if (!!e.relatedTarget && !themeToggleButton.contains(e.relatedTarget) && !themePopup.contains(e.relatedTarget)) {
385385
hideThemes();
386386
}
387387
});

src/theme/css/chrome.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ a > .hljs {
4141
}
4242
#menu-bar i, #menu-bar .icon-button {
4343
position: relative;
44-
margin: 0 8px;
44+
padding: 0 8px;
4545
z-index: 10;
4646
line-height: 50px;
4747
cursor: pointer;
4848
transition: color 0.5s;
4949
}
5050
@media only screen and (max-width: 420px) {
5151
#menu-bar i, #menu-bar .icon-button {
52-
margin: 0 5px;
52+
padding: 0 5px;
5353
}
5454
}
5555

@@ -71,8 +71,13 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta
7171
transform: translateY(-60px);
7272
}
7373

74-
.left-buttons { margin: 0 5px; }
75-
.no-js .left-buttons { display: none; }
74+
.left-buttons {
75+
display: flex;
76+
margin: 0 5px;
77+
}
78+
.no-js .left-buttons {
79+
display: none;
80+
}
7681

7782
.menu-title {
7883
display: inline-block;
@@ -374,6 +379,7 @@ a:hover {
374379
.theme-popup {
375380
position: absolute;
376381
left: 10px;
382+
top: 50px;
377383
z-index: 1000;
378384
border-radius: 4px;
379385
font-size: 0.7em;

0 commit comments

Comments
 (0)