Skip to content

sass问题 #75

Description

@ZongDuCha

sass 错误代码:
/*
Error: Invalid CSS after "*": expected selector, was "{"
on line 6 of sass/index.sass

1: $width:100%
2:
3:
4: $height:20px
5:
6: *{
7: margin:0;
8: padding:0
9: }

Backtrace:
sass/index.sass:6
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/scss/parser.rb:1278:in expected' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/scss/parser.rb:1208:in expected'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/scss/static_parser.rb:21:in parse_selector' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:438:in visit_rule'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/base.rb:36:in visit' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:162:in block in visit'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/stack.rb:79:in block in with_base' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/stack.rb:135:in with_frame'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/stack.rb:79:in with_base' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:162:in visit'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/base.rb:52:in block in visit_children' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/base.rb:52:in map'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/base.rb:52:in visit_children' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:171:in block in visit_children'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:183:in with_environment' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:170:in visit_children'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/base.rb:36:in block in visit' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:190:in visit_root'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/base.rb:36:in visit' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:161:in visit'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/visitors/perform.rb:10:in visit' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/root_node.rb:36:in css_tree'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/tree/root_node.rb:29:in render_with_sourcemap' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/engine.rb:389:in _render_with_sourcemap'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/engine.rb:307:in render_with_sourcemap' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/plugin/compiler.rb:462:in update_stylesheet'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/plugin/compiler.rb:215:in block in update_stylesheets' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/plugin/compiler.rb:209:in each'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/plugin/compiler.rb:209:in update_stylesheets' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/plugin/compiler.rb:443:in on_file_changed'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/plugin/compiler.rb:320:in block in watch' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-listen-4.0.0/lib/sass-listen/event/config.rb:23:in call'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-listen-4.0.0/lib/sass-listen/event/processor.rb:115:in _process_changes' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-listen-4.0.0/lib/sass-listen/event/processor.rb:19:in block in loop_for'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-listen-4.0.0/lib/sass-listen/event/processor.rb:15:in loop' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-listen-4.0.0/lib/sass-listen/event/processor.rb:15:in loop_for'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-listen-4.0.0/lib/sass-listen/event/loop.rb:84:in _wait_for_changes' C:/Ruby24/lib/ruby/gems/2.4.0/gems/sass-listen-4.0.0/lib/sass-listen/event/loop.rb:42:in block in setup'
C:/Ruby24/lib/ruby/gems/2.4.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: Invalid CSS after "
": expected selector, was "{"\A on line 6 of sass/index.sass\A \A 1: $width:100%\A 2: \A 3: \A 4: $height:20px\A 5: \A 6: *{\A 7: margin:0;\A 8: padding:0\A 9: }"; }

sass里的代码:
$width:100%

$height:20px

*{
margin:0;
padding:0
}

// 那位知道是什么原因吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions