Skip to content

@media (max-width: Npx) queries parsed incorrectly #26

@Daedalon

Description

@Daedalon

Media queries with max-width are parsed incorrectly, leading to errors in page display. May affect more than just those with max-width. For example

.class3 { margin: 0; } @media (max-width: 123px) { .class1, .class2 { width: 100% !important; max-width: 100% !important; } .class3 { font-size: 80%; } }

Becomes wrongly sqwished as:

.class3{font-size:80%;margin:0}@media (max-width:123px){max-width:100%!important;.class1,.class2{width:100%!important}}

Two issues:

  1. The max-width rule for class1&2 is placed before the class selector where it doesn't have any effect.
  2. The rule for class 3 is removed from the @media query and combined with the non-media-queried rule, where it has an effect even when it shouldn't.

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