寫sass 新增config.rd 的方便

現在人在寫SASS很多人直接使用gulp 或webpack ,或是用vs code的套件,這些都能方便的編譯sass,但是這些封裝後編譯完成後其實還是原生的CSS,但是維護上其實都不太方便,唯一方便的就是能快速開發。

以前開發sass都是使用Compass或ruby但隨著編輯器的進步,漸漸的比較少人使用,我自己也是了解一些但從來沒用過,以前遇到一位前輩寫sass就是用ruby,他常常說ruby好用是好用但開發環境布置太麻煩現在不建議去學,可能以後ruby改版會更方便所以了解常關注就好。

而今天要寫的config.rd其實就是ruby自動會產生的檔案,在維護前輩的檔案時其實發現這個檔案神奇的地方

先寫的範例 應該就知道我再說甚麼了

<div>
    <span>sass</span>
</div>
div{
    padding: 20px;
    background-color: #0000ff;
    span{
        color: #00ff00;
    }
}

config.rb(純粹背不起來 想把code寫在這)

# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "css"
images_dir = "img"
javascripts_dir = "js"
output_style = :nested
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
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

You may also like...

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

%d 位部落客按了讚: