-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 mixins #2128
Comments
FWIW, It works if I |
Have the same problem found a workaround @import 'foundation/foundation-global'
@import 'foundation/components/grid' instead of @import "foundation" However this duplicates all foundation class definitions in every file you import it in :\ Far from good solution |
I've got the same problem in 4.1.6. The "far from good"-solution above works though. |
Update on this one @import 'foundation_and_overrides'
@import 'registrations' Then in registrations.css.scss mixins can be used without import header {
}
.entry-content {
@include grid-row;
.app-preview {
@include grid-column(4);
@extend .hide-for-small;
@extend .ie-column-4;
}
.sign-up{
@include grid-column(12);
@media #{$small} {
@include grid-column(8);
}
input[type=submit] {
@extend .button;
@extend .radius;
}
}
} I'll look into updating docs later this/next week. |
I still have the same problem and none of the workarounds mentioned work for me. I'm on Foundation 4.2.2, and Rails 4(rc2). Foundation works fine even though inside my foundation_and_overrides.scss, the @import 'foundation' causes macvim to complain "file to import not found or unreadable: foundation". |
👍 |
Same problem here. Rails 4, Foundation 4.2.2. I'm trying to adhere to the "Rails Way", keeping CSS split up among many .scss files and letting the asset pipeline do its thing. I can't use mixins without the already noted problems. |
Same with Rails 3. Doing this: Which i previously got before i realised i had to include compas_rails gem. Not sure why its cropped back in? Ideally i'd use sass rather than asset pipeline for this stuff but thats throwing errors too, probably because i used the gem. |
Unfortunately it looks like this is an issue with the way the asset pipeline works in Rails. The solution proposed by @Maxim-Filimonov is the way to go in this case. Cheers! |
See discussion on the issue foundation#2128
I found another way to improve this situation.
Steps 1 and 2 put all of Foundation's base styles and classes into Steps 3 and 4 put all of Foundation's mixins into Summaryapplication.css:/* ...
*= require foundation_and_overrides
* ... foundation_and_overrides.css.scss:// my other settings...
// $include-html-classes: true;
// ... foundation_mixins_only.css.scss:$include-html-classes: false
@import 'foundation_and_overrides' This seems like it meets all my needs, I'll continue to test and will update with any issues. EDIT: |
Just hit this in Rails 4 and F5. Only @bradfeehan's solution seems to work. Thanks for posting Brad! What needs to change to make this work out of the box? I'm not clear on how this workaround actually fixes the issue. |
I'm not sure that the workaround I posted is that undesirable -- I think it's a matter of preference, part of the way you want to set up your own app. The Foundation Rails gem integrates Foundation with Rails one way; this is just an alternative way to set it up. Especially in this case, it seems like the users affected want to use Foundation with Rails in a slightly different way to the mainstream (otherwise the default installation method would be better suited to what we want to do). I also don't know if my method is strictly "better" than the default. It's certainly better for me, but it might break something which is used very commonly. |
I've noticed that with Foundation 5 and using the @bradfeehan solution there are, in fact, some styles that still get copied into each stylesheet that imports foundation_mixins_only. For example these styles get imported: /* line 259, C:/Ruby193/lib/ruby/gems/1.9.1/gems/foundation-rails-5.1.1.0/vendor/assets/stylesheets/foundation/components/_global.scss */ /* line 264, C:/Ruby193/lib/ruby/gems/1.9.1/gems/foundation-rails-5.1.1.0/vendor/assets/stylesheets/foundation/components/_global.scss */ /* line 269, C:/Ruby193/lib/ruby/gems/1.9.1/gems/foundation-rails-5.1.1.0/vendor/assets/stylesheets/foundation/components/_global.scss */ Is there a solution that fixes this? This would be a ton easier if Foundation just had a separate mixin file and did not couple their mixins to their components. |
On Stackoverflow someone says he solved adding on top of the file....works also for me |
@coorasse unfortunately, I'm getting an undefined mixin alert message when I use this. |
I renamed my @import "foundation_and_overrides";
@import "custom/buttons"; # my custom file Working pretty great. |
Rails 3.2.19 , foundation-rails (5.3.1.0) |
👍 |
How is this fixed? I am still unable to get mixins working. My application.css.scss:
However I still get an error |
Fresh install of Foundation 4.1.1 in a Rails 4 app. Foundation itself seems to load fine, and I can use all features if I go the route of adding classes to everything. But trying to use any mixin results in undefined mixin.
application.css.scss:
layout.css.scss
The text was updated successfully, but these errors were encountered: