2.1.4 • Published 3 years ago
cookies-policy v2.1.4
Cookies policy banner
This module creates and manage a cookies banner. You can customize texts and styles as you wish.
How do I get set up?
- Install package with
npm i cookies-policy
- Import this module via JS.
import Cookies from './node_modules/cookies-policy/index.js';
- Call the init method
Cookies.init([options]);
How do I customize things?
You can set the text/button text after initializing the banner. All you need to do is call setText(string)
or setButtonText(string)
methods.
Otherwise, if you need to customize the styles then you need to pass your styles as an string in .init()
method as a param, like this:
Cookies.init({
customCss: `
.m-cookies-policy {
background-color: cornflowerblue;
padding: 8px 16px;
...
}
`
});
To-Do
- Improve CSS customization.
- ...