peterbe / mincss

Tool for finding out which CSS selectors you're NOT using.
https://peterbe.github.io/mincss/
BSD 3-Clause "New" or "Revised" License
854 stars 92 forks source link

AssertionError with @-ms-viewport inside @media #17

Open hemebond opened 11 years ago

hemebond commented 11 years ago

If you append the following code to tests/four.css

@media (max-width: 900px) {
  @-ms-viewport {
    width: 320px;
  }
}

it will cause an AssertionError exception to be raised. Seems the viewport selector gets replaced with a temp_key but the assertion for the @media selector doesn't know that.

peterbe commented 11 years ago

Sorry for late reply. Been busy.

If you really need this you can attempt to write a unit test that demonstrates the bug.

jithurjacob commented 8 years ago

TROUBLEMAKER u'a[href^="javascript' TROUBLEMAKER u'a[href^="javascript' Traceback (most recent call last): File "test.py", line 38, in run() File "test.py", line 12, in run p.process(URL) File "C:\Python\lib\site-packages\mincss\processor.py", line 144, in process processed = self._process_content(content, self._bodies) File "C:\Python\lib\site-packages\mincss\processor.py", line 372, in _process_content assert old in content, old AssertionError: @media (min-width: 768px) { .cx { font-size: 21px; } }

peterbe commented 8 years ago

I have to be honest. I'm struggling to find time to work on this. Would you like to attempt it yourself?