You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 line
1.9 KiB

  1. {"ast":null,"code":"var TRACK_BG = 'rgba(222, 222, 222, .75)';\nvar THUMB_BG = 'rgba(0, 0, 0, .5)';\nvar SCROLLBAR_STYLE = \"\\n[data-scrollbar] {\\n display: block;\\n position: relative;\\n}\\n\\n.scroll-content {\\n -webkit-transform: translate3d(0, 0, 0);\\n transform: translate3d(0, 0, 0);\\n}\\n\\n.scrollbar-track {\\n position: absolute;\\n opacity: 0;\\n z-index: 1;\\n background: \" + TRACK_BG + \";\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n -webkit-transition: opacity 0.5s 0.5s ease-out;\\n transition: opacity 0.5s 0.5s ease-out;\\n}\\n.scrollbar-track.show,\\n.scrollbar-track:hover {\\n opacity: 1;\\n -webkit-transition-delay: 0s;\\n transition-delay: 0s;\\n}\\n\\n.scrollbar-track-x {\\n bottom: 0;\\n left: 0;\\n width: 100%;\\n height: 8px;\\n}\\n.scrollbar-track-y {\\n top: 0;\\n right: 0;\\n width: 8px;\\n height: 100%;\\n}\\n.scrollbar-thumb {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 8px;\\n height: 8px;\\n background: \" + THUMB_BG + \";\\n border-radius: 4px;\\n}\\n\";\nvar STYLE_ID = 'smooth-scrollbar-style';\nvar isStyleAttached = false;\nexport function attachStyle() {\n if (isStyleAttached || typeof window === 'undefined') {\n return;\n }\n\n var styleEl = document.createElement('style');\n styleEl.id = STYLE_ID;\n styleEl.textContent = SCROLLBAR_STYLE;\n\n if (document.head) {\n document.head.appendChild(styleEl);\n }\n\n isStyleAttached = true;\n}\nexport function detachStyle() {\n if (!isStyleAttached || typeof window === 'undefined') {\n return;\n }\n\n var styleEl = document.getElementById(STYLE_ID);\n\n if (!styleEl || !styleEl.parentNode) {\n return;\n }\n\n styleEl.parentNode.removeChild(styleEl);\n isStyleAttached = false;\n}","map":null,"metadata":{},"sourceType":"module"}