Skip to content

Instantly share code, notes, and snippets.

@masamitsu-konya
Created May 8, 2014 10:15
Show Gist options
  • Save masamitsu-konya/b875a7eff0321c74ce97 to your computer and use it in GitHub Desktop.
Save masamitsu-konya/b875a7eff0321c74ce97 to your computer and use it in GitHub Desktop.
CSSが超絶便利になる!Compassについてまとめてみた ref: http://qiita.com/masamitsu-konya/items/8ae3ed489aef1388814a
div {
text-indent: -119988px;
overflow: hidden;
text-align: left;
background-image: url(/icon/iconmonstr-archive-icon-256.png);
background-repeat: no-repeat;
background-position: 50% 50%;
}
div {
@include replace-text('/icon/iconmonstr-archive-icon-256.png');
}
gem update --system
gem install compass
compass create project名
compass create compass-test
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/" #HTTPパス
css_dir = "stylesheets" #cssが書き出されるディレクトリ名
sass_dir = "sass" #sass(scss)ファイルがあるディレクトリ名
images_dir = "images" #画像を置くディレクトリ名
javascripts_dir = "javascripts" #javascriptを置くディレクトリ名
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
output_style = :expanded #CSSへの書き出しスタイル
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
cd compass-test
compass watch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment