Skip to content

[Feature Request] Add support for merging @media and @supports queries. #104

@SukkaW

Description

@SukkaW

E.g.:

@media screen and (min-width: 480px) {
  .a { color: red }
}

@media screen and (min-width: 480px) {
  .b { color: blue }
}

@media (min-width: 480px) {
  .c { color: green }
}

@media (max-width: 769px) {
  .d { color: yellow }
}

@media screen and (min-width: 480px) {
  .e { color: orange }
}

Should become:

@media screen and (min-width: 480px) {
  /* This two can be safely merged */
  .a { color: red }
  .b { color: blue }
}

/* Non identical @media query shouldn't be merged */
@media (min-width: 480px) {
  .c { color: green }
}

@media (max-width: 769px) {
  .d { color: yellow }
}

/* Although it is an identical media query as before, but it shouldn't be merged into .a & .b  */
@media screen and (min-width: 480px) {
  .e { color: orange }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions