Skip to content

Commit

Permalink
Show copy icon on hover
Browse files Browse the repository at this point in the history
2 CSS Tweaks:
- Show copy button only when content box is hovered over. Hover icon will not overlap content area text. (line 74)
- Tweaked spacing in content area for cleaner look. (line 54)
  • Loading branch information
MartynKeigher authored May 11, 2021
1 parent c7ed951 commit f8ec984
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,28 @@
}

.admonition-content {
margin: 0 0.6rem;
position: relative;
margin: 10px 15px;
padding-right: 25px;
position: relative;
}

.admonition-content-copy {
position: absolute;
top: 0;
right: 0;
color: var(--text-faint);
cursor: pointer;
margin: -10px -2px;
color: var(--text-faint);
cursor: pointer;
opacity: 0;
position: absolute;
right: 0px;
top: 0;
transition: 0.3s all ease-in;
}

.admonition-content-copy:hover {
color: var(--text-normal);
color: var(--text-normal);
}

.admonition-content:hover > .admonition-content-copy,
.admonition-content-copy:hover {
opacity: 1;
}

details.admonition:not([open]) {
Expand Down

0 comments on commit f8ec984

Please sign in to comment.