CodeKit2 icon indicating copy to clipboard operation
CodeKit2 copied to clipboard

Add media query combiner

Open mikaspell opened this issue 12 years ago • 4 comments

Hi

It would be desirable to see in the closest releases media query combain to make the received css more readable Example

BEFORE combine

@media (max-width: 480px) {
  h1 {
    color: red
  }
}
@media (max-width: 980px) {
  h4 {
    color: black
  }
}
@media (max-width: 480px) {
  h2 {
    color: blue
  }
}

AFTER combine

@media (max-width: 480px) {
  h1 {
    color: red
  }
  h2 {
    color: blue
  }
}
@media (max-width: 980px) {
  h4 {
    color: black
  }
}

Like this - Example of combiner

mikaspell avatar Oct 27 '14 20:10 mikaspell

Yea. The issue with these sorts of things is that they have edge cases where they break the CSS cascade. If you're working with Less, Sass or Stylus, the CSS isn't really important; it's just code for the browser to read. The HUMANS involved in building the website will read the original Sass, Less or Stylus files.

bdkjones avatar Oct 28 '14 00:10 bdkjones

Of course I agree with you but I for that if someone needs css that it was convenient

mikaspell avatar Oct 28 '14 08:10 mikaspell

According to my research, combining media queries makes no difference for page speed: http://sasscast.tumblr.com/post/38673939456/sass-and-media-queries

Does anyone have any data that suggests otherwise?

bdkjones avatar Apr 29 '15 02:04 bdkjones

@bdkjones The reason why I'm searching/should like this feature, is that in large-scale projects, it helps that bit extra to keep the output file-size small.

IbeVanmeenen avatar Jul 14 '15 15:07 IbeVanmeenen