Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean King committed Jul 4, 2015
0 parents commit 30ae405
Show file tree
Hide file tree
Showing 11 changed files with 568 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"env": {
"node": true,
"mocha": true
},

"rules": {
// Possible errors
"no-cond-assign": 0,
"no-console": 0,
"no-extra-parens": 2,

// Best practices
"block-scoped-var": 2,
"eqeqeq": [2, "smart"],
"no-else-return": 2,
"no-floating-decimal": 2,
"wrap-iife": [2, "inside"],

// Variables
"no-use-before-define": 1,

// Stylistic issues
"brace-style": 2,
"camelcase": 2,
"new-cap": 2,
"no-lonely-if": 2,
"no-underscore-dangle": 2,
"space-after-keywords": 2,
"space-in-brackets": 0,
"space-infix-ops": 2,
"one-var": 2,
"quotes": [2, "single"]
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
npm-debug.log
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.gitignore

node_modules/

test/
.travis.yml

gulpfile.js
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo: false
language: node_js
node_js:
- iojs
- "0.12"
- "0.10"
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# postcss-normalize
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]

[PostCSS] plugin that that automatically applies normalize.css

```css
.foo {
color: #fff;
}
```

```css

/* Normalize styles here */

.foo {
color: #fff;
}
```

--

### Usage

```js
postcss([ require('postcss-normalize') ])
```

See [PostCSS] docs for examples for your environment.

--

### License

MIT © [Sean King](https://twitter.com/seaneking)

[npm-image]: https://badge.fury.io/js/postcss-normalize.svg
[npm-url]: https://npmjs.org/package/postcss-normalize
[travis-image]: https://travis-ci.org/seaneking/postcss-normalize.svg?branch=master
[travis-url]: https://travis-ci.org/seaneking/postcss-normalize
[daviddm-image]: https://david-dm.org/seaneking/postcss-normalize.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/seaneking/postcss-normalize
[PostCSS]: https://github.com/postcss/postcss

23 changes: 23 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

var gulp = require('gulp'),
eslint = require('gulp-eslint'),
mocha = require('gulp-mocha');

gulp.task('lint', function () {
return gulp.src(['index.js', 'test/*.js', 'gulpfile.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('test', function () {
return gulp.src('test/*.js', { read: false }).pipe(mocha({reporter: 'nyan'}));
});

gulp.task('watch', function() {
gulp.watch('**/*.js', ['check'] );
});

gulp.task('check', ['lint', 'test']);
gulp.task('default', ['check', 'watch']);
15 changes: 15 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

var postcss = require('postcss'),
fs = require('fs'),
path = require('path');

module.exports = postcss.plugin('postcss-normalize', function () {
return function(css) {

var normalize = fs.readFileSync(path.join(__dirname, 'node_modules/normalize.css/normalize.css'), 'utf8');

css.prepend(normalize);

};
});
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "postcss-normalize",
"version": "0.1.0",
"description": "PostCSS plugin that automatically applies normalize.css",
"keywords": [
"postcss",
"css",
"postcss-plugin",
"normalize"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/seaneking/postcss-normalize.git"
},
"author": "Sean King <sean@simpla.io>",
"maintainers": [
{
"name": "Sean King",
"email": "sean@simpla.io",
"web": "http://simpla.io"
}
],
"bugs": {
"url": "https://github.com/seaneking/postcss-normalize/issues"
},
"homepage": "https://github.com/seaneking/postcss-normalize",
"dependencies": {
"normalize.css": "^3.0.3",
"postcss": "^4.1.9"
},
"devDependencies": {
"gulp-eslint": "^0.12.0",
"gulp-mocha": "^2.0.1",
"chai": "^2.3.0",
"gulp": "^3.8.11"
},
"scripts": {
"test": "gulp check"
}
}
3 changes: 3 additions & 0 deletions test/fixtures/test.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.foo {
color: #fff;
}
Loading

0 comments on commit 30ae405

Please sign in to comment.