Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Compile fails when class selector includes what appears to be a calculation #16

Open
ghost opened this issue Apr 4, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 4, 2016

There appears to be a problem when a class selector includes a class name which has a segment which appears to be a unit or calculation. Parsing Sass which includes Font Awesome the following selectors cause Exceptions to be thrown:

  • .#{$fa-css-prefix}-500px (see line 661)

    Apr 04, 2016 3:28:29 PM com.vaadin.sass.internal.handler.SCSSErrorHandler log
    SEVERE: Error when parsing file 
    /PATH/fa/_icons.scss on line 661, column 19
    Apr 04, 2016 3:28:29 PM com.vaadin.sass.internal.handler.SCSSErrorHandler log
    SEVERE: encountered "500px". Was expecting one of: "-" "," "[" "%" "." "and" "or" "not" ":" "#{" "through" "in" "{" <IDENT> <HASH> 
    org.w3c.css.sac.CSSParseException: encountered "500px". Was expecting one of: "-" "," "[" "%" "." "and" "or" "not" ":" "#{" "through" "in" "{" <IDENT> <HASH> 
    at com.vaadin.sass.internal.parser.Parser.reportError(Parser.java:418)
    at com.vaadin.sass.internal.parser.Parser.styleRule(Parser.java:2203)
    at com.vaadin.sass.internal.parser.Parser.topLevelDeclaration(Parser.java:591)
    at com.vaadin.sass.internal.parser.Parser.parserUnit(Parser.java:487)
    at com.vaadin.sass.internal.parser.Parser.parseStyleSheet(Parser.java:122)
    at com.vaadin.sass.internal.ScssStylesheet.get(ScssStylesheet.java:172)
    at com.vaadin.sass.internal.visitor.ImportNodeHandler.traverse(ImportNodeHandler.java:68)
    at com.vaadin.sass.internal.tree.ImportNode.traverse(ImportNode.java:99)
    at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:227)
    at com.vaadin.sass.internal.tree.controldirective.TemporaryNode.traverseChildren(TemporaryNode.java:53)
    at com.vaadin.sass.internal.visitor.ImportNodeHandler.traverse(ImportNodeHandler.java:97)
    at com.vaadin.sass.internal.tree.ImportNode.traverse(ImportNode.java:99)
    at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:227)
    at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:214)
    at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:298)
    at com.vaadin.sass.internal.ScssStylesheet.compile(ScssStylesheet.java:267)
    at com.vaadin.sass.SassCompiler.main(SassCompiler.java:101)
    
  • .#{$fa-css-prefix}-2x (see lines 10-13)

    Apr 04, 2016 3:49:57 PM com.vaadin.sass.internal.handler.SCSSErrorHandler log
    SEVERE: Error when parsing file 
    /PATH/fa/_larger.scss on line 10, column 19
    Apr 04, 2016 3:49:57 PM com.vaadin.sass.internal.handler.SCSSErrorHandler log
    SEVERE: encountered "2x". Was expecting one of: "-" "," "[" "%" "." "and" "or" "not" ":" "#{" "through" "in" "{" <IDENT> <HASH> 
    org.w3c.css.sac.CSSParseException: encountered "2x". Was expecting one of: "-" "," "[" "%" "." "and" "or" "not" ":" "#{" "through" "in" "{" <IDENT> <HASH> 
    at com.vaadin.sass.internal.parser.Parser.reportError(Parser.java:418)
    at com.vaadin.sass.internal.parser.Parser.styleRule(Parser.java:2203)
    at com.vaadin.sass.internal.parser.Parser.topLevelDeclaration(Parser.java:591)
    at com.vaadin.sass.internal.parser.Parser.parserUnit(Parser.java:487)
    at com.vaadin.sass.internal.parser.Parser.parseStyleSheet(Parser.java:122)
    at com.vaadin.sass.internal.ScssStylesheet.get(ScssStylesheet.java:172)
    at com.vaadin.sass.internal.visitor.ImportNodeHandler.traverse(ImportNodeHandler.java:68)
    at com.vaadin.sass.internal.tree.ImportNode.traverse(ImportNode.java:99)
    at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:227)
    at com.vaadin.sass.internal.tree.controldirective.TemporaryNode.traverseChildren(TemporaryNode.java:53)
    at com.vaadin.sass.internal.visitor.ImportNodeHandler.traverse(ImportNodeHandler.java:97)
    at com.vaadin.sass.internal.tree.ImportNode.traverse(ImportNode.java:99)
    at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:227)
    at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:214)
    at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:298)
    at com.vaadin.sass.internal.ScssStylesheet.compile(ScssStylesheet.java:267)
    at com.vaadin.sass.SassCompiler.main(SassCompiler.java:101)
    
  • .#{$fa-css-prefix}-3x (error as per above)

  • .#{$fa-css-prefix}-4x (error as per above)

  • .#{$fa-css-prefix}-5x (error as per above)

It should be noted that these class token values appear to comply with the W3C CSS Class Selector definition and HTML class attribute. This Sass does compile correctly using LibSass.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants