初学sass在screen.scss中写样式,但在screen.css中没有显示出来。


在screen.scss中写的headline 和main-sec没有在screen.css中显示。
图片描述
图片描述
图片描述
图片描述

sass compass css框架 web前端开发

宅到破天荒 10 years ago

变量的定义是对的,但是使用错了,你在使用的时候应该是这样才对: $xxx... 这样变量的值才支持逗号分开,不然这样会默认选择第一个值

刚才查了一下,变量使用...只支持传递参数中,如果是这样的话,就写成@mixin咯,然后将你多个值的变量当作参数传进去咯....

bbkill answered 10 years ago

命令行设置监听,路径自己修改一下


 sass --watch screen.scss:screen.css

聖女候補生 answered 10 years ago

编译命令有没有问题?有没有报错?

我试了我这边没问题。
安装了 sass compass
然后 compass create sass-test
转到 sass-test 目录,执行命令 compass watch

图片描述

图片描述

config.rb :


 require 'compass/import-once/activate'
# Require any additional compass plugins here.

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"

# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed

# 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

眨眼时已是未来 answered 10 years ago

Your Answer