Chocolat
Search…
Installation
Learn how to install Chocolat depending on your environment

Installing

Using the packet manager of your choice you can install chocolat like this:
1
yarn add chocolat
2
# or
3
npm install chocolat
Copied!
You can also clone or download the source and copy the ./dist/ folder in your working directory :
1
https://github.com/nicolas-t/chocolat/archive/master.zip
Copied!

Classic import

If you do not use a module , you can still import chocolat via script tags (preferably just before closing </body>) :
1
<!-- ... -->
2
<script src="dist/js/chocolat.js"></script>
3
</body>
Copied!
You will also need to import the css between the <head> tags :
1
<head>
2
<!-- ... -->
3
<link rel="stylesheet" href="../dist/css/chocolat.css" />
4
<!-- ... -->
5
</head>
Copied!

Modern import

If you use a bundler like webpack you can then import Chocolat module in your javascript file :
1
import Chocolat from 'chocolat'
Copied!
And import the CSS in your CSS file :
1
@import '~chocolat/dist/css/chocolat.css';
Copied!
Last modified 2yr ago
Copy link