Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add NPM package.json file, and add comments and build steps.

  • Loading branch information...
commit 2f8b8372a47c1961d77583f9edae796ec4fdb43a 1 parent 0f9d6dd
@ndp authored
Showing with 127 additions and 3 deletions.
  1. +6 −0 README.markdown
  2. +26 −1 build.sh
  3. +76 −2 csster.js
  4. +19 −0 package.json
View
6 README.markdown
@@ -14,6 +14,12 @@ Slideshow introduction: https://docs.google.com/present/view?id=dfm357b6_49c4d3f
## Usage
+### Node NPM Install
+
+<pre>npm install csster</pre>
+
+### Browser Client
+
All code is packaged into a single Javascript file download, [csster.js](http://ndpsoftware.com/csster/csster.js). There are no external dependencies. The project itself is hosted on [GitHub](http://github.com/ndp/csster).
<pre>
View
27 build.sh
@@ -1,4 +1,8 @@
+#!/bin/sh
+VERSION="1.0.0"
+
echo "// csster.js" >csster.js
+echo "// version $VERSION" >>csster.js
echo "// Copyright (c) Andrew J. Peterson / ndpsoftware.com" >>csster.js
echo "// All Rights Reserved" >>csster.js
echo "// " >>csster.js
@@ -7,4 +11,25 @@ echo "// " >>csster.js
echo "// Generated `date`" >>csster.js
echo "// " >>csster.js
echo "// " >>csster.js
-cat src/utils.js src/core.js src/macros/macros.js src/functions/color.js src/filters/property_pre_processors.js src/filters/rule_post_processors.js src/init.js src/jquery.js >>csster.js
+cat src/utils.js src/core.js src/macros/macros.js src/functions/color.js src/filters/property_pre_processors.js src/filters/rule_post_processors.js src/init.js src/jquery.js >>csster.js
+
+
+echo '{' >package.json
+echo ' "name": "Csster",' >>package.json
+echo ' "description": "Csster: Write CSS in JS or Coffeescript, with macros, color math, etc.",' >>package.json
+echo " \"version\": \"$VERSION\"," >>package.json
+echo ' "keywords": ["css", "color"],' >>package.json
+echo ' "licenses": [{' >>package.json
+echo ' "type": "MIT",' >>package.json
+echo ' "url": "https://github.com/ndp/csster/raw/master/LICENSE"' >>package.json
+echo ' }],' >>package.json
+echo ' "repository": {' >>package.json
+echo ' "type": "git",' >>package.json
+echo ' "url": "https://github.com/ndp/csster.git"' >>package.json
+echo ' },' >>package.json
+echo ' "author": "Andrew Peterson <andy@ndpsoftware.com>",' >>package.json
+echo ' "main": "./csster.js",' >>package.json
+echo ' "engines": {' >>package.json
+echo ' "node": "*"' >>package.json
+echo ' }' >>package.json
+echo '}' >>package.json
View
78 csster.js
@@ -1,10 +1,11 @@
// csster.js
+// version 1.0.0
// Copyright (c) Andrew J. Peterson / ndpsoftware.com
// All Rights Reserved
//
// See http://github.com/ndp/csster
//
-// Generated Tue Apr 5 23:57:01 PDT 2011
+// Generated Mon Jan 30 21:40:00 PST 2012
//
//
if (!Csster) {
@@ -683,7 +684,7 @@ function clearfix() {
}
};
if (Csster.browser.msie) {
- css['zoom'] = '1'
+ css['zoom'] = '1'
}
return css;
}
@@ -708,6 +709,79 @@ function verticalCentering(height) {
marginTop: -(height / 2)
}
}
+
+function linearGradient(startingPoint, color1, color2, etc) {
+ var prefix = '',
+ result = '';
+ if (Csster.browser.webkit) {
+ prefix = '-webkit';
+ } else if (Csster.browser.mozilla) {
+ prefix = '-moz';
+ }
+
+
+ var stops = [];
+ for (var i = 0; i < arguments.length; i++) {
+ var argument = arguments[i];
+ if (typeof argument == 'string') {
+ stops.push(argument);
+ } else if ($.isArray(argument)) {
+ for (var j = 0; j < argument.length; j++) {
+ stops.push(argument[j]);
+ }
+ } else {
+ for (p in arguments[i]) {
+ stops.push(argument[p] + (p != 0 && p != '100' ? (' ' + p + '%') : '') );
+ }
+ }
+ }
+
+
+ result = prefix + '-linear-gradient(';
+ for (i = 0; i < stops.length; i++) {
+ if (i !== 0) result += ', ';
+ result += stops[i];
+ }
+ result += ')';
+ return result;
+}
+
+// },generateLinearGradient:function() {
+// var props = c.gradientProps,
+// g = props.type + "-gradient(",e = "";
+// $sample = c.sample,
+// gCount = a.getPaletteLength(),
+// palette = a.getPalette();
+// if (props.xStart !== props.xEnd) {
+// g = g + props.xStart + " "
+// }
+// if (props.yStart !== props.yEnd) {
+// g = g + props.yStart
+// }
+// g = g + ", ";
+// var h = c.getColor;
+// $.each(palette, function(i, j) {
+// if (i > 0) {
+// e = e + " "
+// }
+// e = e + h(j) + " " + j.position + "%,"
+// });
+// g = g + e;
+// g = g.substr(0, g.length - 1) + ")";
+ return g
+// generateWebkitGradient:function() {
+// var j = c.gradientProps,l = "-webkit-gradient(" + j.type + "," + c.fetchGradientStart() + "," + c.fetchGradientEnd() + ",",g = "";
+// var e = a.getPalette(),f = e.length,k,m;
+// for (var h = 0; h < f; h++) {
+// m = e[h];
+// k = (m.position / 100);
+// g = g + "color-stop(" + k + ", rgb(" + m.rgb.r + "," + m.rgb.g + "," + m.rgb.b + ")),"
+// }
+// l = l + g;
+// l = l.substr(0, l.length - 1) + ");";
+// return l
+
+
(function() {
View
19 package.json
@@ -0,0 +1,19 @@
+{
+ "name": "Csster",
+ "description": "Csster: Write CSS in JS or Coffeescript, with macros, color math, etc.",
+ "version": "1.0.0",
+ "keywords": ["css", "color"],
+ "licenses": [{
+ "type": "MIT",
+ "url": "https://github.com/ndp/csster/raw/master/LICENSE"
+ }],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/ndp/csster.git"
+ },
+ "author": "Andrew Peterson <andy@ndpsoftware.com>",
+ "main": "./csster.js",
+ "engines": {
+ "node": "*"
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.