Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a lot of legacy CSS files from what was a Rails 2.x app that got upgraded to Rails 3.2.8, and I want to switch over to using the Rails asset pipeline for stylesheets. The issue is, the CSS stuff is messy in terms of huge lines of code, duplicate file names, and unorganized folder structure.

After looking through individual pages, and trying to add individual stylesheets and folders into the asset pipeline and spending some cycles debugging, I realized there's probably a better approach.

Is there a way to test to make sure the old CSS matches up with the asset pipeline CSS? What are some good tools for testing and debugging CSS?

share|improve this question
1  
Is this an opportunity to refactor and improve the CSS? –  Wyatt Barnett Dec 7 '12 at 16:29
    
Yes, it's possible to refactor and improve the CSS. Would it be better to do this before switching to use the asset pipeline? –  John Dec 9 '12 at 5:39
1  
Well, if you are going to be heavily touching the CSS to the point you are taking on the expensive part of that process -- that is the manual QA CSS requires oftentimes -- you might as well since the costs are already sunk. –  Wyatt Barnett Dec 9 '12 at 16:12
    
I don't understand what you mean. You can use exactly the same CSS in the Asset Pipeline. Could you please elaborate on your question? Do you want help on how to refactor your stylesheets? If so, you should give some examples on the current state. If you just want to know what to do to migrate them to Rails 3 (or 4), then simply move them to app/assets/stylesheets and change your urls to image-path, etc, and tell your app which of them should be precompiled or if you're going to concatenate all of them into a single precompiled stylesheet (best for performance). –  rosenfeld Mar 10 at 18:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.