Permalink
Browse files

adding Less CSS

  • Loading branch information...
1 parent 6d5b461 commit 5a82f96229fc4a1c594bc116f857fc1eefbee21d @croaky committed Mar 4, 2010
Showing with 95 additions and 4 deletions.
  1. +4 −1 README.md
  2. +1 −1 Rakefile
  3. +90 −2 bin/groove
View
@@ -2,7 +2,7 @@ Groove
======
Generator to create a web application consisting of
-Sinatra, MongoDB, jQuery, HTML5, Effigy, and Hoptoad.
+HTML5, Less CSS, jQuery, Effigy, Sinatra, MongoDB, and Hoptoad.
Usage
-----
@@ -14,6 +14,9 @@ groove weekapaug
create weekapaug/app.rb
create weekapaug/templates/index.html
create weekapaug/views/index.rb
+ create weekapaug/public/css/screen.css
+ create weekapaug/public/css/screen.less
+ create weekapaug/README.md
create weekapaug/.gitignore
Example deploy
View
@@ -3,7 +3,7 @@ require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "groove"
gem.summary = "Web application generator."
- gem.description = "Generator to create a web application consisting of Sinatra, MongoDB, jQuery, HTML5, Effigy, and Hoptoad."
+ gem.description = "Generator to create a web application consisting of HTML5, Less CSS, jQuery, Effigy, Sinatra, MongoDB, and Hoptoad."
gem.email = "dcroak@thoughtbot.com"
gem.homepage = "http://github.com/dancroak/groove"
gem.authors = ["Dan Croak"]
View
@@ -15,8 +15,8 @@ source :gemcutter
gem 'sinatra'
gem 'hoptoad_notifier'
-gem 'sinatra-effigy', :require_as => 'sinatra/effigy'
-gem 'sinatra-mongoid', :require_as => 'sinatra/mongoid'
+gem 'sinatra-effigy', :require => 'sinatra/effigy'
+gem 'sinatra-mongoid', :require => 'sinatra/mongoid'
RUBY
end
end
@@ -61,6 +61,7 @@ RUBY
<head>
<meta charset="utf-8">
<title>#{name}</title>
+ <link rel="stylesheet" href="/css/screen.css" media="screen">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" async></script>
</head>
<body>
@@ -84,13 +85,100 @@ RUBY
end
end
+ def create_stylesheet
+ create_file("#{name}/public/css/screen.css") do
+<<-CSS
+CSS
+ end
+ end
+
+ def create_less
+ create_file("#{name}/public/css/screen.less") do
+<<-CSS
+.rounded-corners (@radius: 5px) {
+ -moz-border-radius: @radius;
+ -webkit-border-radius: @radius;
+ border-radius: @radius;
+}
+
+.shadow (@x-offset: 1px, @y-offset: 1px, @blur: 1px, @color: @white) {
+ box-shadow: @x-offset @y-offset @blur @color;
+ -moz-box-shadow: @x-offset @y-offset @blur @color;
+ -webkit-box-shadow: @x-offset @y-offset @blur @color;
+}
+
+.opacity (@opacity: 0.7) {
+ -moz-opacity: @opacity;
+ -khtml-opacity: @opacity;
+ opacity: @opacity;
+}
+
+.center {
+ margin: 0 auto;
+ position: relative;
+}
+
+.bye-text {
+ text-indent: -9999px;
+ *line-height: 999px;
+}
+
+.text-shadow (@color: @black) {
+ text-shadow: @color 1px 1px 0;
+}
+CSS
+ end
+ end
+
def create_gitignore
create_file("#{name}/.gitignore") do
<<-RUBY
.bundle
RUBY
end
end
+
+ def create_readme
+ create_file("#{name}/README.md") do
+<<-MARKDOWN
+Setup
+-----
+
+ sudo gem uninstall bundler (all versions)
+ sudo gem install bundler -v=0.9.6
+ sudo gem install shotgun thin less
+
+Gems
+----
+
+ bundle install
+ bundle lock
+
+Development
+-----------
+
+In one shell:
+
+ shotgun config.ru
+
+In another shell:
+
+ mongod
+
+In another shell:
+
+ cd public/css
+ lessc screen.less --watch
+
+This will automatically update .css files of the same name when you change
+your .less files.
+
+Make all CSS changes in .less files.
+
+Docs at http://lesscss.org/
+MARKDOWN
+ end
+ end
end
Groove.start

0 comments on commit 5a82f96

Please sign in to comment.