Skip to content

Instantly share code, notes, and snippets.

@thr3a
Last active June 13, 2016 03:38
Show Gist options
  • Save thr3a/ff610f64c849c2e243c4ae577177494d to your computer and use it in GitHub Desktop.
Save thr3a/ff610f64c849c2e243c4ae577177494d to your computer and use it in GitHub Desktop.

Gemfile に以下を追加

gem 'compass'

ひな壇を生成

bundle exec compass create <ProjectName>

すると以下のように生成される

<ProjectName>
├── Gemfile
├── Gemfile.lock
├── config.rb
├── sass
│   ├── ie.scss
│   ├── print.scss
│   └── screen.scss
├── stylesheets
│   ├── ie.css
│   ├── print.css
│   └── screen.css

監視する

bundle exec compass watch

CAKEPHPでやる

app/webroot にてCakePHPに合わせたひな壇生成

bundle exec compass help create すると生成に関するオプションが見れる

compass create --css-dir "css" --images-dir "img" --javascripts-dir "js" --sass-dir "sass" --bare

既存のファイルをSCSS化

exec sass-convert --from css --to scss css/base.css sass/base.scss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment