Mataess
Mataess

Reputation: 3

Indenting at the beginning of the document is illegal -- SASS

I am experiencing an issue with SASS.

I have installed RUBY 2.7.0 and also SASS 3.7.4. At the moment I am trying to learn more about SASS, however, I have the following issue while trying to define a variable $fontHome

SASS

$fontHome: #c6538c

body
background-color: cadetblue
h1
    color: $font-color

CSS

/*
Error: Indenting at the beginning of the document is illegal.
        on line 1 of styles.sass

1:     $fontHome: #c6538c
2:     
3:     body
4:     background-color: cadetblue
5: 
6:     h1

Backtrace:
styles.sass:1
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/engine.rb:469:in `block in tabulate'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/engine.rb:452:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/engine.rb:452:in `each_with_index'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/engine.rb:452:in `tabulate'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/engine.rb:417:in `_to_tree'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/engine.rb:389:in `_render_with_sourcemap'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/engine.rb:307:in `render_with_sourcemap'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/plugin/compiler.rb:462:in `update_stylesheet'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/plugin/compiler.rb:209:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/plugin/compiler.rb:443:in `on_file_changed'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-3.7.4/lib/sass/plugin/compiler.rb:320:in `block in watch'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-listen-4.0.0/lib/sass-listen/event/config.rb:23:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-listen-4.0.0/lib/sass-listen/event/processor.rb:115:in `_process_changes'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-listen-4.0.0/lib/sass-listen/event/processor.rb:19:in `block in loop_for'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-listen-4.0.0/lib/sass-listen/event/processor.rb:15:in `loop'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-listen-4.0.0/lib/sass-listen/event/processor.rb:15:in `loop_for'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-listen-4.0.0/lib/sass-listen/event/loop.rb:84:in `_wait_for_changes'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-listen-4.0.0/lib/sass-listen/event/loop.rb:42:in `block in setup'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sass-listen-4.0.0/lib/sass-listen/internals/thread_pool.rb:6:in `block in add'
*/
body:before {
  white-space: pre;
  font-family: monospace;
  content: "Error: Indenting at the beginning of the document is illegal.\A         on line 1 of styles.sass\A \A 1:     $fontHome: #c6538c\A 2:     \A 3:     body\A 4:     background-color: cadetblue\A 5: \A 6:     h1"; }

Any help would be much appreciated!

Upvotes: 0

Views: 393

Answers (1)

blackbiron
blackbiron

Reputation: 827

your indentation on this line: background-color: cadetblue is causing error. it should be consistent.

$fontHome: #c6538c

body
  background-color: cadetblue

h1
  color: $font-color

  span
    color: red

in my example i'm using 2 spaces of indentation.

official documentation

Upvotes: 1

Related Questions