theme: adjust copy-to-clipboard

Copy to clipboard has a lot of smaller issues:

- contrast for inline code is bad in notice boxes
- bordering the icon does not work well with bordering of inline code
- hover color on inline code icon is blurred
- hover color on block code is statically set to link color of standard theme

And related to that:

- tooltip misses outline border, especially when displayed over dark background (like block code)
- inline code font size is sized by factor of parent font size, which is a hassle if you want to replicate the size for other elements
This commit is contained in:
Sören Weber 2021-07-25 22:09:45 +02:00
parent 798ae66da8
commit 541a634f6e
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
2 changed files with 31 additions and 30 deletions
static/js

View file

@ -337,6 +337,7 @@ jQuery(function() {
clipInit = true;
}
code.addClass('copy-to-clipboard-inline');
code.after('<span class="copy-to-clipboard" title="Copy to clipboard" />');
code.next('.copy-to-clipboard').on('mouseleave', function() {
$(this).attr('aria-label', null).removeClass('tooltipped tooltipped-s tooltipped-w');