Skip to content
Browse files

Fix some typos, update from upstream, simple test

  • Loading branch information...
1 parent 032d355 commit 0d72d05af6da1132bd0b222e712218725529b69f Janez Troha committed Jan 27, 2012
Showing with 2,426 additions and 25 deletions.
  1. +3 −1 .gitignore
  2. +8 −8 lib/bootstrap.styl
  3. +2 −3 lib/mixins.styl
  4. +13 −9 lib/patterns.styl
  5. +1 −1 lib/reset.styl
  6. +3 −3 lib/scaffolding.styl
  7. +3 −0 package.json
  8. +2,282 −0 test/bootstrap.css.org
  9. +111 −0 test/test.js
View
4 .gitignore
@@ -1,3 +1,5 @@
+thumbs.db
*~
+node_modules
.DS_Store
-thumbs.db
+test/bootstrap.css.gen
View
16 lib/bootstrap.styl
@@ -12,17 +12,17 @@
*/
// CSS Reset
-@import "reset.styl";
+@import "reset";
// Core variables and mixins
-@import "variables.styl"; // Modify this for custom colors, font-sizes, etc
-@import "mixins.styl";
+@import "variables";
+@import "mixins";
// Grid system and page structure
-@import "scaffolding.styl";
+@import "scaffolding";
// Styled patterns and elements
-@import "type.styl";
-@import "forms.styl";
-@import "tables.styl";
-@import "patterns.styl";
+@import "type";
+@import "forms";
+@import "tables";
+@import "patterns";
View
5 lib/mixins.styl
@@ -66,7 +66,7 @@ font-monospace($weight = normal, $size = 12px, $lineHeight = 20px)
// Grid System
fixed-container()
- width: s('%spx', $siteWidth)
+ width: $siteWidth
margin-left: auto
margin-right: auto
clearfix()
@@ -102,7 +102,6 @@ box-shadow($shadow = 0 1px 3px rgba(0,0,0,.25))
// Transitions
transition($transition)
- -webkit-transform-style: s('%s', preserve-3d)
-webkit-transition: $transition
-moz-transition: $transition
-ms-transition: $transition
@@ -187,7 +186,7 @@ gradient-vertical-three-colors($startColor = #00b3ee, $midColor = #7a43b6, $colo
// Reset filters for IE
reset-filter()
- filter: s('%s', "progid:DXImageTransform.Microsoft.gradient(enabled = false)")
+ filter: s("progid:DXImageTransform.Microsoft.gradient(enabled = false)")
// Opacity
opacity($opacity = 100)
View
22 lib/patterns.styl
@@ -358,11 +358,10 @@ a.menu:after,
float: none
// Tabbable areas
-.tab-content,
-.pill-content
-
.tab-content > .tab-pane,
-.pill-content > .pill-pane
+.pill-content > .pill-pane,
+.tab-content > div,
+.pill-content > div
display: none
.tab-content > .active,
@@ -513,8 +512,9 @@ footer
// Super jank hack for removing border-radius from IE9 so we can keep filter gradients on alerts and buttons
:root .alert-message,
-:root .btn
-/* border-radius: 0 \0*/
+:root .btn
+ border-radius: s("0 \0")
+
// Help Firefox not be a jerk about adding extra padding to buttons
@@ -689,6 +689,8 @@ input[type=submit].btn
top: 50%
left: 50%
z-index: 11000
+ max-height: 500px
+ overflow: auto
width: 560px
margin: -250px 0 0 -280px
background-color: $white
@@ -698,7 +700,8 @@ input[type=submit].btn
border-radius(6px)
box-shadow(0 3px 7px rgba(0,0,0,0.3))
background-clip(padding-box)
- .close margin-top: 7px
+ .close
+ margin-top: 7px
&.fade
transitions = opacity .3s linear, top .3s ease-out
transition(transitions)
@@ -851,9 +854,9 @@ popoverArrow-right(arrowWidth = 5px)
.fade
transition(opacity .15s linear)
- opacity: 0
+ opacity(0)
&.in
- opacity: 1
+ opacity(100)
// LABELS
// ------
@@ -867,6 +870,7 @@ popoverArrow-right(arrowWidth = 5px)
white-space: nowrap
background-color: $grayLight
border-radius(3px)
+ text-shadow: none
&.important
background-color: #c43c35
&.warning
View
2 lib/reset.styl
@@ -137,7 +137,7 @@ sub, sup
font-size: 75%
line-height: 0
position: relative
- vertical-align: $baseline
+ vertical-align: baseline
sup
top: -0.5em
View
6 lib/scaffolding.styl
@@ -131,7 +131,7 @@ a
offset(1)
& > .offset2
offset(2)
- & > .offsett
+ & > .offset3
offset(3)
& > .offset4
offset(4)
@@ -157,7 +157,7 @@ a
width: 300px
.span-two-thirds
width: 620px
-.offset-one-third
+.row > .offset-one-third
margin-left: 340px
-.offset-two-thirds
+.row > .offset-two-thirds
margin-left: 660px
View
3 package.json
@@ -9,6 +9,9 @@
},
"author": "Michael Prasuhn <mike@mikeyp.net>",
"main" : "./lib",
+ "scripts" : {
+ "test" : "node test/test.js"
+ },
"directories": {
"lib": "."
},
View
2,282 test/bootstrap.css.org
2,282 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
111 test/test.js
@@ -0,0 +1,111 @@
+
+/**
+ * Module dependencies.
+ */
+
+var stylus = require('stylus')
+ , basename = require('path').basename
+ , fs = require('fs')
+ , diff = require('diff');
+
+// whitespace
+
+function _removeMultiliner(str) {
+ str = str || '';
+ str = str.replace(/,\n/gi ,',');
+ str = str.replace(/, /gi ,',');
+ return str;
+}
+
+function removeComments(str) {
+
+ var uid = '_' + +new Date(),
+ primatives = [],
+ primIndex = 0;
+
+ return (
+ str
+ /* Remove strings */
+ .replace(/(['"])(\\\1|.)+?\1/g, function(match){
+ primatives[primIndex] = match;
+ return (uid + '') + primIndex++;
+ })
+
+ /* Remove Regexes */
+ .replace(/([^\/])(\/(?!\*|\/)(\\\/|.)+?\/[gim]{0,3})/g, function(match, $1, $2){
+ primatives[primIndex] = $2;
+ return $1 + (uid + '') + primIndex++;
+ })
+
+ /*
+ - Remove single-line comments that contain would-be multi-line delimiters
+ E.g. // Comment /* <--
+ - Remove multi-line comments that contain would be single-line delimiters
+ E.g. /* // <--
+ */
+ .replace(/\/\/.*?\/?\*.+?(?=\n|\r|$)|\/\*[\s\S]*?\/\/[\s\S]*?\*\//g, '')
+
+ /*
+ Remove single and multi-line comments,
+ no consideration of inner-contents
+ */
+ .replace(/\/\/.+?(?=\n|\r|$)|\/\*[\s\S]+?\*\//g, '')
+
+ /*
+ Remove multi-line comments that have a replaced ending (string/regex)
+ Greedy, so no inner strings/regexes will stop it.
+ */
+ .replace(RegExp('\\/\\*[\\s\\S]+' + uid + '\\d+', 'g'), '')
+
+ /* Bring back strings & regexes */
+ .replace(RegExp(uid + '(\\d+)', 'g'), function(match, n){
+ return primatives[n];
+ })
+ );
+
+}
+
+/**
+ * Test the given `test`.
+ *
+ * @param {String} test
+ * @param {Function} fn
+ */
+
+function test(file, fn) {
+
+ var path = __dirname + '/../lib/' + file + '.styl'
+ , csspath = __dirname + '/' + file + '.css.org';
+
+ fs.readFile(path, 'utf8', function(err, str){
+ if (err) throw err;
+
+ var style = stylus(str)
+ .set('filename', path)
+ .define('url', stylus.url());
+
+ style.render(function(err, actual){
+ if (err) throw err;
+ fs.readFile(csspath, 'utf8', function(err, expected){
+ if (err) throw err;
+ fn(_removeMultiliner(actual), _removeMultiliner(expected));
+ });
+ });
+ });
+}
+
+/**
+ * Auto-load and run tests.
+ */
+var curr = "bootstrap";
+test(curr, function(actual, expected){
+ var path = __dirname + '/' + curr + '.css';
+ fs.writeFile(path+".gen", actual, function (err) {
+ if (err) throw err;
+
+ });
+ fs.writeFile(path+".org", expected, function (err) {
+ if (err) throw err;
+
+ });
+});

0 comments on commit 0d72d05

Please sign in to comment.
Something went wrong with that request. Please try again.