When aggregating a file with both @import and @media elements, the @import gets appended with the media query of the last seen @media.

As @import is required to be at the top of the file, they can't be inside a @media, and must then implicitly inherit the media query of the file they're in.

Patch follows.

Comments

xen’s picture

Status: Active » Needs review
StatusFileSize
new763 bytes

Simply copy the media query from the file, truncating "all" to nothing.

xen’s picture

StatusFileSize
new834 bytes

Forgot to check if 'media' was set.

  • mikeytown2 committed 241a1f1 on 7.x-2.x authored by Xen
    Issue #2412213 by Xen: Wrong media queries on @imports
    
mikeytown2’s picture

Status: Needs review » Fixed

Thanks for the fix! In the commit I moved the trim line so it's on the str_replace line.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.