New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined variable: "$em-base" #632
Comments
The issue was because I had |
@flynfish are we not supposed to precompile the css for production? If I don't precompile, it did not show up at production. If I try, I am getting this same error. |
@flynfish I guess I am not supposed to expect anything precompiled for scss file. Just my server setup problem then. 🐸 |
Really @achiinto ?!? If we can't precompile then I can't use bourbon |
@flynfish it's kinda depressing and seems like it should be a priority because (a) probably not that hard of a thing to fix and (b) since it's broken we just went with an in-house (/ semi-kludgy) solution that gets the job done. Now even if this issue is resolved, we'd have the wasted time of rolling our own plus it'd take us more development time to switch to bourbon. I assume we're not alone there. |
remote: Sass::SyntaxError: Undefined variable: "$em-base". |
Can anyone share their code? Also, did you remove all Sprockets directives from your |
I ripped bourbon out and rolled my own version of the functions I needed a couple months back, and I us application.css but doesn't it seem a bit extreme to load my scss files, but doesn't it seem a bit extreme to ask people to monkey with their use of Sprockets just to use a «lightweight» library ? |
@sebmor Not sure I’m following or understand your comment above… But in regards to Sprockets, Step 4 of our installation instructions have you remove those directives because we have Sass do the concatenating/importing instead. Here’s a great article on why that is » http://pivotallabs.com/structure-your-sass-files-with-import/ |
Maybe I'm missing something but I don't actually see a «why» there - merely instructions on the «what» and «how». That's fine but it's not very compelling. I like the idea of using the native SASS @import but I have 19 stylesheets in my main Rails app. You're saying: go through all of those and switch to @import everywhere. That's almost certainly not just a search/replace job and will have side-effects. Not to get ranty here but what's really annoying is that this used to work for me with the asset pipeline / without that /\ surgery and then broke at some point so obviously it's possible to make it work. Given that I've already wasted a lot of time on this (first trying to make Bourbon work and then writing my own functions), telling me that maybe if I monkey around and potentially break a lot of things that are already working and then /maybe/ it'll work does not encourage me. |
@smenor The why is the Sprockets methods import the stylesheets in alphabetical order, which not only messes with the cascading part of stylesheets, but if you are using Sass mixins then you may end up trying to use a mixin or function before it is defined. It's an issue that comes up with Sprockets + Sass in general. If you need to be picky about your import order, it's best to use Sass's |
@sebmor Yeah, I mean it is a bummer, don’t get me wrong. It makes our installation a bit more complex by adding an extra step and possibly making authors change the way they do things…but it’s just the situation we’re in. Sprockets does things a certain way when importing and it doesn’t work nicely alongside Sass Thank you for expressing that we could be more clear in our instructions as to why we need Sprockets directives to be removed. I’ll put up a PR tomorrow to try to make that more clear. |
@tysongach It still doesn't work for me. I use activeadmin which uses bourbon gem. I removed all "require" and still no luck. Any advice? |
I just use |
And that doesn't seem like a horrible kludge to you ?
|
@smenor It does, but I didn't find anything better for now. |
I have same error. Please, reopen issue. |
This is a nightmare. Will have to stop using bourbon |
@nguyenchiencong @izumeroot @hansottowirtz @AntonFilipko Can any of you share your code? Are you all using within a Ruby on Rails app, or something else? What version of Bourbon? |
Look like I have fixed it. The problem was in my config/initializers/assets.rb file.
And I think I had error because Asset Pipeline compiled scss-files of bourbon not in correct context. Now I have changed my assets.rb file:
And I have not error. |
@izumeroot In your |
application.css.scss:
|
@izumeroot Where are you importing Bourbon? Also within |
It is imported by active_admin gem. I use active admin. |
I do not have any sprockets directives, I just have a dependencies.scss file with It is indeed in Ruby on Rails, and I always use the latest version of bourbon (4.2.7). Every time I update bourbon, I just put |
My assets.rb file: When precompiling _modular_scale.scss, it doesn't find the It might not be best practice to use the If you are not adding the default rule, I would certainly recommend not using |
I'm getting this error when assets:precompile runs...
The text was updated successfully, but these errors were encountered: