Advertisement
Guest User

Untitled

a guest
Feb 17th, 2025
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.29 KB | Source Code | 0 0
  1. /*
  2.     Shows the full name of a folder (in the bookmarks toolbar) on hover
  3.    
  4.     FUNCTIONAL on Firefox 135.0 as of the 2025-02-12
  5.    
  6.     TODOs:
  7.         - How to have the tooltip appear over the webpage, like what happens for bookmarks hover?
  8.         - How to have the tooltip appear under the mouse, like what happens for bookmarks hover?
  9.             -> JS... Cf.:
  10.                 - https://webdesign.tutsplus.com/how-to-build-a-sticky-css-tooltip-with-a-bit-of-javascript--cms-106711t
  11.                 - https://codehim.com/vanilla-javascript/show-tooltip-on-mouse-position-in-javascript/
  12.         - How to have the tooltip fit inside the window?
  13.             - The tooltip overflows to the right when the window is small i.e. not fullscreen
  14.             - 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.
  15.                 - Can we have it grow exclusively towards the top instead?
  16.    
  17.     Apparently, the tooltip is being herited from the OS...
  18. */
  19.  
  20. /* The properties are generally designed to yield a mimic of what Firefox does for the bookmarks (in the bookmarks toolbar, just around) */
  21.  
  22. #PlacesToolbar .bookmark-item[container]/*:not([label=""])*/:hover::after {
  23.   /* General properties */
  24.   transform: translate(+50%, +20%);  /* Translated 50% of the element's width to the right, and 20% of its height to the bottom */
  25.   background-color: #2b2a33;  /* Same as basic tooltip for bookmarks */
  26.   position: fixed;
  27.   z-index: 9999;  /* To be put at the front (technically out of integer range, although 9999 should do the trick) */
  28.   opacity: 1;
  29.   visibility: visible;
  30.   transition: opacity 200s ease-in-out; /* Does not seem to work: the tooltip appears immediately */
  31.  
  32.   /* Text */
  33.   content: attr(label);  /* Name of the folder */
  34.   color: white;
  35.   font-size: 12px;
  36.   white-space: pre-wrap;  /* Whitespace is preserved by the browser; text will wrap when necessary, and on line breaks */
  37.   overflow: break-word;  /* Long words will break when necessary */
  38.   text-overflow: clip;  /* Clip text on overflow */
  39.  
  40.   /* Padding */
  41.   /* Same as basic tooltip for bookmarks */
  42.   padding-right: 2px;
  43.   padding-left: 2px;
  44.   padding-top: 1px;
  45.   padding-bottom: 1px;
  46.  
  47.   /* Border */
  48.   /* Same as basic tooltip for bookmarks */
  49.   border: 1px solid #dfdfe2;
  50.   border-radius: 4px;
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement