Skip to content

Sourcemap will not link to correct line if media query is nested inside selector #2974

Open
@morganfeeney

Description

@morganfeeney

When I compile Less with a sourcemap, and in the less file nest a media query inside a selector like so:

.post .title {
  @media(min-width: 700px) {
    display: flex;
  }
}

...and then use Chrome inspector to find the ruleset, I find it is always at the end of the file. However when I nest the entire ruleset in a media query like so:

@media(min-width: 700px) {
  .post .title {
    display: flex;
  }
}

...there is no problem and can find the ruleset on the correct line in the sourcemap, as opposed to at the end of the file.

If it helps I am using Node and compile Less v2.5.3 using grunt and the plugin grunt-contrib-less, I'm not sure if it is a Less issue and was wondering if this is something to be expected with Less sourcemaps.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions