Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@page directive compiling incorrectly? #1714

Closed
slwfleming opened this issue Apr 30, 2015 · 1 comment
Closed

@page directive compiling incorrectly? #1714

slwfleming opened this issue Apr 30, 2015 · 1 comment

Comments

@slwfleming
Copy link

Current compass output with selector inside the parenthesis:

@page{.myclassname{margin:0cm}}

Uncompiled scss:

.myclassname {
  @media print {
    @page {
      margin: 0cm;
    }
  }
}

w3 documents the @page directive should be written like this with the selector outside of the parenthesis:

@page .myclassname {
  margin:0cm;
}

This is an unfortunate inconsistency in formatting from w3. Other directives are written with selectors inside the parenthesis. Confusing:

@media print {
    .myclassname {
        margin:0cm;
    }
}
@nex3
Copy link
Contributor

nex3 commented May 9, 2015

Nesting only works with selectors and other selectors. @page is a directive, so Sass treats it like any other directive and moves it out to the root of the document. If you want to use a selector in @page, you'll need to do so manually.

@nex3 nex3 closed this as completed May 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants