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

Problems with @page #20

Open
ehhc opened this issue Aug 22, 2016 · 0 comments
Open

Problems with @page #20

ehhc opened this issue Aug 22, 2016 · 0 comments

Comments

@ehhc
Copy link

ehhc commented Aug 22, 2016

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?

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

1 participant