Permalink
Browse files

Initial CSSComb commit.

  • Loading branch information...
0 parents commit b4f14e6471e7ff79e6be06d194c1e08df5f083eb @garetht committed Jan 25, 2014
Showing with 112 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .npmignore
  3. +20 −0 LICENSE
  4. +4 −0 README.md
  5. +40 −0 lib/index.js
  6. +26 −0 package.json
  7. +20 −0 src/index.coffee
@@ -0,0 +1 @@
+node_modules
@@ -0,0 +1 @@
+.gitignore
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 garetht
+
+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.
@@ -0,0 +1,4 @@
+csscomb-brunch
+==============
+
+Gives Brunch workflows the ability to sort CSS properties.
@@ -0,0 +1,40 @@
+// Generated by CoffeeScript 1.6.3
+var Comb, CsscombCompiler;
+
+Comb = require('csscomb');
+
+module.exports = CsscombCompiler = (function() {
+ CsscombCompiler.prototype.brunchPlugin = true;
+
+ CsscombCompiler.prototype.type = "stylesheet";
+
+ CsscombCompiler.prototype.extension = "css";
+
+ CsscombCompiler.prototype.pattern = /\.(?:css|scss|sass|less)$/;
+
+ function CsscombCompiler(config) {
+ var encoding, _ref;
+ this.config = config;
+ encoding = ((_ref = this.config.csscomb) != null ? _ref : {
+ encoding: 'zen'
+ }).encoding;
+ this.comb = new Comb(encoding);
+ }
+
+ CsscombCompiler.prototype.compile = function(_arg, callback) {
+ var data, map, path;
+ data = _arg.data, path = _arg.path, map = _arg.map;
+ try {
+ this.comb.processPath(path);
+ } catch (_error) {
+
+ }
+ return callback(error, {
+ data: data,
+ map: map
+ });
+ };
+
+ return CsscombCompiler;
+
+})();
@@ -0,0 +1,26 @@
+{
+ "name": "csscomb-brunch",
+ "version": "1.7.0",
+ "description": "Gives Brunch workflows the ability to sort CSS properties.",
+ "main": "lib/index",
+ "scripts": {
+ "prepublish": "rm -f lib/* && coffee -cbo lib/ src/"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/garetht/csscomb-brunch.git"
+ },
+ "keywords": [
+ "brunch",
+ "csscomb"
+ ],
+ "author": "Gareth Tan",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/garetht/csscomb-brunch/issues"
+ },
+ "homepage": "https://github.com/garetht/csscomb-brunch",
+ "dependencies": {
+ "csscomb": "~2.0.4"
+ }
+}
@@ -0,0 +1,20 @@
+Comb = require 'csscomb'
+
+module.exports = class CsscombCompiler
+ brunchPlugin: yes
+ type: "stylesheet"
+ extension: "css"
+ pattern: /\.(?:css|scss|sass|less)$/
@tonyganch
tonyganch Jan 31, 2014

CSScomb does not support sass syntax yet.

+
+ constructor: (@config) ->
+ {encoding} = @config.csscomb ? {encoding: 'zen'}
+ @comb = new Comb encoding
+
+ compile: ({data, path, map}, callback) ->
+ try @comb.processPath path
+ catch error
+ callback(error, {data, map})
+
+
+
+

0 comments on commit b4f14e6

Please sign in to comment.