0

I have a rails app that was built using foundation 3 (not using the gem. It is located in vendor/assets/stylesheets/foundation.min.css).

And I want to gradually convert my styling code to Bourbon/Neat.

One thing I have to have in mind is not to break the previous layouts while I'm not done with the recoding.

Is it possible to do this?

rails version: 3.2.13 ruby: 1.9.3

abarro
  • 25
  • 7
  • Sure, just make sure that whatever pages have Foundation styling have a link to that stylesheet, and whatever pages have Bourbon/Neat styling have a link to that stylesheet – Tyler Mar 24 '14 at 21:05
  • Hi @tyler this clarified my problem. If you wish to add it as an answer... – abarro Mar 25 '14 at 14:47

1 Answers1

0

For any given page in your app, you can include whatever styling you want by including the stylesheets on that page.

So for pages that have Foundation styling, make sure you have a link to that stylesheet, and for pages have Bourbon/Neat styling, have a link to that stylesheet.

You typically see all the stylesheets included together in the layout file, by adding something like:

<%= stylesheet_link_tag "application", media: "all" %>

This simply points to an index file (assets/stylesheets/application.css), which in turn lists all the other stylesheets that should be included on the page.

If you want, you could either include the stylesheets into your pages one-by-one, or you could use 2 different layouts: 1 for Foundation and 1 for Bourbon/Neat. Then within each of those layouts have different stylesheet sets:

# points to assets/stylesheets/foundation.css
<%= stylesheet_link_tag "foundation", media: "all" %>

# points to assets/stylesheets/bourbon.css
<%= stylesheet_link_tag "bourbon", media: "all" %>

Then as you transition from one to the other, you can just change the controller actions one at a time to use the Bourbon/Neat stylesheet set by using the Bourbon/Neat layout.

Tyler
  • 11,272
  • 9
  • 65
  • 105
  • Just providing some additional information on how things worked for me. I installed Bourbon/neat as ruby GEMs. So I just had to add `@import "bourbon"; @import "neat";` on the css files I wanted to use them. Thanks a lot @tyler – abarro Mar 25 '14 at 18:59