Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcblw/html-css-import-helper
https://github.com/jcblw/html-css-import-helper
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jcblw/html-css-import-helper
- Owner: jcblw
- Created: 2015-04-12T06:03:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-12T14:05:01.000Z (over 7 years ago)
- Last Synced: 2024-10-11T14:39:13.710Z (about 1 month ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTML CSS import Helper
> This is just an experiment.
The idea behind this is to simply import css and html via a Handlebars Helper. Right now the api is very rough. Suggestions are welcome.
## Usage
```javascript
var
Handlebars = require('Handlebars'),
ImportHelpers = require('./path-to/module'),
options = {
Handlebars: Handlebars
}new ImportHelpers('./components/**/*.html', options, function(err) {
// if there is no error you now have the new Helpers
});
// this is async because all the readfiles
```### Component Example
A component is just a `HTML` file. We register a `style` helper to allow you to import styles inline into your html. eg
```handlebars
{{!-- path/button.html --}}
{{style 'path/button.css'}}```
### Using component
```handlebars
{{!-- based off file name --}}
{{Button className="foo--button"}}
```## Development
This ES6 all over it, so you'll need to compile it to actually run it `npm run build`. Also examples are using some ES6 as well so its best to run those with [iojs](https://iojs.org/en/index.html).