Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trysound/postcss-easy-import
PostCSS plugin to inline @import rules content with extra features
https://github.com/trysound/postcss-easy-import
Last synced: 29 days ago
JSON representation
PostCSS plugin to inline @import rules content with extra features
- Host: GitHub
- URL: https://github.com/trysound/postcss-easy-import
- Owner: TrySound
- License: mit
- Created: 2016-01-28T16:33:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-10T02:41:44.000Z (over 1 year ago)
- Last Synced: 2024-05-28T01:15:47.079Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 244 KB
- Stars: 200
- Watchers: 5
- Forks: 25
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Lists
- awesome-fullstack - PostCSS-easy-import
README
# postcss-easy-import [![Build Status][ci-img]][ci]
[PostCSS] plugin to inline @import rules content with extra features.
[postcss-import]: https://github.com/postcss/postcss-import
[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/TrySound/postcss-easy-import.svg
[ci]: https://travis-ci.org/TrySound/postcss-easy-import## Usage
```js
postcss([ require('postcss-easy-import') ])
```See [PostCSS] docs for examples for your environment.
## Resolving files with globs
The path to the file will be checked and if it contains a glob it will be used
to locate it. These can be mixed and matched with normal module paths:```css
@import "suitcss-utils-display"; /* node_modules */
@import "./theme.css"; /* relative path */
@import "./components/*.css"; /* glob */
@import "suitcss-utils-size/lib/*.css"; /* glob inside node_modules */
```## Options
This plugin is a [postcss-import] extension which introduces its own `resolve` option.
### `prefix`
Type: `false` or `string`
Default: `false`Allows partial-like importing with a prefix before the filename.
```css
@import 'modules/partial.css';
/* will import modules/_partial.css */
```Prefixed versions are always favoured. Otherwise the non-prefix version is used:
```
├── _baz.css
├── baz.css
├── bar.css
```The matched files would be `['_baz.css', 'bar.css']`.
### `extensions`
Type: `array` or `string`
Default: `.css`Defines file extensions which will be looked for.
# License
MIT © [Bogdan Chadkin](mailto:[email protected])