1

Its a Rails 4 project. In the file app/assets/stylesheets/application.css.scss, I've

/*
 *= require_self
 */
@mixin row() {
  color: blue;
}

body {
  h1 {
    @include row;
  }
}

Starting the server and viewing in the browser works fine.

Now I take that mixin and put in the file vendor/assets/stylesheets/external.scss

@mixin row() {
  color: blue;
}

and require it in the application.css.scss as the following:

/*
 *= require external
 *= require_self
 */

body {
  h1 {
     @include row;
  }
}

And refresh the browser, it errors out with

Sass::SyntaxError 
Undefined mixin 'row'.

Why is the mixin defined in the external file is not working??

millisami
  • 9,931
  • 15
  • 70
  • 112

1 Answers1

0

this might not be very helpful for your error, but from the guides it says:

In this example require_self is used. This puts the CSS contained within the file (if any) at the precise location of the require_self call. If require_self is called more than once, only the last call is respected.

it is also discussed in this answer: What does require_self mean?

Community
  • 1
  • 1
phoet
  • 18,688
  • 4
  • 46
  • 74
  • definitely its not helpful for the error i m facing. want the solution addressing the problem. I'd also tried deleting the `require_self` line and adding in the separate file and requiring it manually too. – millisami Oct 19 '13 at 16:33
  • did you try renaming the file? maybe there is another resource named the same way? – phoet Oct 19 '13 at 17:34
  • which file your are talking to rename about? – millisami Oct 20 '13 at 14:23
  • the `external` file. the name is pretty generic, so there might be some other file shadowing this. – phoet Oct 20 '13 at 14:27
  • nop, i dont think so. coz before renaming to `external`, it was `landing`, I renamed on purpose as an example only. – millisami Oct 21 '13 at 03:20