Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pekim/postcss-modules-resolve-from-alias

A CSS Modules transform to provide aliases for composes paths.
https://github.com/pekim/postcss-modules-resolve-from-alias

css-modules postcss

Last synced: 3 months ago
JSON representation

A CSS Modules transform to provide aliases for composes paths.

Awesome Lists containing this project

README

        

# CSS Modules: Resolve imports from aliases

[![Build Status](https://travis-ci.org/pekim/postcss-modules-resolve-from-alias.svg?branch=master)](https://travis-ci.org/pekim/postcss-modules-resolve-from-alias)
[![NPM version](http://img.shields.io/npm/v/postcss-modules-resolve-from-alias.svg)](https://www.npmjs.org/package/postcss-modules-resolve-from-alias)

With this config:

```javascript
{
'css': 'src/style'
}
```

transforms:

```css
.myClass {
composes: button from "css/button.css";
color: green;
}
```

into:

```css
.myClass {
composes: button from "src/style/button.css";
color: green;
}
```

## Options

An object, where each key/value pair represents an alias for `composes` import paths.
- _key_ - `composes` import path prefix
- _value_ - replacement value for the import path prefix

Both keys and values may include a trailing `/`.
If there is no trailing `/`, then one is implied.

## Building

```
npm install
npm build
npm test
```

[![Build Status](https://travis-ci.org/pekim/postcss-modules-resolve-from-alias.svg?branch=master)](https://travis-ci.org/pekim/postcss-modules-resolve-from-alias)

* Lines: [![Coverage Status](https://coveralls.io/repos/pekim/postcss-modules-resolve-from-alias/badge.svg?branch=master&service=github)](https://coveralls.io/github/pekim/postcss-modules-resolve-from-alias?branch=master)
* Statements: [![codecov.io](http://codecov.io/github/pekim/postcss-modules-resolve-from-alias/coverage.svg?branch=master)](http://codecov.io/github/pekim/postcss-modules-resolve-from-alias?branch=master)

## Development

- `npm watch` will watch `src` for changes and rebuild
- `npm autotest` will watch `src` and `test` for changes and retest

## License

MIT