zweilove / css_splitter

Gem for splitting up stylesheets that go beyond the IE limit of 4095 selectors, for Rails 3.1+ apps using the Asset Pipeline.
MIT License
160 stars 47 forks source link

split2 css file duplicates original #15

Closed joekur closed 11 years ago

joekur commented 11 years ago

Hey, I have followed your installation instructions. I am trying to split my application.css file. I have an application_split2.css.split2 with:

//= include 'application.css'

It appears to be identical to my application.css when I test with IE, instead of the "second half" of it. Is there something I may be missing?

Thanks

jhilden commented 11 years ago

From what you are telling I can't see anything obvious that you are missing.

You should indeed have the second half of your orgininal stylesheet in application_split2. Are you sure that your orginal stylesheet is surpassing the IE limit? Or maybe it has something in it that makes the css_splitter count wrong. Would it be possible to provide your stylesheet to me in some way?

jessegoodnoe commented 11 years ago

I had this same problem. For me the issue was that my application.css still had = require_self in it. The README doesn't mention that in the gotchas, it only mentions require_tree.

By leaving require_tree in the application.css, I was getting an application_split2.css that contained all of application.css AND then the split2 contents.

I'd recommend adding something about require_self to the Gotchas section of the README.

jhilden commented 11 years ago

Thanks a lot for the information @jessegoodnoe. @joekur does that fix your problem?

@jessegoodnoe do you mind making a PR for the proposed README change? I think it would best be written by somebody who has encountered the issue first hand. Otherwise I'll give it a try.

joekur commented 11 years ago

I ended up just manually splitting my css files, but I can say that I was using a require_self so that probably was the issue :)