SCSS 변수를 인식할 수 없습니다.

5676 단어 csscss

묘사

SCSS 변수 선언이 있을 때마다 파서에서 오류가 발생합니다(아래에 붙여넣기).
복사할 코드:
$foo:#666;
오류 출력:
Had a problem parsing the css at line: 1, column: 1
Failed to match sequence (SPACE? blocks:((COMMENT / NESTED_RULESET / RULESET){1, }) SPACE?) at line 1 char 1.
`- Expected at least 1 of COMMENT / NESTED_RULESET / RULESET at line 1 char 1.
   `- Expected one of [COMMENT, NESTED_RULESET, RULESET] at line 1 char 1.
      |- Failed to match sequence (SPACE? '/*' (!'*/' .){0, } '*/' SPACE?) at line 1 char 1.
      |  `- Premature end of input at line 1 char 1.
      |- Failed to match sequence ('@' [^{}]{1, } '{' (COMMENT / RULESET){0, } '}' SPACE?) at line 1 char 1.
      |  `- Premature end of input at line 1 char 1.
      `- Failed to match sequence (selector:([^{}]{1, }) '{' SPACE? properties:((COMMENT / ATTRIBUTE / BLANK_ATTRIBUTE){0, }) '}' SPACE?) at line 1 char 1.
         `- Expected at least 1 of [^{}] at line 1 char 1.
            `- Premature end of input at line 1 char 1.

토론 #1

는 운행하기 전에sass로 전환하지 않은 것처럼 들린다.파일 이름이 무엇입니까?하나?무례하거나 무례하다.scss?

토론 #2

SCSS 파일입니다.
다음은 실행할 수 있는 테스트입니다.
$ echo "$foo:#666;" > test.scss
$ csscss test.scss
이상하게도 이것은 나에게 새로운 잘못을 가져왔다.
네, 이 구멍을 발견했습니다.새 줄이 있는 공백 파일이 있으면 csscss에서 분석을 시작합니다.아이고.

토론 #셋

케이스가 확장을 시도했기 때문에 사실상 효과가 없다echo "$foo:#666;" > test.scss예를 들면 다음과 같습니다.
test.scss:1: Invalid CSS after ":": expected pseudoclass or pseudoelement, was "#666;" (Sass::SyntaxError)
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:1148:in `expected'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:1084:in `expected'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:1066:in `expr!'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:794:in `pseudo'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:672:in `simple_selector_sequence'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:640:in `_selector'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:619:in `selector'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:603:in `selector_sequence'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:528:in `ruleset'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:553:in `block_child'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:543:in `block_contents'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:82:in `stylesheet'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/scss/parser.rb:27:in `parse'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/engine.rb:342:in `_to_tree'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/engine.rb:315:in `_render'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sass-3.2.7/lib/sass/engine.rb:262:in `render'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/csscss-1.0.0/lib/csscss/cli.rb:32:in `block in execute'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/csscss-1.0.0/lib/csscss/cli.rb:20:in `map'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/csscss-1.0.0/lib/csscss/cli.rb:20:in `execute'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/csscss-1.0.0/lib/csscss/cli.rb:15:in `run'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/csscss-1.0.0/lib/csscss/cli.rb:142:in `run'
    from /Users/john/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/csscss-1.0.0/bin/csscss:4:in `<top (required)>'
    from /Users/john/.rbenv/versions/1.9.3-p327/bin/csscss:23:in `load'
    from /Users/john/.rbenv/versions/1.9.3-p327/bin/csscss:23:in `<main>'
네, 이거 끝내겠습니다.다음 버전 (v1.0.0 이후 버전) $foo 에서 발표될 것입니다. 이 문제를 v1에서 보았습니다.3.3:
샘플 SCS:
/* test.scss file */
$foo: #666;

foo {
  color: $foo;
}

bar {
  color: $foo;
}
다음과 같은 오류가 발생했습니다.
∴ csscss -n 1 -v test.scss 
{bar} AND {foo} share 1 rule
  - color: #666666
다른 한편, CSSCS는 sass 문법과 함께 사용합니까?우리sass 파일을 실행하려고 시도했을 때 여러 가지 문제가 발생했습니다.나는 CSSCS를 실행하는 것이 아니라 SCS로 전환하고 있다.
감사합니다

토론 #4

저도 플러그인 스타일의 문제를 보았습니다.
@import "./../variables";

$include-html-global-classes: false;
$include-html-reveal-classes: false;
제공:
Had a problem parsing the css at line: 3, column: 1 Failed to match sequence (SPACE? blocks:((COMMENT / IMPORT / NESTED_RULESET / RULESET){1, }) SPACE?) at line 3 char 1.
``- Don't know what to do with "$include-h" at line 3 char 1.

좋은 웹페이지 즐겨찾기