Permalink
Browse files

Merge branch 'release/v0.1.6'

  • Loading branch information...
2 parents 77df57b + 27115f5 commit 059788baa3e281514fcc0968afc606f375020131 @vwall committed Sep 18, 2011
View
@@ -16,3 +16,4 @@ spec/reports
test/tmp
test/version_tmp
tmp
+.sass-cache
View
@@ -0,0 +1,22 @@
+# Overview
+
+## 0.1.6
+* Start of a less to scss converter
+* Added change log
+
+## 0.1.5
+* Upgraded to twitter bootstrap version 1.3
+* Asset Pipeline (thanks to ascrazy)
+
+## 0.1.4
+Upgraded to twitter bootstrap version 1.2
+
+## 0.1.3
+* fix firefox button:hover bug
+
+## 0.1.2
+* Added homepage link
+* Updated app name
+
+## 0.1.1
+initial version
@@ -1,3 +1,3 @@
module CompassTwitterBootstrap
- VERSION = "0.1.4"
+ VERSION = "0.1.6"
end
View
@@ -0,0 +1,69 @@
+class Convert
+ def process
+ less_files.each do |name, file|
+ file = open_git_file(file)
+ file = convert(file)
+ save_file(name, file)
+ end
+ end
+
+private
+
+ def less_files
+ {
+ '_reset' => 'https://raw.github.com/twitter/bootstrap/master/lib/reset.less',
+ '_variables' => 'https://raw.github.com/twitter/bootstrap/master/lib/variables.less',
+ '_scaffolding' => 'https://raw.github.com/twitter/bootstrap/master/lib/scaffolding.less',
+ '_type' => 'https://raw.github.com/twitter/bootstrap/1.3-wip/lib/type.less',
+ '_forms' => 'https://raw.github.com/twitter/bootstrap/master/lib/forms.less',
+ '_tables' => 'https://raw.github.com/twitter/bootstrap/master/lib/tables.less',
+ '_patterns' => 'https://raw.github.com/twitter/bootstrap/1.3-wip/lib/patterns.less'
+ }
+ end
+
+ def convert(file)
+ file = replace_vars(file)
+ file = replace_fonts(file)
+ file = replace_grads(file)
+ file = replace_mixins(file)
+ file = replace_includes(file)
+ file = replace_spin(file)
+
+ file
+ end
+
+ def open_git_file(file)
+ URI.parse(file).read
+ end
+
+ def save_file(name, content)
+ f = File.new("#{name}.scss", "w")
+ f.write(content)
+ f.close
+ end
+
+ def replace_vars(less)
+ less.gsub(/@/, '$')
+ end
+
+ def replace_fonts(less)
+ less.gsub(/#font \> \.([\w-]+)/, '@include \1')
+ end
+
+ def replace_grads(less)
+ less.gsub(/#gradient \> \.([\w-]+)/, '@include gradient-\1')
+ end
+
+ def replace_mixins(less)
+ less.gsub(/^\.([\w-]*)(\(.*\))([\s\{]+)$/, '@mixin \1\2\3')
+ end
+
+ def replace_includes(less)
+ less.gsub(/\.([\w-]*)(\(.*\));?/, '@include \1\2;')
+ end
+
+ def replace_spin(less)
+ less.gsub(/spin/, 'adjust-hue')
+ end
+
+end
@@ -1,5 +1,5 @@
/*!
- * Bootstrap v1.1.1
+ * Bootstrap v1.3.0
*
* Copyright 2011 Twitter, Inc
* Licensed under the Apache License v2.0
@@ -10,11 +10,15 @@
*/
@import "compass";
+
// CSS Reset
@import "compass_twitter_bootstrap/reset";
-// Core
-@import "compass_twitter_bootstrap/preboot";
+// Core variables and mixins
+@import "compass_twitter_bootstrap/variables";
+@import "compass_twitter_bootstrap/mixins";
+
+// Grid system and page structure
@import "compass_twitter_bootstrap/scaffolding";
// Styled patterns and elements
Oops, something went wrong.

0 comments on commit 059788b

Please sign in to comment.