https://github.com/ericmorand/css-region-rebase
https://github.com/ericmorand/css-region-rebase
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ericmorand/css-region-rebase
- Owner: ericmorand
- License: apache-2.0
- Created: 2017-03-29T18:30:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T14:08:59.000Z (about 9 years ago)
- Last Synced: 2025-01-26T17:11:17.940Z (over 1 year ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# css-region-rebase
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
Rebase your CSS assets based on comment regions.
Think about what you can do when combining this with [node-sass importer](https://github.com/sass/node-sass#importer--v200---experimental) feature...^^
## Installation
```bash
npm install css-region-rebase
```
## Example
From:
``` css
/* region cssRebase: /path/to/rebase/your/assets/to */
.foo {
background: url(./foo.png);
}
/* endregion cssRebase: /path/to/rebase/your/assets/to */
```
To:
``` css
/* region cssRebase: /path/to/rebase/your/assets/to */
.foo {
background: url(/path/to/rebase/your/assets/to/foo.png);
}
/* endregion cssRebase: /path/to/rebase/your/assets/to */
```
## API
`let Rebaser = require('css-region-rebase')`
### rebaser = new Rebaser(opts={})
Return an object transform stream `rebaser` that expects entry filenames.
Optionally pass in some opts:
* opts.format - the format used by your region. Defaults to `cssRebase:`.
## Events
In addition to the usual events emitted by node.js streams, css-region-rebase emits the following events:
### rebaser.on('rebase', function(file) {})
Every time an asset is rebased, this event fires with the rebased path.
## Contributing
* Fork the main repository
* Code
* Implement tests using [node-tap](https://github.com/tapjs/node-tap)
* Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue
## License
Apache-2.0 © [Eric MORAND]()
[npm-image]: https://badge.fury.io/js/css-region-rebase.svg
[npm-url]: https://npmjs.org/package/css-region-rebase
[travis-image]: https://travis-ci.org/ericmorand/css-region-rebase.svg?branch=master
[travis-url]: https://travis-ci.org/ericmorand/css-region-rebase
[daviddm-image]: https://david-dm.org/ericmorand/css-region-rebase.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/ericmorand/css-region-rebase
[coveralls-image]: https://coveralls.io/repos/github/ericmorand/css-region-rebase/badge.svg
[coveralls-url]: https://coveralls.io/github/ericmorand/css-region-rebase