-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
based on [rework-import](https://github.com/reworkcss/rework-import) v1.2.0 (mainly for fixtures)
- Loading branch information
0 parents
commit 319c4f7
Showing
35 changed files
with
773 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
test/fixtures/*.actual.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
{ | ||
"excludeFiles": [ | ||
"node_modules/**" | ||
], | ||
"fileExtensions": [ | ||
".js" | ||
], | ||
"requireCurlyBraces": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"return", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireParenthesesAroundIIFE": true, | ||
"requireSpacesInConditionalExpression": { | ||
"afterTest": true, | ||
"beforeConsequent": true, | ||
"afterConsequent": true, | ||
"beforeAlternate": true | ||
}, | ||
"requireSpacesInFunctionExpression": { | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"disallowSpacesInFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowMultipleVarDecl": true, | ||
"requireBlocksOnNewline": 1, | ||
"disallowPaddingNewlinesInBlocks": true, | ||
"disallowEmptyBlocks": true, | ||
"disallowSpacesInsideObjectBrackets": true, | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowQuotedKeysInObjects": "allButReserved", | ||
"disallowSpaceAfterObjectKeys": true, | ||
"requireCommaBeforeLineBreak": true, | ||
"requireOperatorBeforeLineBreak": [ | ||
"?", | ||
"+", | ||
"-", | ||
"/", | ||
"*", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==", | ||
">", | ||
">=", | ||
"<", | ||
"<=" | ||
], | ||
"disallowSpaceAfterPrefixUnaryOperators": [ | ||
"++", | ||
"--", | ||
"+", | ||
"-", | ||
"~", | ||
"!" | ||
], | ||
"disallowSpaceBeforePostfixUnaryOperators": [ | ||
"++", | ||
"--" | ||
], | ||
"requireSpaceBeforeBinaryOperators": [ | ||
"+", | ||
"-", | ||
"/", | ||
"*", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==" | ||
], | ||
"requireSpaceAfterBinaryOperators": [ | ||
"+", | ||
"-", | ||
"/", | ||
"*", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==" | ||
], | ||
"disallowImplicitTypeConversion": [ | ||
"numeric", | ||
"boolean", | ||
"binary", | ||
"string" | ||
], | ||
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties", | ||
"disallowKeywords": [ | ||
"with" | ||
], | ||
"disallowMultipleLineStrings": true, | ||
"validateQuoteMarks": "\"", | ||
"validateIndentation": 2, | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"requireKeywordsOnNewLine": [ | ||
"else" | ||
], | ||
"requireLineFeedAtFileEnd": true, | ||
"requireCapitalizedConstructors": true, | ||
"safeContextKeyword": "that", | ||
"requireDotNotation": true, | ||
"validateJSDoc": { | ||
"checkParamNames": true, | ||
"checkRedundantParams": true, | ||
"requireParamTypes": true | ||
}, | ||
"requireSpaceAfterLineComment": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"newcap": false, | ||
"undef": true, | ||
"unused": true, | ||
"asi": true, | ||
"esnext": true, | ||
"node": true, | ||
"browser": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
language: node_js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 1.0.0 - 2014-08-10 | ||
|
||
First release based on [rework-import](https://github.com/reworkcss/rework-import) v1.2.0 (mainly for fixtures) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014 "MoOx" Maxime Thirouin | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# postcss-import [](https://travis-ci.org/postcss/postcss-import) | ||
|
||
A [PostCSS](https://github.com/postcss/postcss) plugin to import stylesheets using `@import` and an optional media query. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install postcss-import | ||
``` | ||
|
||
## Usage | ||
|
||
|
||
```js | ||
var postcss = require("postcss") | ||
var atImport = require("postcss-import") | ||
|
||
var css = postcss() | ||
.use(atImport()) | ||
.process(cssString) | ||
.css | ||
``` | ||
|
||
```css | ||
@import "foo.css"; | ||
|
||
@import "bar.css" (min-width: 25em); | ||
|
||
body { | ||
background: black; | ||
} | ||
``` | ||
|
||
yields: | ||
|
||
```css | ||
/* ... content of foo.css */ | ||
|
||
@media (min-width: 25em) { | ||
/* ... content of bar.css */ | ||
} | ||
|
||
body { | ||
background: black; | ||
} | ||
``` | ||
|
||
### Options | ||
|
||
#### encoding | ||
|
||
Type: `String` | ||
Default: `utf8` | ||
|
||
Use if your CSS is encoded in anything other than UTF-8. | ||
|
||
#### path | ||
|
||
Type: `String|Array` | ||
Default: `process.cwd()` or _dirname of [the rework source](https://github.com/reworkcss/css#cssparsecode-options)_ | ||
|
||
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` | ||
Default: `null` | ||
|
||
A function to transform the content of imported files. Take one argument (file content) & should return the modified content. | ||
|
||
#### Example with some options | ||
|
||
```js | ||
var postcss = require("postcss") | ||
var atImport = require("postcss-import") | ||
|
||
var css = postcss() | ||
.use(atImport({ | ||
path: [ | ||
"node_modules", | ||
] | ||
transform: require("css-whitespace") | ||
})) | ||
.process(cssString) | ||
.css | ||
``` | ||
|
||
|
||
See [tests](test) for examples. | ||
|
||
|
||
--- | ||
|
||
## Contributing | ||
|
||
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature. | ||
|
||
```bash | ||
git clone https://github.com/postcss/postcss-import.git | ||
git checkout -b patch-1 | ||
npm install | ||
npm test | ||
``` | ||
|
||
## [Changelog](CHANGELOG.md) | ||
|
||
## [License](LICENSE-MIT) |
Oops, something went wrong.