Skip to content

v3.0.0

Latest
Compare
Choose a tag to compare
@memob0x memob0x released this 01 Feb 15:06
3cc355f

The entire library has been rewritten to improve simplicity and maintainability.

Previously, it exported a class that observed the class attribute changes and listened for scroll and resize events to update CSS variables.

import ScrollPadlock from "scroll-padlock";

const scrollPadlock = new ScrollPadlock();

document.scrollingElement.classList.add("scroll-padlock-locked");

It now exports a function that updates the CSS variables and can be called when needed.

import { setStyle } from "scroll-padlock";

setStyle();

document.scrollingElement.classList.add("scroll-padlock");