vaadin / sass-compiler

A Java Sass compiler implementation
53 stars 25 forks source link

Problems with @page #20

Open ehhc opened 8 years ago

ehhc commented 8 years ago

Hi, i'm trying to use the css "@page" selector in my sass file but i get a lot of errors. Here is my .scss file:

@page { margin-top: 1cm; margin-left: 0; size: auto; @top-left { content: element(print-header); } @bottom-right { content: element(print-footer); } } @page print-landscape { size: landscape; }

if i try to compile it like this i get the following error:

SCHWERWIEGEND: encountered "@top-left". Was expecting one of: "}" "-" ";" "and" "or" "not" "#{" "through" "in" org.w3c.css.sac.CSSParseException: encountered "@top-left". Was expecting one of: "}" "-" ";" "and" "or" "not" "#{" "through" "in" at com.vaadin.sass.internal.parser.Parser.reportError(Parser.java:418) at com.vaadin.sass.internal.parser.Parser.page(Parser.java:1425) at com.vaadin.sass.internal.parser.Parser.topLevelDeclaration(Parser.java:597) 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.ScssStylesheet$get.call(Unknown Source)

i tryed to modify my scss to make it work, so i altered it to the following:

@page { margin-top: 1cm; margin-left: 0; size: auto; }

if i do so, it compiles without errors, but the "@page" selector is missing in the resulting css file. instead of that i get the following css:

@charset "UTF-8"; margin-top: 1cm; margin-left: 0; size: auto; size: landscape;

the compiler simply drops the "@page" selector, which is definitivly wrong.

Do you have any suggestions how to fix this? I think it's a behavior that's not intendet, isn't it?