Releases: dimitrinicolas/overflow-color
2.3.0 Added data-oc-outside attribute
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 Force colors update function
The default exported function is now update
and check for attribute and scroll change
2.1.5 Performance improvement
Improved performance by passively listening to scroll event
2.1.4 Improved performance
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 Code simplification
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 Rollup module bundling
Now bundling into 3 modules using Rollup :
main
overflow-color.cjs.js as a standard node modulemodule
overflow-color.esm.js as an ES6 node modulebrowser
overflow-color.umd.js and overflow-color.umd.min.js as a basic embeddable library for browser
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 Async loading possible
It will now test if document.readyState
is equal to interactive
, so the script can now be loaded async
.
2.1.0 Body attribute shorthand
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 Bugfix on Firefox
Bugfix on Firefox
2.0.0 Complete rework
Complete rework and bugfixes. The library is now published on npm.