From 3c547a02038fdc64162eff9022014f70ed7fd10b Mon Sep 17 00:00:00 2001 From: Rene Haas Date: Tue, 27 Dec 2022 16:47:50 +0100 Subject: [PATCH] improve website and readme --- README.md | 25 ++++--------------- docs/404.html | 4 +-- .../_buildManifest.js | 2 +- .../_ssgManifest.js | 0 ...778eaf347.js => index-ac84335dea6c3ea9.js} | 2 +- docs/index.html | 11 ++++---- packages/overlayscrollbars/README.md | 25 ++++--------------- website/src/components/index.mdx | 25 ++++--------------- 8 files changed, 24 insertions(+), 70 deletions(-) rename docs/_next/static/{MFC_3c1tHO1VVYfXqKpaE => ZS0U-vz72x6XnWg1fh8qy}/_buildManifest.js (79%) rename docs/_next/static/{MFC_3c1tHO1VVYfXqKpaE => ZS0U-vz72x6XnWg1fh8qy}/_ssgManifest.js (100%) rename docs/_next/static/chunks/pages/{index-8ddcd3e778eaf347.js => index-ac84335dea6c3ea9.js} (83%) diff --git a/README.md b/README.md index 86f6a8a..7f4286c 100644 --- a/README.md +++ b/README.md @@ -485,33 +485,18 @@ You can write and publish your own Plugins. This section is a work in progress.
- How do I get the scroll position of an element I applied the OverlayScrollbars to? + How do I get / set the scroll position of an element I applied the OverlayScrollbars to?
- If you applied `OverlayScrollbars` to the `body` element you can use [`window.scrollX`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX), [`window.scrollY`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY) or any other native api. + If you applied `OverlayScrollbars` to the `body` element you can use [`window.scrollX`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX), [`window.scrollY`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY), [`window.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll), [`window.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo), [`window.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy) or any other native api. -If the plugin was applied to any other element you have to get the `instance` first. With the instance you can get the `viewport` element. With this element you can use [`element.scrollTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop), [`element.scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft) or any other native api. +If the plugin was applied to any other element you have to get the `viewport` element with the `instance.elements()` function first. With this element you can use [`element.scrollTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop), [`element.scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft), [`element.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll), [`element.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo), [`element.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy) or any other native api. ```js const { viewport } = osInstance.elements(); -const { scrollLeft, scrollTop } = viewport; -``` -
- -
- - How do I set the scroll position of an element I applied the OverlayScrollbars to? - -
- - If you applied `OverlayScrollbars` to the `body` element you can scroll it with [`window.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll), [`window.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo), [`window.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy) or any other native api. - -If the plugin was applied to any other element you have to get the `instance` first. With the instance you can get the `viewport` element. With this element you can use [`element.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll), [`element.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo), [`element.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy) or any other native api. - -```js -const { viewport } = osInstance.elements(); -viewport.scrollTo({ top: 0 }); +const { scrollLeft, scrollTop } = viewport; // get scroll offset +viewport.scrollTo({ top: 0 }); // set scroll offset ```
diff --git a/docs/404.html b/docs/404.html index 25bfad0..dc52f44 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_next/static/MFC_3c1tHO1VVYfXqKpaE/_buildManifest.js b/docs/_next/static/ZS0U-vz72x6XnWg1fh8qy/_buildManifest.js similarity index 79% rename from docs/_next/static/MFC_3c1tHO1VVYfXqKpaE/_buildManifest.js rename to docs/_next/static/ZS0U-vz72x6XnWg1fh8qy/_buildManifest.js index ecb18a9..7762ed4 100644 --- a/docs/_next/static/MFC_3c1tHO1VVYfXqKpaE/_buildManifest.js +++ b/docs/_next/static/ZS0U-vz72x6XnWg1fh8qy/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":["static/css/054cd89f2e050c9e.css","static/chunks/pages/index-8ddcd3e778eaf347.js"],"/_error":["static/chunks/pages/_error-fa37e1d4331cc885.js"],sortedPages:["/","/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":["static/css/054cd89f2e050c9e.css","static/chunks/pages/index-ac84335dea6c3ea9.js"],"/_error":["static/chunks/pages/_error-fa37e1d4331cc885.js"],sortedPages:["/","/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/docs/_next/static/MFC_3c1tHO1VVYfXqKpaE/_ssgManifest.js b/docs/_next/static/ZS0U-vz72x6XnWg1fh8qy/_ssgManifest.js similarity index 100% rename from docs/_next/static/MFC_3c1tHO1VVYfXqKpaE/_ssgManifest.js rename to docs/_next/static/ZS0U-vz72x6XnWg1fh8qy/_ssgManifest.js diff --git a/docs/_next/static/chunks/pages/index-8ddcd3e778eaf347.js b/docs/_next/static/chunks/pages/index-ac84335dea6c3ea9.js similarity index 83% rename from docs/_next/static/chunks/pages/index-8ddcd3e778eaf347.js rename to docs/_next/static/chunks/pages/index-ac84335dea6c3ea9.js index 9f86176..7677c51 100644 --- a/docs/_next/static/chunks/pages/index-8ddcd3e778eaf347.js +++ b/docs/_next/static/chunks/pages/index-ac84335dea6c3ea9.js @@ -2,4 +2,4 @@ Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/ !function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],s=0;s"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"script"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"type"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:'"text/javascript"'}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"src"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:'"path/to/overlayscrollbars.js"'}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"defer>"})]})]})})})]}),"\n",(0,t.jsx)(s.h2,{id:"initialization",children:"Initialization"}),"\n",(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": During initialization its expected that the ",(0,t.jsx)("b",{children:"CSS file is loaded and parsed"})," by the browser."]}),"\n"]}),"\n",(0,t.jsxs)(s.p,{children:["You can initialize either directly with an ",(0,t.jsx)(s.code,{children:"Element"})," or with an ",(0,t.jsx)(s.code,{children:"Object"})," where you have more control over the initialization process."]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// simple initialization with an element"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"osInstance"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"), {});"})]})]})})}),"\n",(0,t.jsx)(s.h3,{id:"bridging-initialization-flickering",children:"Bridging initialization flickering"}),"\n",(0,t.jsx)(s.p,{children:"If you initialize OverlayScrollbars it needs a few milliseconds to create and append all the elements to the DOM.\r\nWhile this period the native scrollbars are still visible and are switched out after the initialization is finished. This is perceived as flickering."}),"\n",(0,t.jsxs)(s.p,{children:["To fix this behavior apply the ",(0,t.jsx)(s.code,{children:"data-overlayscrollbars-initialize"})," attribute to the target element (and ",(0,t.jsx)(s.code,{children:"html"})," element if the target element is ",(0,t.jsx)(s.code,{children:"body"}),")."]}),"\n",(0,t.jsx)(s.h3,{id:"initialization-with-an-object",children:"Initialization with an Object"}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsx)(s.p,{children:"This is a in depth topic. Click here to read it."})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": For now please refer to the ",(0,t.jsx)("b",{children:"TypeScript definitions"})," for a more detailed description of all possibilities."]}),"\n"]}),(0,t.jsxs)(s.p,{children:["The only required field is the ",(0,t.jsx)(s.code,{children:"target"})," field. This is the field to which the plugin is applied to.",(0,t.jsx)(s.br,{}),"\n","If you use the object initialization only with the ",(0,t.jsx)(s.code,{children:"target"})," field, the outcome is equivalent to the element initialization:"]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// Both initializations have the same outcome"})}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"), {});"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ target: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:") }, {});"})]})]})})}),(0,t.jsxs)(s.p,{children:["In the initialization object you can specify how the library is handling generated elements.\r\nFor example you can appoint an existing element as the ",(0,t.jsx)(s.code,{children:"viewport"})," element. Like this the library won't generate it but take the specified element instead:"]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" target: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#target'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"),"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" elements: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" viewport: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#viewport'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"),"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}, {});"})})]})})}),(0,t.jsx)(s.p,{children:"This is very useful if you have a fixed DOM structure and don't want OverlayScrollbars to generate its own elements. Those cases arise very often when you want an other library to work together with OverlayScrollbars."}),(0,t.jsx)(s.hr,{}),(0,t.jsx)(s.p,{children:"You can also decide to which element the scrollbars should be applied to:"}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" target: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#target'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"),"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" scrollbars: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" slot: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#target'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"parentElement"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}, {});"})})]})})}),(0,t.jsx)(s.hr,{}),(0,t.jsx)(s.p,{children:"And last but not least you can decide when the initialization should be canceled:"}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" target: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#target'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"),"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" cancel: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" nativeScrollbarsOverlaid: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"true"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" body: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"null"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" }"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}, {});"})})]})})}),(0,t.jsxs)(s.p,{children:["In the above example the initialization is canceled when the native scrollbars are overlaid or when your target is a ",(0,t.jsx)(s.code,{children:"body"})," element and the plugin determined that a initialization to the ",(0,t.jsx)(s.code,{children:"body"})," element would affect native functionality like ",(0,t.jsx)(s.code,{children:"window.scrollTo"}),"."]})]}),"\n",(0,t.jsx)(s.h2,{id:"options",children:"Options"}),"\n",(0,t.jsxs)(s.p,{children:["You can initialize OverlayScrollbars with an initial set of options, which can be changed at any time with the ",(0,t.jsx)(s.code,{children:"options"})," method:"]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"), {"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" overflow: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" x: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'hidden'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"});"})})]})})}),"\n",(0,t.jsx)(s.h3,{id:"options-in-depth",children:"Options in depth"}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsx)(s.p,{children:"This is a in depth topic. Click here to read it."})}),(0,t.jsx)("br",{}),(0,t.jsx)(s.p,{children:"The default options are:"}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"defaultOptions"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" paddingAbsolute: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"false"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" showNativeOverlaidScrollbars: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"false"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" update: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" elementEvents: [["}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'img'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'load'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"]],"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" debounce: ["}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"0"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"33"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"],"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" attributes: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"null"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" ignoreMutation: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"null"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" overflow: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" x: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'scroll'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" y: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'scroll'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" scrollbars: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" theme: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'os-theme-dark'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" visibility: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'auto'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" autoHide: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'never'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" autoHideDelay: "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"1300"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" dragScroll: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"true"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" clickScroll: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"false"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" pointers: ["}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'mouse'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'touch'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'pen'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"],"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"};"})})]})})}),(0,t.jsx)(s.h3,{id:"paddingabsolute",children:(0,t.jsx)(s.code,{children:"paddingAbsolute"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"boolean"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"false"})})]})})]}),(0,t.jsx)(s.p,{children:"Indicates whether the padding for the content shall be absolute."}),(0,t.jsx)(s.h3,{id:"shownativeoverlaidscrollbars",children:(0,t.jsx)(s.code,{children:"showNativeOverlaidScrollbars"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"boolean"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"false"})})]})})]}),(0,t.jsx)(s.p,{children:"Indicates whether the native overlaid scrollbars shall be visible."}),(0,t.jsx)(s.h3,{id:"updateelementevents",children:(0,t.jsx)(s.code,{children:"update.elementEvents"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"Array<[string, string]> | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"[['img', 'load']]"})})]})})]}),(0,t.jsxs)(s.p,{children:["An array of tuples. The first value in the tuple is an ",(0,t.jsx)(s.code,{children:"selector"})," and the second value are ",(0,t.jsx)(s.code,{children:"event names"}),'. The plugin will update itself if any of the elements with the specified selector will emit any specified event. The default value can be interpreted as "The plugin will update itself if any ',(0,t.jsx)(s.code,{children:"img"})," element emits an ",(0,t.jsx)(s.code,{children:"load"}),' event."']}),(0,t.jsx)(s.h3,{id:"updatedebounce",children:(0,t.jsx)(s.code,{children:"update.debounce"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"[number, number] | number | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"[0, 33]"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": If 0 is used for the timeout, ",(0,t.jsx)(s.code,{children:"requestAnimationFrame"})," instead of ",(0,t.jsx)(s.code,{children:"setTimeout"})," is used for the debounce."]}),"\n"]}),(0,t.jsxs)(s.p,{children:["Debounces the ",(0,t.jsx)(s.code,{children:"MutationObserver"})," which tracks changes to the content. If a ",(0,t.jsx)(s.strong,{children:"tuple"})," is passed, the first value is the timeout and second is the max wait. If only a ",(0,t.jsx)(s.strong,{children:"number"})," is passed you specify only the timeout and there is no max wait. With ",(0,t.jsx)(s.strong,{children:"null"})," there is no debounce. ",(0,t.jsx)(s.strong,{children:"Usefull to fine-tune performance."})]}),(0,t.jsx)(s.h3,{id:"updateattributes",children:(0,t.jsx)(s.code,{children:"update.attributes"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string[] | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"null"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": There is a base array of attributes that the ",(0,t.jsx)(s.code,{children:"MutationObserver"})," always observes, even if this option is ",(0,t.jsx)(s.code,{children:"null"}),"."]}),"\n"]}),(0,t.jsxs)(s.p,{children:["An array of additional attributes that the ",(0,t.jsx)(s.code,{children:"MutationObserver"})," should observe for the content."]}),(0,t.jsx)(s.h3,{id:"updateignoremutation",children:(0,t.jsx)(s.code,{children:"update.ignoreMutation"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"((mutation) => any) | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"null"})})]})})]}),(0,t.jsxs)(s.p,{children:["A function which receives a ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord",children:(0,t.jsx)(s.code,{children:"MutationRecord"})})," as an argument. If the function returns a truthy value the mutation will be ignored and the plugin won't update. ",(0,t.jsx)(s.strong,{children:"Usefull to fine-tune performance."})]}),(0,t.jsx)(s.h3,{id:"overflowx",children:(0,t.jsx)(s.code,{children:"overflow.x"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'scroll'"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Valid values are: ",(0,t.jsx)(s.code,{children:"'hidden'"}),", ",(0,t.jsx)(s.code,{children:"'scroll'"}),", ",(0,t.jsx)(s.code,{children:"'visible'"}),", ",(0,t.jsx)(s.code,{children:"'visible-hidden'"})," and ",(0,t.jsx)(s.code,{children:"'visible-scroll'"}),"."]}),"\n"]}),(0,t.jsx)(s.p,{children:"The overflow behavior for the horizontal (x) axis."}),(0,t.jsx)(s.h3,{id:"overflowy",children:(0,t.jsx)(s.code,{children:"overflow.y"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'scroll'"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Valid values are: ",(0,t.jsx)(s.code,{children:"'hidden'"}),", ",(0,t.jsx)(s.code,{children:"'scroll'"}),", ",(0,t.jsx)(s.code,{children:"'visible'"}),", ",(0,t.jsx)(s.code,{children:"'visible-hidden'"})," and ",(0,t.jsx)(s.code,{children:"'visible-scroll'"}),"."]}),"\n"]}),(0,t.jsx)(s.p,{children:"The overflow behavior for the vertical (y) axis."}),(0,t.jsx)(s.h3,{id:"scrollbarstheme",children:(0,t.jsx)(s.code,{children:"scrollbars.theme"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'os-theme-dark'"})})]})})]}),(0,t.jsx)(s.p,{children:"Applies the specified theme (classname) to the scrollbars."}),(0,t.jsx)(s.h3,{id:"scrollbarsvisibility",children:(0,t.jsx)(s.code,{children:"scrollbars.visibility"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'auto'"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Valid values are: ",(0,t.jsx)(s.code,{children:"'visible'"}),", ",(0,t.jsx)(s.code,{children:"'hidden'"}),", and ",(0,t.jsx)(s.code,{children:"'auto'"}),"."]}),"\n"]}),(0,t.jsx)(s.p,{children:"The base visibility of the scrollbars."}),(0,t.jsx)(s.h3,{id:"scrollbarsautohide",children:(0,t.jsx)(s.code,{children:"scrollbars.autoHide"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'never'"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Valid values are: ",(0,t.jsx)(s.code,{children:"'never'"}),", ",(0,t.jsx)(s.code,{children:"'scroll'"}),", ",(0,t.jsx)(s.code,{children:"'leave'"})," and ",(0,t.jsx)(s.code,{children:"'move'"}),"."]}),"\n"]}),(0,t.jsx)(s.p,{children:"The possibility to hide visible scrollbars automatically after a certain user action."}),(0,t.jsx)(s.h3,{id:"scrollbarsautohidedelay",children:(0,t.jsx)(s.code,{children:"scrollbars.autoHideDelay"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"number"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"1300"})})]})})]}),(0,t.jsx)(s.p,{children:"The delay in milliseconds before the scrollbars are hidden automatically."}),(0,t.jsx)(s.h3,{id:"scrollbarsdragscroll",children:(0,t.jsx)(s.code,{children:"scrollbars.dragScroll"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"boolean"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"true"})})]})})]}),(0,t.jsx)(s.p,{children:"Indicates whether you can drag the scrollbar handles for scrolling."}),(0,t.jsx)(s.h3,{id:"scrollbarsclickscroll",children:(0,t.jsx)(s.code,{children:"scrollbars.clickScroll"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"boolean"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"false"})})]})})]}),(0,t.jsx)(s.p,{children:"Indicates whether you can click on the scrollbar track for scrolling."}),(0,t.jsx)(s.h3,{id:"scrollbarspointers",children:(0,t.jsx)(s.code,{children:"scrollbars.pointers"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string[] | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"['mouse', 'touch', 'pen']"})})]})})]}),(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType",children:(0,t.jsx)(s.code,{children:"PointerTypes"})})," the plugin should react to."]})]}),"\n",(0,t.jsx)(s.h2,{id:"events",children:"Events"}),"\n",(0,t.jsxs)(s.p,{children:["You can initialize OverlayScrollbars with an initial set of events, which can be managed at any time with the ",(0,t.jsx)(s.code,{children:"on"})," and ",(0,t.jsx)(s.code,{children:"off"})," methods:"]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"), {}, {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"updated"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(osInstance, onUpdatedArgs) {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// ..."})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" }"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"});"})})]})})}),"\n",(0,t.jsx)(s.h3,{id:"events-in-depth",children:"Events in depth"}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsx)(s.p,{children:"This is a in depth topic. Click here to read it."})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Every event receives the ",(0,t.jsx)(s.code,{children:"instance"})," from which it was invoked as the first argument. Always."]}),"\n"]}),(0,t.jsx)(s.h3,{id:"initialized",children:(0,t.jsx)(s.code,{children:"initialized"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"arguments"}),(0,t.jsx)(s.th,{align:"left",children:"description"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"instance"})}),(0,t.jsx)(s.td,{align:"left",children:"The instance which invoked the event."})]})})]}),(0,t.jsx)(s.p,{children:"Is invoked after all generated elements, observers and events were appended to the DOM."}),(0,t.jsx)(s.h3,{id:"updated",children:(0,t.jsx)(s.code,{children:"updated"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"arguments"}),(0,t.jsx)(s.th,{align:"left",children:"description"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"instance"})}),(0,t.jsx)(s.td,{align:"left",children:"The instance which invoked the event."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"onUpdatedArgs"})}),(0,t.jsxs)(s.td,{align:"left",children:["An ",(0,t.jsx)(s.code,{children:"object"})," which describes the update in detail."]})]})]})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": If an update was triggered but nothing changed, the event won't be invoked."]}),"\n"]}),(0,t.jsx)(s.p,{children:"Is invoked after the instace was updated."}),(0,t.jsx)(s.h3,{id:"destroyed",children:(0,t.jsx)(s.code,{children:"destroyed"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"arguments"}),(0,t.jsx)(s.th,{align:"left",children:"description"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"instance"})}),(0,t.jsx)(s.td,{align:"left",children:"The instance which invoked the event."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"canceled"})}),(0,t.jsxs)(s.td,{align:"left",children:["An ",(0,t.jsx)(s.code,{children:"boolean"})," which indicates whether the initialization was canceled and thus destroyed."]})]})]})]}),(0,t.jsx)(s.p,{children:"Is invoked after all generated elements, observers and events were removed from the DOM."}),(0,t.jsx)(s.h3,{id:"scroll",children:(0,t.jsx)(s.code,{children:"scroll"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"arguments"}),(0,t.jsx)(s.th,{align:"left",children:"description"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"instance"})}),(0,t.jsx)(s.td,{align:"left",children:"The instance which invoked the event."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"event"})}),(0,t.jsxs)(s.td,{align:"left",children:["The original ",(0,t.jsx)(s.code,{children:"event"})," argument of the DOM event."]})]})]})]}),(0,t.jsx)(s.p,{children:"Is invoked by scrolling the viewport."})]}),"\n",(0,t.jsx)(s.h2,{id:"instance",children:"Instance"}),"\n",(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": For now please refer to the ",(0,t.jsx)("b",{children:"TypeScript definitions"})," for a more detailed description."]}),"\n"]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"ts","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"ts","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"interface"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"options"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Options"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"options"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(newOptions"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"PartialOptions"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", pure"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"?:"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"boolean"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Options"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"on"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(eventListeners"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListeners"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", pure"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"?:"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"boolean"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" () "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"=>"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"on"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"extends"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"keyof"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListenerArgs"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">(name"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", listener"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListener"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">)"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" () "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"=>"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"on"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"extends"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"keyof"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListenerArgs"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">(name"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", listener"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListener"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">[])"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" () "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"=>"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"off"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"extends"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"keyof"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListenerArgs"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">(name"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", listener"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListener"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">)"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"off"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"extends"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"keyof"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListenerArgs"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">(name"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", listener"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListener"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">[])"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"update"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(force"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"?:"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"boolean"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"boolean"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"state"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"State"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"elements"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Elements"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"destroy"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}"})})]})})}),"\n",(0,t.jsx)(s.h2,{id:"static-methods",children:"Static Methods"}),"\n",(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": For now please refer to the ",(0,t.jsx)("b",{children:"TypeScript definitions"})," for a more detailed description."]}),"\n"]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"ts","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"ts","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"interface"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbarsStatic"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" (target"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"InitializationTarget"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"|"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"undefined"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" (target"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"InitializationTarget"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", options"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"PartialOptions"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", eventListeners"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"?:"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListeners"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(plugin"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"|"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"[])"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"valid"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(osInstance"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"any"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" osInstance "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"is"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"env"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Environment"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}"})})]})})}),"\n",(0,t.jsx)(s.h2,{id:"plugins",children:"Plugins"}),"\n",(0,t.jsx)(s.p,{children:"Everything thats considered not core functionality or old browser compatibility is exposed via a plugin. This is done because all unused plugins are treeshaken and thus won't end up in your final bundle. OverlayScrollbars comes with the following plugins:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.strong,{children:"ScrollbarsHidingPlugin"}),": Is needed for old browsers which aren't supporting nativ scrollbar styling features. ",(0,t.jsx)(s.a,{href:"https://caniuse.com/?search=scrollbar%20styling",children:"You can find the list of browsers where you need this plugin here"})," (note that even though ",(0,t.jsx)(s.code,{children:"iOS Safari >= 14"})," is marked as unsupported you only need this plugin for ",(0,t.jsx)(s.code,{children:"iOS < 7.1"}),")."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.strong,{children:"SizeObserverPlugin"}),": Is needed for old browsers which aren't supporting the ",(0,t.jsx)(s.code,{children:"ResizeObserver"})," api. ",(0,t.jsx)(s.a,{href:"https://caniuse.com/?search=ResizeObserver",children:"You can find the list of browsers where you need this plugin here"})]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.strong,{children:"ClickScrollPlugin"}),": If you want to use the option ",(0,t.jsx)(s.code,{children:"scrollbars: { clickScroll: true }"}),"."]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"consuming-plugins",children:"Consuming Plugins"}),"\n",(0,t.jsx)(s.p,{children:"Plugins are consumed like:"}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"ts","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"ts","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#859900"},children:"import"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" { "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"ScrollbarsHidingPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"SizeObserverPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"ClickScrollPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"} "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"from"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'overlayscrollbars'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// single plugin"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"ScrollbarsHidingPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:");"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// multiple plugins"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(["}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"SizeObserverPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"ClickScrollPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"]);"})]})]})})}),"\n",(0,t.jsx)(s.h3,{id:"writing-plugins",children:"Writing Plugins"}),"\n",(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": For now please refer to the ",(0,t.jsx)("b",{children:"TypeScript definitions"})," for a more detailed description."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"You can write and publish your own Plugins. This section is a work in progress."}),"\n",(0,t.jsx)(s.h2,{id:"faq",children:"FAQ"}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsxs)(s.p,{children:["How do I ",(0,t.jsx)("code",{children:"get"})," the ",(0,t.jsx)("code",{children:"scroll position"})," of an element I applied the OverlayScrollbars to?"]})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.p,{children:["If you applied ",(0,t.jsx)(s.code,{children:"OverlayScrollbars"})," to the ",(0,t.jsx)(s.code,{children:"body"})," element you can use ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX",children:(0,t.jsx)(s.code,{children:"window.scrollX"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY",children:(0,t.jsx)(s.code,{children:"window.scrollY"})})," or any other native api."]}),(0,t.jsxs)(s.p,{children:["If the plugin was applied to any other element you have to get the ",(0,t.jsx)(s.code,{children:"instance"})," first. With the instance you can get the ",(0,t.jsx)(s.code,{children:"viewport"})," element. With this element you can use ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop",children:(0,t.jsx)(s.code,{children:"element.scrollTop"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft",children:(0,t.jsx)(s.code,{children:"element.scrollLeft"})})," or any other native api."]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" { "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"viewport"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" } "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"osInstance"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"elements"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"();"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" { "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"scrollLeft"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"scrollTop"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" } "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"viewport"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]})]})})})]}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsxs)(s.p,{children:["How do I ",(0,t.jsx)("code",{children:"set"})," the ",(0,t.jsx)("code",{children:"scroll position"})," of an element I applied the OverlayScrollbars to?"]})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.p,{children:["If you applied ",(0,t.jsx)(s.code,{children:"OverlayScrollbars"})," to the ",(0,t.jsx)(s.code,{children:"body"})," element you can scroll it with ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll",children:(0,t.jsx)(s.code,{children:"window.scroll"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo",children:(0,t.jsx)(s.code,{children:"window.scrollTo"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy",children:(0,t.jsx)(s.code,{children:"window.scrollBy"})})," or any other native api."]}),(0,t.jsxs)(s.p,{children:["If the plugin was applied to any other element you have to get the ",(0,t.jsx)(s.code,{children:"instance"})," first. With the instance you can get the ",(0,t.jsx)(s.code,{children:"viewport"})," element. With this element you can use ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll",children:(0,t.jsx)(s.code,{children:"element.scroll"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo",children:(0,t.jsx)(s.code,{children:"element.scrollTo"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy",children:(0,t.jsx)(s.code,{children:"element.scrollBy"})})," or any other native api."]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" { "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"viewport"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" } "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"osInstance"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"elements"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"();"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"viewport"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"scrollTo"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ top: "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"0"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" });"})]})]})})})]}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsxs)(s.p,{children:["Is it possible to ",(0,t.jsx)("code",{children:"limit / adjust the scrollbar handle length"}),"?"]})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.p,{children:["You can adjust a scrollbars handle length by setting a ",(0,t.jsx)(s.code,{children:"min-width / min-height"})," and ",(0,t.jsx)(s.code,{children:"max-width / max-height"})," style:"]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"css","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"css","data-theme":"default",children:[(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"/* horizontal boundaries */"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:".os-scrollbar-horizontal"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:".os-scrollbar-handle"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"min-width"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:": "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"50"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"px"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"max-width"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:": "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"200"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"px"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"/* vertical boundaries */"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:".os-scrollbar-vertical"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:".os-scrollbar-handle"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"min-height"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:": "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"40"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"px"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"max-height"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:": "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"40"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"px"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}"})})]})})}),(0,t.jsxs)(s.p,{children:["You can assign the same value to both properties to force the scrollbar to be always the same size.",(0,t.jsx)(s.br,{}),"\n","Setting the ",(0,t.jsx)(s.code,{children:"width"})," and ",(0,t.jsx)(s.code,{children:"height"})," properties won't work since those are set by the plugin automatically."]})]}),"\n",(0,t.jsxs)(s.h2,{id:"feature-comparison-to-v1",children:["Feature comparison to ",(0,t.jsx)(s.code,{children:"v1"})]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["The ",(0,t.jsx)(s.code,{children:"scroll"})," function is missing. Planned as a ",(0,t.jsx)(s.code,{children:"plugin"}),". (WIP)"]}),"\n",(0,t.jsxs)(s.li,{children:["Initialization to the ",(0,t.jsx)(s.code,{children:"textarea"})," element isn't supported yet. Planned as a ",(0,t.jsx)(s.code,{children:"plugin"}),". (WIP)"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"future-plans",children:"Future Plans"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:"Provide plugin based support for missing features. (treeshakeable)"}),"\n",(0,t.jsx)(s.li,{children:"Frequent updates in terms of bug-fixes and enhancements. (always use latest browser features)"}),"\n",(0,t.jsx)(s.li,{children:"Improve tests. (unit & browser tests)"}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"license",children:"License"}),"\n",(0,t.jsx)(s.p,{children:"MIT"})]})}var f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=Object.assign({},(0,g.ah)(),e.components).wrapper;return s?(0,t.jsx)(s,Object.assign({},e,{children:(0,t.jsx)(B,e)})):B(e)},b=l(4028),v=l.n(b),w=function(e){return(0,t.jsx)("div",{className:"my-6 text-center font-medium text-sm uppercase relative",children:(0,t.jsxs)("span",{className:"p-3 bg-white",children:[e,(0,t.jsx)("div",{className:"absolute block top-1/2 left-1/2 w-[100%] xs:w-[80%] border-t-[1px] border-slate-300 translate-x-[-50%] translate-y-[-50%] z-[-1]"})]})})},N=function(){return(0,t.jsxs)(h,{className:"px-6",children:[(0,t.jsx)("div",{className:"mt-8 flex justify-center items-center h-[33vh] min-h-32 max-h-40 xxs:max-h-44",children:(0,t.jsx)("div",{className:a()("h-full",v().logo),children:(0,t.jsx)("img",{src:j.src,className:"h-full",alt:"OverlayScrollbars Logo",width:"200",height:"200"})})}),(0,t.jsxs)("h1",{className:"text-center xxs:text-4xl text-2xl font-bold my-11",children:["Overlay",(0,t.jsx)("wbr",{}),"Scrollbars"]}),(0,t.jsx)("p",{className:"text-center mx-auto max-w-screen-sm my-11 font-medium",children:"A javascript scrollbar plugin that hides native scrollbars, provides custom styleable overlay scrollbars and keeps the native functionality and feeling."}),w("used by"),(0,t.jsx)(x.E,{defer:!0,children:(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsxs)("div",{className:a()("inline-flex items-center gap-6 py-6",v().usedBy),children:[(0,t.jsx)("div",{className:"h-11 px-3 flex-grow flex-shrink-0",style:{filter:"brightness(0.35)"},children:(0,t.jsx)("img",{className:"h-full",src:p.src,alt:""})}),(0,t.jsx)("div",{className:"h-11 px-3 py-1.5 flex-grow flex-shrink-0",children:(0,t.jsx)("img",{className:"h-full",src:y.src,alt:""})}),(0,t.jsx)("div",{className:"h-11 p-3 flex-grow flex-shrink-0",children:(0,t.jsx)("img",{className:"h-full",src:m.src,alt:""})})]})})}),w((0,t.jsxs)("a",{href:"https://github.com/KingSora/OverlayScrollbars",target:"_blank",rel:"noreferrer",children:[(0,t.jsx)(d,{className:"inline-block w-11 hover:scale-110 text-primary-dark hover:text-primary-blue1 active:text-primary-blue2 transition-transformColor ease-in-out duration-300",svg:u,icon:"github"}),(0,t.jsx)("span",{className:"sr-only",children:"OverlayScrollbars on Github"})]})),(0,t.jsxs)("p",{className:"text-center text-sm text-primary-gray2 mx-auto max-w-screen-sm my-11 font-medium",children:["This page is a work in progress. For now refer to the TypeScript definitions for a more detailed documentation.",(0,t.jsx)("br",{}),"Looking for the v1 docs?"," ",(0,t.jsx)("a",{href:"v1",className:"text-primary-blue2 underline",children:"Follow this link"}),"."]}),(0,t.jsxs)("div",{className:"mx-auto flex sm:flex-row justify-center gap-2 items-center flex-wrap",children:[(0,t.jsx)("a",{href:"https://www.npmjs.com/package/overlayscrollbars",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/npm/dm/overlayscrollbars.svg?style=flat-square",alt:"Downloads"})}),(0,t.jsx)("a",{href:"https://www.npmjs.com/package/overlayscrollbars",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/npm/v/overlayscrollbars.svg?style=flat-square",alt:"Version"})}),(0,t.jsx)("a",{href:"https://github.com/KingSora/OverlayScrollbars/blob/master/LICENSE",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/github/license/kingsora/overlayscrollbars.svg?style=flat-square",alt:"License"})}),(0,t.jsx)("a",{href:"https://app.codecov.io/gh/KingSora/OverlayScrollbars",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/codecov/c/github/KingSora/OverlayScrollbars?style=flat-square",alt:"Code Coverage"})}),(0,t.jsx)("a",{href:"https://bundlephobia.com/package/overlayscrollbars",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/bundlephobia/minzip/overlayscrollbars?label=max.%20bundle%20size&style=flat-square",alt:"Max. Bundle Size"})})]}),(0,t.jsx)("div",{className:"mt-11 prose prose-primary mx-auto pb-32",children:(0,t.jsx)(f,{})})]})}},4028:function(e){e.exports={logo:"assets_logo__UC59w",usedBySeparator:"assets_usedBySeparator__yqt5h",usedBy:"assets_usedBy__FHTGG"}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=2766)}),_N_E=e.O()}]); \ No newline at end of file +*/ !function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],s=0;s"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"script"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"type"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:'"text/javascript"'}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"src"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:'"path/to/overlayscrollbars.js"'}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"defer>"})]})]})})})]}),"\n",(0,t.jsx)(s.h2,{id:"initialization",children:"Initialization"}),"\n",(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": During initialization its expected that the ",(0,t.jsx)("b",{children:"CSS file is loaded and parsed"})," by the browser."]}),"\n"]}),"\n",(0,t.jsxs)(s.p,{children:["You can initialize either directly with an ",(0,t.jsx)(s.code,{children:"Element"})," or with an ",(0,t.jsx)(s.code,{children:"Object"})," where you have more control over the initialization process."]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// simple initialization with an element"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"osInstance"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"), {});"})]})]})})}),"\n",(0,t.jsx)(s.h3,{id:"bridging-initialization-flickering",children:"Bridging initialization flickering"}),"\n",(0,t.jsx)(s.p,{children:"If you initialize OverlayScrollbars it needs a few milliseconds to create and append all the elements to the DOM.\r\nWhile this period the native scrollbars are still visible and are switched out after the initialization is finished. This is perceived as flickering."}),"\n",(0,t.jsxs)(s.p,{children:["To fix this behavior apply the ",(0,t.jsx)(s.code,{children:"data-overlayscrollbars-initialize"})," attribute to the target element (and ",(0,t.jsx)(s.code,{children:"html"})," element if the target element is ",(0,t.jsx)(s.code,{children:"body"}),")."]}),"\n",(0,t.jsx)(s.h3,{id:"initialization-with-an-object",children:"Initialization with an Object"}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsx)(s.p,{children:"This is a in depth topic. Click here to read it."})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": For now please refer to the ",(0,t.jsx)("b",{children:"TypeScript definitions"})," for a more detailed description of all possibilities."]}),"\n"]}),(0,t.jsxs)(s.p,{children:["The only required field is the ",(0,t.jsx)(s.code,{children:"target"})," field. This is the field to which the plugin is applied to.",(0,t.jsx)(s.br,{}),"\n","If you use the object initialization only with the ",(0,t.jsx)(s.code,{children:"target"})," field, the outcome is equivalent to the element initialization:"]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// Both initializations have the same outcome"})}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"), {});"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ target: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:") }, {});"})]})]})})}),(0,t.jsxs)(s.p,{children:["In the initialization object you can specify how the library is handling generated elements.\r\nFor example you can appoint an existing element as the ",(0,t.jsx)(s.code,{children:"viewport"})," element. Like this the library won't generate it but take the specified element instead:"]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" target: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#target'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"),"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" elements: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" viewport: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#viewport'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"),"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}, {});"})})]})})}),(0,t.jsx)(s.p,{children:"This is very useful if you have a fixed DOM structure and don't want OverlayScrollbars to generate its own elements. Those cases arise very often when you want an other library to work together with OverlayScrollbars."}),(0,t.jsx)(s.hr,{}),(0,t.jsx)(s.p,{children:"You can also decide to which element the scrollbars should be applied to:"}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" target: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#target'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"),"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" scrollbars: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" slot: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#target'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"parentElement"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}, {});"})})]})})}),(0,t.jsx)(s.hr,{}),(0,t.jsx)(s.p,{children:"And last but not least you can decide when the initialization should be canceled:"}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" target: "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#target'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"),"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" cancel: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" nativeScrollbarsOverlaid: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"true"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" body: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"null"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" }"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}, {});"})})]})})}),(0,t.jsxs)(s.p,{children:["In the above example the initialization is canceled when the native scrollbars are overlaid or when your target is a ",(0,t.jsx)(s.code,{children:"body"})," element and the plugin determined that a initialization to the ",(0,t.jsx)(s.code,{children:"body"})," element would affect native functionality like ",(0,t.jsx)(s.code,{children:"window.scrollTo"}),"."]})]}),"\n",(0,t.jsx)(s.h2,{id:"options",children:"Options"}),"\n",(0,t.jsxs)(s.p,{children:["You can initialize OverlayScrollbars with an initial set of options, which can be changed at any time with the ",(0,t.jsx)(s.code,{children:"options"})," method:"]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"), {"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" overflow: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" x: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'hidden'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"});"})})]})})}),"\n",(0,t.jsx)(s.h3,{id:"options-in-depth",children:"Options in depth"}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsx)(s.p,{children:"This is a in depth topic. Click here to read it."})}),(0,t.jsx)("br",{}),(0,t.jsx)(s.p,{children:"The default options are:"}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"defaultOptions"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" paddingAbsolute: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"false"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" showNativeOverlaidScrollbars: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"false"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" update: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" elementEvents: [["}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'img'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'load'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"]],"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" debounce: ["}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"0"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"33"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"],"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" attributes: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"null"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" ignoreMutation: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"null"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" overflow: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" x: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'scroll'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" y: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'scroll'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" scrollbars: {"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" theme: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'os-theme-dark'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" visibility: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'auto'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" autoHide: "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'never'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" autoHideDelay: "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"1300"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" dragScroll: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"true"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" clickScroll: "}),(0,t.jsx)(s.span,{style:{color:"#B58900"},children:"false"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:","})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" pointers: ["}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'mouse'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'touch'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'pen'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"],"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" },"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"};"})})]})})}),(0,t.jsx)(s.h3,{id:"paddingabsolute",children:(0,t.jsx)(s.code,{children:"paddingAbsolute"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"boolean"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"false"})})]})})]}),(0,t.jsx)(s.p,{children:"Indicates whether the padding for the content shall be absolute."}),(0,t.jsx)(s.h3,{id:"shownativeoverlaidscrollbars",children:(0,t.jsx)(s.code,{children:"showNativeOverlaidScrollbars"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"boolean"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"false"})})]})})]}),(0,t.jsx)(s.p,{children:"Indicates whether the native overlaid scrollbars shall be visible."}),(0,t.jsx)(s.h3,{id:"updateelementevents",children:(0,t.jsx)(s.code,{children:"update.elementEvents"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"Array<[string, string]> | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"[['img', 'load']]"})})]})})]}),(0,t.jsxs)(s.p,{children:["An array of tuples. The first value in the tuple is an ",(0,t.jsx)(s.code,{children:"selector"})," and the second value are ",(0,t.jsx)(s.code,{children:"event names"}),'. The plugin will update itself if any of the elements with the specified selector will emit any specified event. The default value can be interpreted as "The plugin will update itself if any ',(0,t.jsx)(s.code,{children:"img"})," element emits an ",(0,t.jsx)(s.code,{children:"load"}),' event."']}),(0,t.jsx)(s.h3,{id:"updatedebounce",children:(0,t.jsx)(s.code,{children:"update.debounce"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"[number, number] | number | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"[0, 33]"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": If 0 is used for the timeout, ",(0,t.jsx)(s.code,{children:"requestAnimationFrame"})," instead of ",(0,t.jsx)(s.code,{children:"setTimeout"})," is used for the debounce."]}),"\n"]}),(0,t.jsxs)(s.p,{children:["Debounces the ",(0,t.jsx)(s.code,{children:"MutationObserver"})," which tracks changes to the content. If a ",(0,t.jsx)(s.strong,{children:"tuple"})," is passed, the first value is the timeout and second is the max wait. If only a ",(0,t.jsx)(s.strong,{children:"number"})," is passed you specify only the timeout and there is no max wait. With ",(0,t.jsx)(s.strong,{children:"null"})," there is no debounce. ",(0,t.jsx)(s.strong,{children:"Usefull to fine-tune performance."})]}),(0,t.jsx)(s.h3,{id:"updateattributes",children:(0,t.jsx)(s.code,{children:"update.attributes"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string[] | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"null"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": There is a base array of attributes that the ",(0,t.jsx)(s.code,{children:"MutationObserver"})," always observes, even if this option is ",(0,t.jsx)(s.code,{children:"null"}),"."]}),"\n"]}),(0,t.jsxs)(s.p,{children:["An array of additional attributes that the ",(0,t.jsx)(s.code,{children:"MutationObserver"})," should observe for the content."]}),(0,t.jsx)(s.h3,{id:"updateignoremutation",children:(0,t.jsx)(s.code,{children:"update.ignoreMutation"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"((mutation) => any) | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"null"})})]})})]}),(0,t.jsxs)(s.p,{children:["A function which receives a ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord",children:(0,t.jsx)(s.code,{children:"MutationRecord"})})," as an argument. If the function returns a truthy value the mutation will be ignored and the plugin won't update. ",(0,t.jsx)(s.strong,{children:"Usefull to fine-tune performance."})]}),(0,t.jsx)(s.h3,{id:"overflowx",children:(0,t.jsx)(s.code,{children:"overflow.x"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'scroll'"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Valid values are: ",(0,t.jsx)(s.code,{children:"'hidden'"}),", ",(0,t.jsx)(s.code,{children:"'scroll'"}),", ",(0,t.jsx)(s.code,{children:"'visible'"}),", ",(0,t.jsx)(s.code,{children:"'visible-hidden'"})," and ",(0,t.jsx)(s.code,{children:"'visible-scroll'"}),"."]}),"\n"]}),(0,t.jsx)(s.p,{children:"The overflow behavior for the horizontal (x) axis."}),(0,t.jsx)(s.h3,{id:"overflowy",children:(0,t.jsx)(s.code,{children:"overflow.y"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'scroll'"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Valid values are: ",(0,t.jsx)(s.code,{children:"'hidden'"}),", ",(0,t.jsx)(s.code,{children:"'scroll'"}),", ",(0,t.jsx)(s.code,{children:"'visible'"}),", ",(0,t.jsx)(s.code,{children:"'visible-hidden'"})," and ",(0,t.jsx)(s.code,{children:"'visible-scroll'"}),"."]}),"\n"]}),(0,t.jsx)(s.p,{children:"The overflow behavior for the vertical (y) axis."}),(0,t.jsx)(s.h3,{id:"scrollbarstheme",children:(0,t.jsx)(s.code,{children:"scrollbars.theme"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'os-theme-dark'"})})]})})]}),(0,t.jsx)(s.p,{children:"Applies the specified theme (classname) to the scrollbars."}),(0,t.jsx)(s.h3,{id:"scrollbarsvisibility",children:(0,t.jsx)(s.code,{children:"scrollbars.visibility"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'auto'"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Valid values are: ",(0,t.jsx)(s.code,{children:"'visible'"}),", ",(0,t.jsx)(s.code,{children:"'hidden'"}),", and ",(0,t.jsx)(s.code,{children:"'auto'"}),"."]}),"\n"]}),(0,t.jsx)(s.p,{children:"The base visibility of the scrollbars."}),(0,t.jsx)(s.h3,{id:"scrollbarsautohide",children:(0,t.jsx)(s.code,{children:"scrollbars.autoHide"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"'never'"})})]})})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Valid values are: ",(0,t.jsx)(s.code,{children:"'never'"}),", ",(0,t.jsx)(s.code,{children:"'scroll'"}),", ",(0,t.jsx)(s.code,{children:"'leave'"})," and ",(0,t.jsx)(s.code,{children:"'move'"}),"."]}),"\n"]}),(0,t.jsx)(s.p,{children:"The possibility to hide visible scrollbars automatically after a certain user action."}),(0,t.jsx)(s.h3,{id:"scrollbarsautohidedelay",children:(0,t.jsx)(s.code,{children:"scrollbars.autoHideDelay"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"number"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"1300"})})]})})]}),(0,t.jsx)(s.p,{children:"The delay in milliseconds before the scrollbars are hidden automatically."}),(0,t.jsx)(s.h3,{id:"scrollbarsdragscroll",children:(0,t.jsx)(s.code,{children:"scrollbars.dragScroll"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"boolean"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"true"})})]})})]}),(0,t.jsx)(s.p,{children:"Indicates whether you can drag the scrollbar handles for scrolling."}),(0,t.jsx)(s.h3,{id:"scrollbarsclickscroll",children:(0,t.jsx)(s.code,{children:"scrollbars.clickScroll"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"boolean"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"false"})})]})})]}),(0,t.jsx)(s.p,{children:"Indicates whether you can click on the scrollbar track for scrolling."}),(0,t.jsx)(s.h3,{id:"scrollbarspointers",children:(0,t.jsx)(s.code,{children:"scrollbars.pointers"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"type"}),(0,t.jsx)(s.th,{align:"left",children:"default"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"string[] | null"})}),(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"['mouse', 'touch', 'pen']"})})]})})]}),(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType",children:(0,t.jsx)(s.code,{children:"PointerTypes"})})," the plugin should react to."]})]}),"\n",(0,t.jsx)(s.h2,{id:"events",children:"Events"}),"\n",(0,t.jsxs)(s.p,{children:["You can initialize OverlayScrollbars with an initial set of events, which can be managed at any time with the ",(0,t.jsx)(s.code,{children:"on"})," and ",(0,t.jsx)(s.code,{children:"off"})," methods:"]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"document"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"querySelector"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'#myElement'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"), {}, {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"updated"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(osInstance, onUpdatedArgs) {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// ..."})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" }"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"});"})})]})})}),"\n",(0,t.jsx)(s.h3,{id:"events-in-depth",children:"Events in depth"}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsx)(s.p,{children:"This is a in depth topic. Click here to read it."})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": Every event receives the ",(0,t.jsx)(s.code,{children:"instance"})," from which it was invoked as the first argument. Always."]}),"\n"]}),(0,t.jsx)(s.h3,{id:"initialized",children:(0,t.jsx)(s.code,{children:"initialized"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"arguments"}),(0,t.jsx)(s.th,{align:"left",children:"description"})]})}),(0,t.jsx)(s.tbody,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"instance"})}),(0,t.jsx)(s.td,{align:"left",children:"The instance which invoked the event."})]})})]}),(0,t.jsx)(s.p,{children:"Is invoked after all generated elements, observers and events were appended to the DOM."}),(0,t.jsx)(s.h3,{id:"updated",children:(0,t.jsx)(s.code,{children:"updated"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"arguments"}),(0,t.jsx)(s.th,{align:"left",children:"description"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"instance"})}),(0,t.jsx)(s.td,{align:"left",children:"The instance which invoked the event."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"onUpdatedArgs"})}),(0,t.jsxs)(s.td,{align:"left",children:["An ",(0,t.jsx)(s.code,{children:"object"})," which describes the update in detail."]})]})]})]}),(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": If an update was triggered but nothing changed, the event won't be invoked."]}),"\n"]}),(0,t.jsx)(s.p,{children:"Is invoked after the instace was updated."}),(0,t.jsx)(s.h3,{id:"destroyed",children:(0,t.jsx)(s.code,{children:"destroyed"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"arguments"}),(0,t.jsx)(s.th,{align:"left",children:"description"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"instance"})}),(0,t.jsx)(s.td,{align:"left",children:"The instance which invoked the event."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"canceled"})}),(0,t.jsxs)(s.td,{align:"left",children:["An ",(0,t.jsx)(s.code,{children:"boolean"})," which indicates whether the initialization was canceled and thus destroyed."]})]})]})]}),(0,t.jsx)(s.p,{children:"Is invoked after all generated elements, observers and events were removed from the DOM."}),(0,t.jsx)(s.h3,{id:"scroll",children:(0,t.jsx)(s.code,{children:"scroll"})}),(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{align:"left",children:"arguments"}),(0,t.jsx)(s.th,{align:"left",children:"description"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"instance"})}),(0,t.jsx)(s.td,{align:"left",children:"The instance which invoked the event."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{align:"left",children:(0,t.jsx)(s.code,{children:"event"})}),(0,t.jsxs)(s.td,{align:"left",children:["The original ",(0,t.jsx)(s.code,{children:"event"})," argument of the DOM event."]})]})]})]}),(0,t.jsx)(s.p,{children:"Is invoked by scrolling the viewport."})]}),"\n",(0,t.jsx)(s.h2,{id:"instance",children:"Instance"}),"\n",(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": For now please refer to the ",(0,t.jsx)("b",{children:"TypeScript definitions"})," for a more detailed description."]}),"\n"]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"ts","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"ts","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"interface"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"options"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Options"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"options"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(newOptions"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"PartialOptions"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", pure"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"?:"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"boolean"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Options"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"on"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(eventListeners"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListeners"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", pure"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"?:"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"boolean"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" () "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"=>"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"on"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"extends"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"keyof"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListenerArgs"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">(name"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", listener"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListener"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">)"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" () "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"=>"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"on"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"extends"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"keyof"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListenerArgs"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">(name"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", listener"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListener"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">[])"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" () "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"=>"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"off"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"extends"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"keyof"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListenerArgs"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">(name"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", listener"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListener"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">)"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"off"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"extends"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"keyof"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListenerArgs"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">(name"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", listener"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListener"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"<"}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"N"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:">[])"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"update"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(force"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"?:"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"boolean"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"boolean"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"state"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"State"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"elements"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Elements"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"destroy"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}"})})]})})}),"\n",(0,t.jsx)(s.h2,{id:"static-methods",children:"Static Methods"}),"\n",(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": For now please refer to the ",(0,t.jsx)("b",{children:"TypeScript definitions"})," for a more detailed description."]}),"\n"]}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"ts","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"ts","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"interface"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbarsStatic"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" (target"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"InitializationTarget"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"|"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"undefined"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" (target"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"InitializationTarget"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", options"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"PartialOptions"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", eventListeners"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"?:"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"EventListeners"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(plugin"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"|"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"[])"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"void"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"valid"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(osInstance"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"any"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:")"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" osInstance "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"is"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"env"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"()"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:":"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#CB4B16"},children:"Environment"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}"})})]})})}),"\n",(0,t.jsx)(s.h2,{id:"plugins",children:"Plugins"}),"\n",(0,t.jsx)(s.p,{children:"Everything thats considered not core functionality or old browser compatibility is exposed via a plugin. This is done because all unused plugins are treeshaken and thus won't end up in your final bundle. OverlayScrollbars comes with the following plugins:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.strong,{children:"ScrollbarsHidingPlugin"}),": Is needed for old browsers which aren't supporting nativ scrollbar styling features. ",(0,t.jsx)(s.a,{href:"https://caniuse.com/?search=scrollbar%20styling",children:"You can find the list of browsers where you need this plugin here"})," (note that even though ",(0,t.jsx)(s.code,{children:"iOS Safari >= 14"})," is marked as unsupported you only need this plugin for ",(0,t.jsx)(s.code,{children:"iOS < 7.1"}),")."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.strong,{children:"SizeObserverPlugin"}),": Is needed for old browsers which aren't supporting the ",(0,t.jsx)(s.code,{children:"ResizeObserver"})," api. ",(0,t.jsx)(s.a,{href:"https://caniuse.com/?search=ResizeObserver",children:"You can find the list of browsers where you need this plugin here"})]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.strong,{children:"ClickScrollPlugin"}),": If you want to use the option ",(0,t.jsx)(s.code,{children:"scrollbars: { clickScroll: true }"}),"."]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"consuming-plugins",children:"Consuming Plugins"}),"\n",(0,t.jsx)(s.p,{children:"Plugins are consumed like:"}),"\n",(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"ts","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"ts","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#859900"},children:"import"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" { "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"ScrollbarsHidingPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"SizeObserverPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"ClickScrollPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"} "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"from"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#2AA198"},children:"'overlayscrollbars'"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// single plugin"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"("}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"ScrollbarsHidingPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:");"})]}),"\n",(0,t.jsx)(s.span,{className:"line"}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// multiple plugins"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"OverlayScrollbars"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"plugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"(["}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"SizeObserverPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"ClickScrollPlugin"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"]);"})]})]})})}),"\n",(0,t.jsx)(s.h3,{id:"writing-plugins",children:"Writing Plugins"}),"\n",(0,t.jsxs)(s.blockquote,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Note"}),": For now please refer to the ",(0,t.jsx)("b",{children:"TypeScript definitions"})," for a more detailed description."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"You can write and publish your own Plugins. This section is a work in progress."}),"\n",(0,t.jsx)(s.h2,{id:"faq",children:"FAQ"}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsxs)(s.p,{children:["How do I ",(0,t.jsx)("code",{children:"get / set"})," the ",(0,t.jsx)("code",{children:"scroll position"})," of an element I applied the OverlayScrollbars to?"]})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.p,{children:["If you applied ",(0,t.jsx)(s.code,{children:"OverlayScrollbars"})," to the ",(0,t.jsx)(s.code,{children:"body"})," element you can use ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX",children:(0,t.jsx)(s.code,{children:"window.scrollX"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY",children:(0,t.jsx)(s.code,{children:"window.scrollY"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll",children:(0,t.jsx)(s.code,{children:"window.scroll"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo",children:(0,t.jsx)(s.code,{children:"window.scrollTo"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy",children:(0,t.jsx)(s.code,{children:"window.scrollBy"})})," or any other native api."]}),(0,t.jsxs)(s.p,{children:["If the plugin was applied to any other element you have to get the ",(0,t.jsx)(s.code,{children:"viewport"})," element with the ",(0,t.jsx)(s.code,{children:"instance.elements()"})," function first. With this element you can use ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop",children:(0,t.jsx)(s.code,{children:"element.scrollTop"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft",children:(0,t.jsx)(s.code,{children:"element.scrollLeft"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll",children:(0,t.jsx)(s.code,{children:"element.scroll"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo",children:(0,t.jsx)(s.code,{children:"element.scrollTo"})}),", ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy",children:(0,t.jsx)(s.code,{children:"element.scrollBy"})})," or any other native api."]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"js","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" { "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"viewport"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" } "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"osInstance"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"elements"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"();"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#586E75",fontStyle:"italic"},children:"const"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" { "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"scrollLeft"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:", "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"scrollTop"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" } "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"="}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"viewport"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"; "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// get scroll offset"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"viewport"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"."}),(0,t.jsx)(s.span,{style:{color:"#268BD2"},children:"scrollTo"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"({ top: "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"0"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" }); "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"// set scroll offset"})]})]})})})]}),"\n",(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:(0,t.jsxs)(s.p,{children:["Is it possible to ",(0,t.jsx)("code",{children:"limit / adjust the scrollbar handle length"}),"?"]})}),(0,t.jsx)("br",{}),(0,t.jsxs)(s.p,{children:["You can adjust a scrollbars handle length by setting a ",(0,t.jsx)(s.code,{children:"min-width / min-height"})," and ",(0,t.jsx)(s.code,{children:"max-width / max-height"})," style:"]}),(0,t.jsx)(s.div,{"data-rehype-pretty-code-fragment":"",children:(0,t.jsx)(s.pre,{"data-language":"css","data-theme":"default",children:(0,t.jsxs)(s.code,{"data-language":"css","data-theme":"default",children:[(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"/* horizontal boundaries */"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:".os-scrollbar-horizontal"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:".os-scrollbar-handle"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"min-width"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:": "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"50"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"px"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"max-width"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:": "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"200"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"px"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}"})}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:"/* vertical boundaries */"})}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:".os-scrollbar-vertical"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#93A1A1"},children:".os-scrollbar-handle"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" {"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"min-height"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:": "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"40"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"px"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsxs)(s.span,{className:"line",children:[(0,t.jsx)(s.span,{style:{color:"#657B83"},children:" "}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"max-height"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:": "}),(0,t.jsx)(s.span,{style:{color:"#D33682"},children:"40"}),(0,t.jsx)(s.span,{style:{color:"#859900"},children:"px"}),(0,t.jsx)(s.span,{style:{color:"#657B83"},children:";"})]}),"\n",(0,t.jsx)(s.span,{className:"line",children:(0,t.jsx)(s.span,{style:{color:"#657B83"},children:"}"})})]})})}),(0,t.jsxs)(s.p,{children:["You can assign the same value to both properties to force the scrollbar to be always the same size.",(0,t.jsx)(s.br,{}),"\n","Setting the ",(0,t.jsx)(s.code,{children:"width"})," and ",(0,t.jsx)(s.code,{children:"height"})," properties won't work since those are set by the plugin automatically."]})]}),"\n",(0,t.jsxs)(s.h2,{id:"feature-comparison-to-v1",children:["Feature comparison to ",(0,t.jsx)(s.code,{children:"v1"})]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["The ",(0,t.jsx)(s.code,{children:"scroll"})," function is missing. Planned as a ",(0,t.jsx)(s.code,{children:"plugin"}),". (WIP)"]}),"\n",(0,t.jsxs)(s.li,{children:["Initialization to the ",(0,t.jsx)(s.code,{children:"textarea"})," element isn't supported yet. Planned as a ",(0,t.jsx)(s.code,{children:"plugin"}),". (WIP)"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"future-plans",children:"Future Plans"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:"Provide plugin based support for missing features. (treeshakeable)"}),"\n",(0,t.jsx)(s.li,{children:"Frequent updates in terms of bug-fixes and enhancements. (always use latest browser features)"}),"\n",(0,t.jsx)(s.li,{children:"Improve tests. (unit & browser tests)"}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"license",children:"License"}),"\n",(0,t.jsx)(s.p,{children:"MIT"})]})}var f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=Object.assign({},(0,g.ah)(),e.components).wrapper;return s?(0,t.jsx)(s,Object.assign({},e,{children:(0,t.jsx)(B,e)})):B(e)},b=l(4028),v=l.n(b),w=function(e){return(0,t.jsx)("div",{className:"my-6 text-center font-medium text-sm uppercase relative",children:(0,t.jsxs)("span",{className:"p-3 bg-white",children:[e,(0,t.jsx)("div",{className:"absolute block top-1/2 left-1/2 w-[100%] xs:w-[80%] border-t-[1px] border-slate-300 translate-x-[-50%] translate-y-[-50%] z-[-1]"})]})})},N=function(){return(0,t.jsxs)(h,{className:"px-6",children:[(0,t.jsx)("div",{className:"mt-8 flex justify-center items-center h-[33vh] min-h-32 max-h-40 xxs:max-h-44",children:(0,t.jsx)("div",{className:a()("h-full",v().logo),children:(0,t.jsx)("img",{src:j.src,className:"h-full",alt:"OverlayScrollbars Logo",width:"200",height:"200"})})}),(0,t.jsxs)("h1",{className:"text-center xxs:text-4xl text-2xl font-bold my-11",children:["Overlay",(0,t.jsx)("wbr",{}),"Scrollbars"]}),(0,t.jsx)("p",{className:"text-center mx-auto max-w-screen-sm my-11 font-medium",children:"A javascript scrollbar plugin that hides native scrollbars, provides custom styleable overlay scrollbars and keeps the native functionality and feeling."}),w("used by"),(0,t.jsx)(x.E,{defer:!0,children:(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsxs)("div",{className:a()("inline-flex items-center gap-6 py-6",v().usedBy),children:[(0,t.jsx)("div",{className:"h-11 px-3 flex-grow flex-shrink-0",style:{filter:"brightness(0.35)"},children:(0,t.jsx)("img",{className:"h-full",src:p.src,alt:""})}),(0,t.jsx)("div",{className:"h-11 px-3 py-1.5 flex-grow flex-shrink-0",children:(0,t.jsx)("img",{className:"h-full",src:y.src,alt:""})}),(0,t.jsx)("div",{className:"h-11 p-3 flex-grow flex-shrink-0",children:(0,t.jsx)("img",{className:"h-full",src:m.src,alt:""})})]})})}),w((0,t.jsxs)("a",{href:"https://github.com/KingSora/OverlayScrollbars",target:"_blank",rel:"noreferrer",children:[(0,t.jsx)(d,{className:"inline-block w-11 hover:scale-110 text-primary-dark hover:text-primary-blue1 active:text-primary-blue2 transition-transformColor ease-in-out duration-300",svg:u,icon:"github"}),(0,t.jsx)("span",{className:"sr-only",children:"OverlayScrollbars on Github"})]})),(0,t.jsxs)("p",{className:"text-center text-sm text-primary-gray2 mx-auto max-w-screen-sm my-11 font-medium",children:["This page is a work in progress. For now refer to the TypeScript definitions for a more detailed documentation.",(0,t.jsx)("br",{}),"Looking for the v1 docs?"," ",(0,t.jsx)("a",{href:"v1",className:"text-primary-blue2 underline",children:"Follow this link"}),"."]}),(0,t.jsxs)("div",{className:"mx-auto flex sm:flex-row justify-center gap-2 items-center flex-wrap",children:[(0,t.jsx)("a",{href:"https://www.npmjs.com/package/overlayscrollbars",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/npm/dm/overlayscrollbars.svg?style=flat-square",alt:"Downloads"})}),(0,t.jsx)("a",{href:"https://www.npmjs.com/package/overlayscrollbars",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/npm/v/overlayscrollbars.svg?style=flat-square",alt:"Version"})}),(0,t.jsx)("a",{href:"https://github.com/KingSora/OverlayScrollbars/blob/master/LICENSE",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/github/license/kingsora/overlayscrollbars.svg?style=flat-square",alt:"License"})}),(0,t.jsx)("a",{href:"https://app.codecov.io/gh/KingSora/OverlayScrollbars",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/codecov/c/github/KingSora/OverlayScrollbars?style=flat-square",alt:"Code Coverage"})}),(0,t.jsx)("a",{href:"https://bundlephobia.com/package/overlayscrollbars",children:(0,t.jsx)("img",{className:"min-h-[20px]",src:"https://img.shields.io/bundlephobia/minzip/overlayscrollbars?label=max.%20bundle%20size&style=flat-square",alt:"Max. Bundle Size"})})]}),(0,t.jsx)("div",{className:"mt-11 prose prose-primary mx-auto pb-32",children:(0,t.jsx)(f,{})})]})}},4028:function(e){e.exports={logo:"assets_logo__UC59w",usedBySeparator:"assets_usedBySeparator__yqt5h",usedBy:"assets_usedBy__FHTGG"}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=2766)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 28df3b4..076ed73 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -OverlayScrollbars
OverlayScrollbars Logo

OverlayScrollbars

A javascript scrollbar plugin that hides native scrollbars, provides custom styleable overlay scrollbars and keeps the native functionality and feeling.

used by

This page is a work in progress. For now refer to the TypeScript definitions for a more detailed documentation.
Looking for the v1 docs? Follow this link.

DownloadsVersionLicenseCode CoverageMax. Bundle Size

Why

+OverlayScrollbars
OverlayScrollbars Logo

OverlayScrollbars

A javascript scrollbar plugin that hides native scrollbars, provides custom styleable overlay scrollbars and keeps the native functionality and feeling.

used by

This page is a work in progress. For now refer to the TypeScript definitions for a more detailed documentation.
Looking for the v1 docs? Follow this link.

DownloadsVersionLicenseCode CoverageMax. Bundle Size

Why

I created this plugin because I hate ugly and space consuming scrollbars. Similar plugins haven't met my requirements in terms of features, quality, simplicity, license or browser support.

Goals & Features

    @@ -194,10 +194,9 @@ For example you can appoint an existing element as the viewport ele

    You can write and publish your own Plugins. This section is a work in progress.

    FAQ

    -

    How do I get the scroll position of an element I applied the OverlayScrollbars to?


    If you applied OverlayScrollbars to the body element you can use window.scrollX, window.scrollY or any other native api.

    If the plugin was applied to any other element you have to get the instance first. With the instance you can get the viewport element. With this element you can use element.scrollTop, element.scrollLeft or any other native api.

    const { viewport } = osInstance.elements(); -const { scrollLeft, scrollTop } = viewport;
    -

    How do I set the scroll position of an element I applied the OverlayScrollbars to?


    If you applied OverlayScrollbars to the body element you can scroll it with window.scroll, window.scrollTo, window.scrollBy or any other native api.

    If the plugin was applied to any other element you have to get the instance first. With the instance you can get the viewport element. With this element you can use element.scroll, element.scrollTo, element.scrollBy or any other native api.

    const { viewport } = osInstance.elements(); -viewport.scrollTo({ top: 0 });
    +

    How do I get / set the scroll position of an element I applied the OverlayScrollbars to?


    If you applied OverlayScrollbars to the body element you can use window.scrollX, window.scrollY, window.scroll, window.scrollTo, window.scrollBy or any other native api.

    If the plugin was applied to any other element you have to get the viewport element with the instance.elements() function first. With this element you can use element.scrollTop, element.scrollLeft, element.scroll, element.scrollTo, element.scrollBy or any other native api.

    const { viewport } = osInstance.elements(); +const { scrollLeft, scrollTop } = viewport; // get scroll offset +viewport.scrollTo({ top: 0 }); // set scroll offset

    Is it possible to limit / adjust the scrollbar handle length?


    You can adjust a scrollbars handle length by setting a min-width / min-height and max-width / max-height style:

    /* horizontal boundaries */ .os-scrollbar-horizontal .os-scrollbar-handle { min-width: 50px; @@ -221,4 +220,4 @@ For example you can appoint an existing element as the viewport ele
  • Improve tests. (unit & browser tests)

License

-

MIT

\ No newline at end of file +

MIT

\ No newline at end of file diff --git a/packages/overlayscrollbars/README.md b/packages/overlayscrollbars/README.md index 86f6a8a..7f4286c 100644 --- a/packages/overlayscrollbars/README.md +++ b/packages/overlayscrollbars/README.md @@ -485,33 +485,18 @@ You can write and publish your own Plugins. This section is a work in progress.
- How do I get the scroll position of an element I applied the OverlayScrollbars to? + How do I get / set the scroll position of an element I applied the OverlayScrollbars to?
- If you applied `OverlayScrollbars` to the `body` element you can use [`window.scrollX`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX), [`window.scrollY`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY) or any other native api. + If you applied `OverlayScrollbars` to the `body` element you can use [`window.scrollX`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX), [`window.scrollY`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY), [`window.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll), [`window.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo), [`window.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy) or any other native api. -If the plugin was applied to any other element you have to get the `instance` first. With the instance you can get the `viewport` element. With this element you can use [`element.scrollTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop), [`element.scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft) or any other native api. +If the plugin was applied to any other element you have to get the `viewport` element with the `instance.elements()` function first. With this element you can use [`element.scrollTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop), [`element.scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft), [`element.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll), [`element.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo), [`element.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy) or any other native api. ```js const { viewport } = osInstance.elements(); -const { scrollLeft, scrollTop } = viewport; -``` -
- -
- - How do I set the scroll position of an element I applied the OverlayScrollbars to? - -
- - If you applied `OverlayScrollbars` to the `body` element you can scroll it with [`window.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll), [`window.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo), [`window.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy) or any other native api. - -If the plugin was applied to any other element you have to get the `instance` first. With the instance you can get the `viewport` element. With this element you can use [`element.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll), [`element.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo), [`element.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy) or any other native api. - -```js -const { viewport } = osInstance.elements(); -viewport.scrollTo({ top: 0 }); +const { scrollLeft, scrollTop } = viewport; // get scroll offset +viewport.scrollTo({ top: 0 }); // set scroll offset ```
diff --git a/website/src/components/index.mdx b/website/src/components/index.mdx index d57759b..89b4e6f 100644 --- a/website/src/components/index.mdx +++ b/website/src/components/index.mdx @@ -467,33 +467,18 @@ You can write and publish your own Plugins. This section is a work in progress.
- How do I get the scroll position of an element I applied the OverlayScrollbars to? + How do I get / set the scroll position of an element I applied the OverlayScrollbars to?
- If you applied `OverlayScrollbars` to the `body` element you can use [`window.scrollX`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX), [`window.scrollY`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY) or any other native api. + If you applied `OverlayScrollbars` to the `body` element you can use [`window.scrollX`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX), [`window.scrollY`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY), [`window.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll), [`window.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo), [`window.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy) or any other native api. -If the plugin was applied to any other element you have to get the `instance` first. With the instance you can get the `viewport` element. With this element you can use [`element.scrollTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop), [`element.scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft) or any other native api. +If the plugin was applied to any other element you have to get the `viewport` element with the `instance.elements()` function first. With this element you can use [`element.scrollTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop), [`element.scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft), [`element.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll), [`element.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo), [`element.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy) or any other native api. ```js const { viewport } = osInstance.elements(); -const { scrollLeft, scrollTop } = viewport; -``` -
- -
- - How do I set the scroll position of an element I applied the OverlayScrollbars to? - -
- - If you applied `OverlayScrollbars` to the `body` element you can scroll it with [`window.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll), [`window.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo), [`window.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy) or any other native api. - -If the plugin was applied to any other element you have to get the `instance` first. With the instance you can get the `viewport` element. With this element you can use [`element.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll), [`element.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo), [`element.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy) or any other native api. - -```js -const { viewport } = osInstance.elements(); -viewport.scrollTo({ top: 0 }); +const { scrollLeft, scrollTop } = viewport; // get scroll offset +viewport.scrollTo({ top: 0 }); // set scroll offset ```