-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added npm usage and updated CDN version
- Loading branch information
1 parent
7f6c79a
commit 894a108
Showing
1 changed file
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,39 @@ The quickest way to get started with Halfmoon is by using the CDN to include the | |
|
||
```html | ||
<!-- Halfmoon CSS --> | ||
<link href="https://cdn.jsdelivr.net/gh/halfmoonui/[email protected].2/css/halfmoon.min.css" rel="stylesheet" /> | ||
<link href="https://cdn.jsdelivr.net/gh/halfmoonui/[email protected].3/css/halfmoon.min.css" rel="stylesheet" /> | ||
|
||
<!-- Halfmoon JS --> | ||
<script src="https://cdn.jsdelivr.net/gh/halfmoonui/[email protected].2/js/halfmoon.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/halfmoonui/[email protected].3/js/halfmoon.min.js"></script> | ||
``` | ||
|
||
## Using npm | ||
|
||
``` | ||
npm install halfmoon | ||
``` | ||
|
||
After installation, the required CSS and JS file can be imported in the following way: | ||
|
||
```javascript | ||
// Include CSS file | ||
require("halfmoon/css/halfmoon.min.css"); | ||
|
||
// Import JS library | ||
var halfmoon = require("halfmoon"); | ||
``` | ||
|
||
Please note that this method requires manual initialization, that is, after the DOM is loaded, the following method needs to be called: | ||
|
||
```javascript | ||
// Call this method after the DOM has been loaded | ||
halfmoon.onDOMContentLoaded(); | ||
``` | ||
|
||
This initializes all of the components that require JavaScript, such as dropdowns,, custom file inputs, shortcuts, etc. | ||
|
||
In this way, Halfmoon can be used with frameworks that use the virtual DOM, such as React and Vue. For instance, in the case of Vue, the `halfmoon.onDOMContentLoaded()` method would be called inside the `mounted()` hook of your component. | ||
|
||
## Starter template generator | ||
|
||
You can use the [starter template generator](https://www.gethalfmoon.com/docs/page-building/#starter-template-generator) to generate boilerplates for your project. The generator takes your settings and adds the appropriate classes and defines the required containers and elements. | ||
|