0

If my application.css.sass has no extra space in custom css like:

/*
 *= require_self
 *= require_tree .
 */

 .locale {
   float: right;
   margin: -0.25em 0.1em;
 }

I have the usual error: Invalid CSS after "right": expected expression (e.g. 1px, bold), was ";"

But if I add an extra space or more, I don't get the CSS error but the style is not added:

/*
 *= require_self
 *= require_tree .
 */

   .locale {
     float: right;
     margin: -0.25em 0.1em;
   }

With the rest of my custom scss I don't have this problem. I have other applications without this problem.

John Fadria
  • 1,863
  • 2
  • 25
  • 31
  • 1
    Why would you make changes in you `application.css`? Just make a new file, like `main.css.scss` and put all of your styles there. – Vucko Feb 24 '15 at 10:31
  • Thanks vucko. Is a possibility, yes. I'm following the "Agile Web Development with Rails 4" and is coded in this way. I no have problem with other apps, only with this one. I'm trying to understand why. – John Fadria Feb 24 '15 at 10:35
  • What happens if you remove the `.sass` extension -> `application.css`? – Vucko Feb 24 '15 at 10:40
  • @Vucko all the require assets stop to work. – John Fadria Feb 24 '15 at 10:47

1 Answers1

2

Change your file name to application.scss as files with the .sass extension use indented syntax (white space sensitive). This explains your errors.

Here is a debate on which syntax to use.

timsvoice
  • 367
  • 1
  • 9