Why is this fundamental SASS file not compiling?

42 Views Asked by At

Here is the .sass file:

/* Welcome to Compass.
 *
 * ie.sass
 *
 * Use this file to write IE specific override styles.
 *
 * Import this file using the following HTML or equivalent:
 * <!--[if IE]>
 *   <link rel="stylesheet" type="text/css"
 *         href="/stylesheets/ie.css" media="screen, projection" />
 * <![endif]-->
 */

html {
    font-size: 24px;
}

Here is the error generated by Koala:

/*
Error: Invalid CSS after "html ": expected selector, was "{"
        on line 14 of /Users/johnlove/Sites/www.lovetoteach.dev/Web_Site_Storage/lovesongforever.com/coronavirus/Coronavirus_Support/sass_test/ie_test.sass

9:  *   <link rel="stylesheet" type="text/css"
10:  *         href="/stylesheets/ie.css" media="screen, projection" />
11:  * <![endif]-->
12:  *\/
13:  
14: html {
15: 
16: }

I've made certain all properties are indented once. I have also eliminated the {} and trailing semi-colons.

Same error!

Why?

1

There are 1 best solutions below

0
AudioBubble On

The answer is that even the resident sass compiler demands that the input sass file does not have either {} or the trailing ;

So, when I eliminate both, the sass compiler registers success.

I thought either with or without {} and with or without ; was acceptable?

I have answered my original question, only to replace it with a different question?

I finally forced myself to decide which I liked best. It is clear that I strongly prefer SASC because I strongly prefer the {} over the indented syntax of SASS. Don’t really care too much about semicolons, but I abhor relying on indentation.

So SASC wins also because just changing the file extension from .css to .sasc makes the newly named .sasc compile as a SASC file