rework-import

WebJar for rework-import

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

rework-import
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

rework-import
WebJar for rework-import
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/reworkcss/rework-import

Download rework-import

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/rework-import/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>rework-import</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/rework-import/
implementation 'org.webjars.npm:rework-import:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/rework-import/
implementation ("org.webjars.npm:rework-import:2.1.0")
'org.webjars.npm:rework-import:jar:2.1.0'
<dependency org="org.webjars.npm" name="rework-import" rev="2.1.0">
  <artifact name="rework-import" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='rework-import', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "rework-import" % "2.1.0"
[org.webjars.npm/rework-import "2.1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : css jar [2.0.0,3)
org.webjars.npm : globby jar [2.0.0,3)
org.webjars.npm : parse-import jar [2.0.0,3)
org.webjars.npm : url-regex jar [3.0.0,4)

Project Modules

There are no modules declared in this project.

rework-import Build Status

Import stylesheets using @import and an optional media query

Install

$ npm install --save rework-import

Usage

var data = require('fs').readFileSync('index.css');
var imprt = require('rework-import');
var rework = require('rework');

rework(data)
	.use(imprt({path: 'app/stylesheets'}))
	.toString();

Options

encoding

Type: String
Default: utf8

Use if your CSS is encoded in anything other than UTF-8.

path

Type: Array|String
Default: process.cwd() or __dirname of the rework source

A string or an array of paths in where to look for files.

Note: nested @import will additionally benefit of the relative dirname of imported files.

transform

Type: Function

A function to transform the content of imported files. Takes one argument and should return the modified content. Useful if you use css-whitespace.

Example

@import 'foo.css' (min-width: 25em);

body {
	background: black;
}

yields:

@media (min-width: 25em) {
	body {
		background: red;
	}

	h1 {
		color: grey;
	}
}

body {
	background: black;
}

License

MIT © Jason Campbell and Kevin Mårtensson

org.webjars.npm

rework

Versions

Version
2.1.0