PlankTon
PlankTon

Reputation: 12605

Rails 3.1: Where to place SCSS mixins/variables?

Just playing around with Rails 3.1 at the moment, and one issue I'm having is wondering where to place SCSS variables and mixins.

What I mean is, what with scss stylesheets being separated by controller, I'm wondering where to put SCSS variables so that I won't need to redeclare them in every separate stylesheet. I'm guessing there's a standard place?

Cheers

Upvotes: 2

Views: 310

Answers (2)

Daniel Fischer
Daniel Fischer

Reputation: 3062

I recommend a "_base" partial. Put all your stuff in there then include it in application.css.scss and include everything in there that way it inherits from "_base"

Make sure you use SASS @import "*/*"; for the includes and not sprockets, as sprockets doesn't carry over the variables since it's not the SASS engine.

Upvotes: 1

Andrei S
Andrei S

Reputation: 6516

I would recommend looking at twitter's bootstrap and see how it's organized

Upvotes: 0

Related Questions