Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Incorrectly reporting duplicate declarations when using media queries #45

Open
jjenzz opened this issue Apr 12, 2013 · 4 comments
Open

Comments

@jjenzz
Copy link

jjenzz commented Apr 12, 2013

I have something similar to the following:

@media (min-width: 30em) {
  .m-label {
    display: block;
  }
}

/* because less than IE9 
 * doesn't support media queries */
.lt-ie9 .m-label {
  display: block;
}

Although they are sharing the same declaration, there is no way around that as they are only sharing it if the media query applies.

Would it make more sense for the parser to report duplicated declarations outside media queries separately from those inside media queries?

@zmoazeni
Copy link
Owner

Thank you @jjenzz that's an interesting thought. I need to chew on it a little. I welcome anyone else to add to the discussion too.

@Melindrea
Copy link

I actually just ran into that particular issue. Overall, I extend classes, but that is not possible to do into media queries, so I get an error from the following:

@media (min-width: 24em) {
/* line 81, ../../app/styles/site.scss */
  .contact {
    font-size: 36px;
    font-size: 2rem;
    margin-bottom: 0.825rem;
  }
}

.gamma, h3, .subtitle {
   font-size: 36px;
   font-size: 2rem;
   margin-bottom: 0.825rem;
 }

The particulars being that those three rules are generated as part of a vertical rhythm through typeplate, and once the screen gets wider I want to make the contact icons bigger.

@alexkilgour
Copy link

I definitely think that reporting duplicated declarations outside media queries separately from those inside media queries is a good idea. Could there be some way of displaying the media query definition in the output so you can differentiate where the declarations can be found?

@cibulka
Copy link

cibulka commented Apr 16, 2015

I very much second @HowlingMad on 1) keeping duplicated declarations inside MQs but 2) marking them somehow differently in the ouput. Is there any chance you might consider to incorporate that into the plugin?

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants