Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 SASS,并尝试在我的 sinatra 应用程序中使用 scss 加载一个简单的样式表。
main.rb 中的路由处理程序是
get('/styles.css'){ scss :styles }
在布局中(使用超薄视图渲染器),我将 css 文件用作:
link rel="stylesheet" href="/styles.css"
我已经从公用文件夹中删除了样式表,并在视图文件夹中创建了 styles.scss,但无法在呈现的页面中获取 css 文件。
解决了这个问题。主要问题是我在 sass 文件中有一个错误,导致它静默失败。在搜索生成的css文件时http://localhost:4567/styles.css,报错。在悬停选项上,&:hover { background: darken($background, 20%); 我用 $ 代替了“&”符号。
http://localhost:4567/styles.css
&:hover { background: darken($background, 20%);