Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Shows the full name of a folder (in the bookmarks toolbar) on hover
- FUNCTIONAL on Firefox 135.0 as of the 2025-02-12
- TODOs:
- - How to have the tooltip appear over the webpage, like what happens for bookmarks hover?
- - How to have the tooltip appear under the mouse, like what happens for bookmarks hover?
- -> JS... Cf.:
- - https://webdesign.tutsplus.com/how-to-build-a-sticky-css-tooltip-with-a-bit-of-javascript--cms-106711t
- - https://codehim.com/vanilla-javascript/show-tooltip-on-mouse-position-in-javascript/
- - How to have the tooltip fit inside the window?
- - The tooltip overflows to the right when the window is small i.e. not fullscreen
- - The tooltip grows equally in both vertical directions (towards top and bottom) on text overflow, which results in the bottom line(s) being hidden by the webpage.
- - Can we have it grow exclusively towards the top instead?
- Apparently, the tooltip is being herited from the OS...
- */
- /* The properties are generally designed to yield a mimic of what Firefox does for the bookmarks (in the bookmarks toolbar, just around) */
- #PlacesToolbar .bookmark-item[container]/*:not([label=""])*/:hover::after {
- /* General properties */
- transform: translate(+50%, +20%); /* Translated 50% of the element's width to the right, and 20% of its height to the bottom */
- background-color: #2b2a33; /* Same as basic tooltip for bookmarks */
- position: fixed;
- z-index: 9999; /* To be put at the front (technically out of integer range, although 9999 should do the trick) */
- opacity: 1;
- visibility: visible;
- transition: opacity 200s ease-in-out; /* Does not seem to work: the tooltip appears immediately */
- /* Text */
- content: attr(label); /* Name of the folder */
- color: white;
- font-size: 12px;
- white-space: pre-wrap; /* Whitespace is preserved by the browser; text will wrap when necessary, and on line breaks */
- overflow: break-word; /* Long words will break when necessary */
- text-overflow: clip; /* Clip text on overflow */
- /* Padding */
- /* Same as basic tooltip for bookmarks */
- padding-right: 2px;
- padding-left: 2px;
- padding-top: 1px;
- padding-bottom: 1px;
- /* Border */
- /* Same as basic tooltip for bookmarks */
- border: 1px solid #dfdfe2;
- border-radius: 4px;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement