Giter Site home page Giter Site logo

Comments (6)

zmoazeni avatar zmoazeni commented on July 17, 2024

Sounds like it wasn't converted to sass before it ran. What was the filename that this was in? Did it end with a .sass or .scss?

from csscss.

remotezygote avatar remotezygote commented on July 17, 2024

It's an SCSS file.

Here's a test you can run:

$ echo "$foo:#666;" > test.scss
$ csscss test.scss

Oddly, now this gets me a new error:

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>'

from csscss.

zmoazeni avatar zmoazeni commented on July 17, 2024

Ok, I found the bug in this. If you have a blank file with one new line, csscss bombs on parsing. Oops.

echo "$foo:#666;" > test.scss doesn't actually work because the shell tries to expand $foo

As an example:

/* 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

from csscss.

zmoazeni avatar zmoazeni commented on July 17, 2024

Ok, I'm going to close this. This will go out in the next release (the one after v1.0.0)

from csscss.

khelmar avatar khelmar commented on July 17, 2024

I'm seeing this issue in v1.3.3:

Sample scss:

@import "./../variables";

$include-html-global-classes: false;
$include-html-reveal-classes: false;

I get the following error:

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.

On a side note does csscss work with sass syntax? I'm getting all sorts of issues when trying to run against our sass files. I've been converting to scss and than running csscss.

Thanks

from csscss.

khelmar avatar khelmar commented on July 17, 2024

I'm also seeing a problem with nested styles:

.advanced-address-book-recent-ui {
  .queue-template {
    .navigation-arrow-forward {
      display: none;
    }
  }
}

gives:

�[0;31;49mHad a problem parsing the css at line: 1, column: 1�[0m
�[0;31;49mFailed to match sequence (SPACE? blocks:((COMMENT / IMPORT / NESTED_RULESET / RULESET){1, }) SPACE?) at line 1 char 1.
`- Expected at least 1 of COMMENT / IMPORT / NESTED_RULESET / RULESET at line 1 char 1.
   `- Expected one of [COMMENT, IMPORT, NESTED_RULESET, RULESET] at line 1 char 1.
      |- Failed to match sequence (SPACE? '/*' (!'*/' .){0, } '*/' SPACE?) at line 1 char 1.
      |  `- Expected "/*", but got ".a" at line 1 char 1.
      |- Failed to match sequence ('@' [Ii] [Mm] [Pp] [Oo] [Rr] [Tt] [^;]{1, } ';' SPACE?) at line 1 char 1.
      |  `- Expected "@", but got "." at line 1 char 1.
      |- Failed to match sequence ('@' [^{}]{1, } '{' SPACE? (COMMENT / RULESET / NESTED_RULESET){1, } '}' SPACE?) at line 1 char 1.
      |  `- Expected "@", but got "." at line 1 char 1.
      `- Failed to match sequence (selector:([^{}]{1, }) '{' SPACE? properties:((MIXIN_ATTRIBUTES / COMMENT / ATTRIBUTE / BLANK_ATTRIBUTE){0, }) '}' SPACE?) at line 2 char 3.
         `- Expected "}", but got "." at line 2 char 3.
�[0m

from csscss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.