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.
- Host: GitHub
- URL: https://github.com/pekim/postcss-modules-resolve-from-alias
- Owner: pekim
- Created: 2015-10-31T14:42:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T10:50:10.000Z (about 6 years ago)
- Last Synced: 2025-06-17T09:56:25.694Z (5 months ago)
- Topics: css-modules, postcss
- Language: JavaScript
- Size: 9.77 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CSS Modules: Resolve imports from aliases
[](https://travis-ci.org/pekim/postcss-modules-resolve-from-alias)
[](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
```
[](https://travis-ci.org/pekim/postcss-modules-resolve-from-alias)
* Lines: [](https://coveralls.io/github/pekim/postcss-modules-resolve-from-alias?branch=master)
* Statements: [](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