add "pixate:init" task

This commit is contained in:
Watson
2013-01-03 09:50:11 +09:00
parent 2cb94a9ca7
commit 827989b0bc
2 changed files with 16 additions and 1 deletions

View File

@@ -44,7 +44,7 @@ motion-pixate provides "style" method in REPL. You could change the stylesheet a
(main)> style "button { background-color: red; corner-radius: 20pt; }"
```
motion-pixate supports [Sass](http://sass-lang.com/) to generate the stylesheet. Create the `sass` directory and `default.scss` into the `sass` directory. `rake pixate:sass` command generates the stylesheet from `default.scss`.
motion-pixate supports [Sass](http://sass-lang.com/) to generate the stylesheet. Create the `sass` directory and `default.scss` with the `rake pixate:init` command. Then, `rake pixate:sass` command generates the stylesheet from `default.scss`.
You could specify the Sass output style through `style` environment variable. For example,
```

View File

@@ -63,6 +63,21 @@ module Motion; module Project; class Config
end; end; end
namespace 'pixate' do
desc "Create initial stylesheet files"
task :init do
unless File.exist?("sass/default.scss")
mkdir_p "sass"
touch "sass/default.scss"
App.info 'Create', 'sass/default.scss'
end
unless File.exist?("resources/default.css")
mkdir_p "resources"
touch "resources/default.css"
App.info 'Create', 'resources/default.css'
end
end
desc "Compile SCSS file"
task :sass do
unless File.exist?("sass/default.scss")