Overflow Color Versions Save

Automatically switch CSS html background-color to bring a smooth user experience

2.3.0

5 years ago

Add the data-oc-outside attribute to any body's immediate children that you don't want to be included into the data-oc-wrap element at DOM content load.

2.2.0

5 years ago

The default exported function is now update and check for attribute and scroll change

2.1.5

5 years ago

Improved performance by passively listening to scroll event

2.1.4

5 years ago

Improved performance by throttling the scroll event listener through requestAnimationFrame.

Now default exporting a force checkScroll function to use when making huge change to the DOM, see Readme for more informations, example:

import checkScroll from 'overflow-color';

/** Change DOM */

checkScroll();

2.1.3

5 years ago

Some simplifications have been made to the code.

The style tag setting the html background color is now added once to the DOM rather than being removed and recreated for each overflow color change.

2.1.2

5 years ago

Now bundling into 3 modules using Rollup :

What you need to do

Nothing if you use a module bundler like Webpack or Rollup, by updating overflow-color to 2.1.2, it will automatically choose the most suitable module.

Switching to dist/overflow-color.umd.min.js if you manualy update and embed the library in your webpages : <script src="overflow-color.umd.min.js" async></script.

2.1.1

5 years ago

It will now test if document.readyState is equal to interactive, so the script can now be loaded async.

2.1.0

6 years ago

Added a shortcut data-oc for data-oc-top and data-oc-bottom combined. This new version is backwards-compatible.

For example, this:

<body data-oc-top="red" data-oc-bottom="blue">

can be shortened to:

<body data-oc="red,blue">

2.0.1

6 years ago

Bugfix on Firefox

2.0.0

6 years ago

Complete rework and bugfixes. The library is now published on npm.