postcss-import-ext-glob
A PostCSS plugin to extend postcss-import path resolver to allow glob usage as path
Last updated 2 years ago by dimitrinicolas .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install postcss-import-ext-glob 
SYNC missed versions from official npm registry.

postcss-import-ext-glob Build Status Coverage Status

A PostCSS plugin to extend postcss-import path resolver to allow glob usage as a path.

You must use this plugin along with postcss-import, place this plugin before postcss-import.

@import-glob "components/**/*.css";

Installation

$ npm install postcss-import-ext-glob

Usage

// Postcss plugins
postcss([
  require('postcss-import-ext-glob'),
  require('postcss-import')
]);

Check out PostCSS docs for the complete installation.

Example

This plugin transform this:

@import-glob "components/**/*.css";

into this:

@import "components/form/input.css";
@import "components/form/submit.css";
/* etc */

Thereby, the plugin postcss-import can now import each file.

You can pass multiple globs in one:

@import-glob "helpers/**/*.css", "components/**/*.css";

Options

You can pass a sort option to this plugin with a value of "asc" or "desc":

// Postcss plugins
postcss([
  require('postcss-import-ext-glob')({
    sort: 'desc'
  }),
  require('postcss-import')
]);

The sort order is by default ascending.

Related

License

This project is licensed under the MIT license.

Current Tags

  • 1.1.0                                ...           latest (2 years ago)

2 Versions

  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |