css-region-rebase

1.1.2 • Public • Published

css-region-rebase

NPM version Build Status Dependency Status Coverage percentage

Rebase your CSS assets based on comment regions.

Think about what you can do when combining this with node-sass importer feature...^^

Installation

npm install css-region-rebase

Example

From:

/* region cssRebase: /path/to/rebase/your/assets/to */
.foo {
    background: url(./foo.png);
}
/* endregion cssRebase: /path/to/rebase/your/assets/to */

To:

/* 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
  • 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

Dependents (0)

Package Sidebar

Install

npm i css-region-rebase

Weekly Downloads

0

Version

1.1.2

License

Apache-2.0

Last publish

Collaborators

  • ericmorand