Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Group media queries #73

Open
MichaelL79 opened this issue Feb 27, 2023 · 1 comment
Open

Feature: Group media queries #73

MichaelL79 opened this issue Feb 27, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@MichaelL79
Copy link

Great work! I just started using LESS and your extension makes working with it so much easier.

It would be great to have an option that groups media queries that have the same set of arguments. Currently using nested LESS media queries will result in multiple CSS media queries:

.class1 {
    background-color: black;
    @media (min-width: 768px){
        background-color: white;
    }
}

.class2 {
    border-width: 2px;
    @media (min-width: 768px) {
        border-width: 3px;
    }
}

Will result in:

.class1 {
  background-color: black;
}
@media (min-width: 768px) {
  .class1 {
    background-color: white;
  }
}
.class2 {
  border-width: 2px;
}
@media (min-width: 768px) {
  .class2 {
    border-width: 3px;
  }
}

But would be better:

.class1 {
  background-color: black;
}
.class2 {
  border-width: 2px;
}
@media (min-width: 768px) {
  .class1 {
    background-color: white;
  }
  .class2 {
    border-width: 3px;
  }
}
@failwyn
Copy link
Owner

failwyn commented Mar 3, 2023

adding a link to the less.js issue for review and possible future enhancement.

less/less.js#950

@failwyn failwyn added the enhancement New feature or request label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants