Is v2 removing extensions for good or just temporary? #495
Answered
by
KingSora
theo-staizen
asked this question in
Q&A
-
Hello @KingSora, just wondering if you are permanently removing extensions or is it just not done yet? I have a small extension which adds scroll shadows to my container, which I cannot keep if I upgrade to v2. OverlayScrollbars.extension('shadow', function() {
const host = this.getElements('host');
const viewport = this.getElements('viewport');
const updateShadow = () => {
const {
scrollWidth = 0, scrollLeft = 0, offsetWidth = 0,
scrollHeight = 0, scrollTop = 0, offsetHeight = 0
} = viewport;
const left = scrollLeft > 0 ? 2 : 0;
const right = scrollLeft + offsetWidth < scrollWidth ? -2 : 0;
const top = scrollTop > 0? 2 : 0;
const bottom = scrollTop + offsetHeight < scrollHeight ? -2 : 0;
host.style.boxShadow =
`inset ${left}em ${top}em 1em -2em rgba(0,0,0,0.5),
inset ${right}em ${bottom}em 1em -2em rgba(0,0,0,0.5)`
;
};
return {
contract: null,
added: () => {
host.classList.add('os-host-shadow');
updateShadow();
},
removed: () => {
host.classList.remove('os-host-shadow');
host.style.boxShadow = '';
},
on: updateShadow;
}) And the CSS .os-host.os-host-shadow:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
pointer-events: none;
} |
Beta Was this translation helpful? Give feedback.
Answered by
KingSora
Jan 17, 2023
Replies: 1 comment 1 reply
-
@theo-staizen extensions from |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
theo-staizen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@theo-staizen extensions from
v1
won't be compatible withv2
.. Instead you're able to write plugins which are even more powerful then the extensions fromv1
. I'm in fact using the api for the default plugins already, its just not documented yet.