SASS Invalid CSS error on Rails

匿名 (未验证) 提交于 2019-12-03 03:05:02

问题:

I'm trying to use http://startbootstrap.com/stylish-portfolio in my rails app however I'm getting the following error in my stylish-portfolio.css.scss.erb file:

ActionView::Template::Error (Invalid CSS after "body ": expected selector or at-rule, was "{" 

This is my css file:

@import 'bootstrap'  /* Global Styles */  html, body {   height: 100%;   width: 100%; }  .vert-text {   display: table-cell;   vertical-align: middle;   text-align: center; }  .vert-text h1 {   padding: 0;   margin: 0;   font-size: 4.5em;   font-weight: 700; } 

...

回答1:

My guess is that you are missing a semicolon in the stylish-portfolio.css.scss.erb file, maybe after an SCSS variable definition?

Here's the original CSS file I assume you are basing this on, maybe you want to do a diff between that and yours to determine what has changed.


Edit: Yup, apparently there is a missing semicolon after the first line. The @import statement

@import 'bootstrap' 

should instead be

@import 'bootstrap'; 

since you are using the .scss extension. You can omit the semi-colon if you are using the .sass extension.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!