Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
8 changes: 0 additions & 8 deletions .npmignore

This file was deleted.

16 changes: 0 additions & 16 deletions gulpfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var postcss = require('postcss');
module.exports = postcss.plugin('mahogany', function () {
return function (css) {
css.walkDecls(function (decl) {
decl.important = true;
decl.important = true;
});
};
});
28 changes: 17 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,33 @@
"name": "mahogany",
"version": "0.0.2",
"description": "PostCSS plugin that lets everyone know how important your CSS is",
"license": "MIT",
"repository": "conceptualitis/mahogany",
"author": "Neil Duffy <neiladuffy@gmail.com>",
"engines": {
"node": ">=0.12.0"
},
"keywords": [
"postcss-plugin",
"postcss",
"css",
"postcssplugin",
"important"
],
"author": "Neil Duffy <neiladuffy@gmail.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/conceptualitis/mahogany.git"
"scripts": {
"pretest": "xo",
"test": "ava"
},
"files": [
"index.js"
],
"dependencies": {
"postcss": "^5.0.16"
},
"devDependencies": {
"gulp-mocha": "2.0.1",
"chai": "2.2.0",
"gulp": "3.8.11"
"ava": "^0.12.0",
"xo": "^0.12.1"
},
"scripts": {
"test": "gulp test"
"xo": {
"space": 2
}
}
18 changes: 18 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import test from 'ava';
import mahogany from './';

function run(input, output, t) {
t.is(mahogany.process(input).css, output);
}

test('much transform, very important', t => run(
'a { color: red; font-size: 12px; } b { font-weight: 400; }',
'a { color: red !important; font-size: 12px !important; } b { font-weight: 400 !important; }',
t
));

test('much transform, too much important', t => run(
'a { color: red !important; } b { font-weight: 400; }',
'a { color: red !important; } b { font-weight: 400 !important; }',
t
));
23 changes: 0 additions & 23 deletions test/test.js

This file was deleted.