Skip to content

grouped code generation in the end of file maybe has a problem #3

Closed
@bravelincy

Description

@bravelincy

I using stylus in my project, so that media-query can be nested, the scenario is:

bg2x(src) {
  @media screen and (min-resolution: 2dppx) {
    background-image: url(src);
  }
}

.foo {
  ...
  bg2x("img/foo@2x.png");
}

@media screen and (max-width: 768px) {
  .foo {
    bg2x("img/foo_small@2x.png");
  }
}

finally compiled:

@media screen and (max-width: 768px) and (min-resolution: 2dppx) {
 foo {
    bg2x("img/foo_small@2x.png");
  }
}

@media screen and (min-resolution: 2dppx) {
  ...

  .foo {
    ...
    bg2x("img/foo@2x.png");
  }
}

the result is .foo doesn't use foo_small@2x.png but img/foo@2x.png

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions