Skip to content

Nested media queries break postCSS source mapping #9

@Jexordexan

Description

@Jexordexan

Consider the following Less:

.nav-placeholder {
  height: 70px;
  @media (min-width: 700px) {
    height: 50px;
  }
}

This is valid Less, but throws an error in the console when map: true option is set in the postCSS config:

Fatal error: Invalid mapping: {"generated":{"line":1,"column":4349},"source":"../partials/nav.less","original":{"line":1,"column":-1},"name":null}

Curiously, the following works fine:

.nav {
  .nav-placeholder {
    height: 70px;
  }
  @media (min-width: 700px) {
    .nav-placeholder
      height: 50px;
    }
  }
}

Notice that the media query is still nested but the rules are contained in a selector block.

Not sure if this is a bug for the normal postcss repo but I'll see where this goes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions