Editing my SASS stylesheets in the asset pipeline seems to break the asset pipeline

风格不统一 提交于 2019-12-12 02:03:51

问题


This is driving me nuts - I have a Rails app built on Bootstrap. I have been plugging along for a few weeks and today I hit a very bizarre issue. If I make any trivial change (i.e. add a new line and save) to ANY style sheet I loose a bunch of my CSS formatting.

This is hard to explain without some how publishing all my code etc. The biggest symptom is the loss of my Google fonts.

Here is the top part of my application.css.scss file:

@import "font-awesome-sprockets";
@import "font-awesome";

@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,400,300,600,700);

/*** BOOTSTRAP ***/


/* Needs to load first to overide the default CSS */

@import "bootstrap_custom";

@import "bootstrap-sprockets";
@import "bootstrap";
@import "timeline";

I have some more custom CSS after this too. The font-awesome and bootstrap CSS still seems to load. The CSS code that seems to disappear is the bootstrap_custom. This is where I have my Google fonts and some custom CSS for my nav-bar.

Restarting the rails server does not fix it. Replacing the edited css file does not work. I literally have to restore an older version of the entire app directory.

It does not matter if I change the file with terminal or TextMate - same result.

If it matters I am running Rails 4.1.8 on OS X 10.10.1. I must hame something configured wrong or there is some weird Rails server cache or setting I am missing here. The fact I have to restore the entire app directory would lead me to believe this.

UPDATE

I think its a SASS or Bootstrap-sass issue. I ran the CSS from both versions through an online file compare site. The working version has CSS comments like this:

/* line 111, /Users/dan/.rvm/gems/ruby-2.0.0-p247/gems/bootstrap-sass-3.3.1.0/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-control.right {...

and the broken one:

/* line 5482, /Users/dan/Rails/broken-app/vendor/assets/stylesheets/bootstrap.css */ 
.carousel-control.right {...

The working one also has around 500 more lines of CSS! Again this was just after adding a line to my application.css.css file, deleting it and saving it again. Same result if you clear the cache. Will look at my gems versions etc.

来源:https://stackoverflow.com/questions/28061058/editing-my-sass-stylesheets-in-the-asset-pipeline-seems-to-break-the-asset-pipel

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