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

Wrong detection of Squiz.CSS.DuplicateStyleDefinition with media queries #622

Closed
adriankirchner opened this issue Jun 12, 2015 · 1 comment

Comments

@adriankirchner
Copy link

Here are some more details:

$ php phpcs-2.3.2.phar --version
PHP_CodeSniffer version 2.3.2 (stable) by Squiz (http://www.squiz.net)

content of test.css

@media only screen and (max-width: 480px) {
    header nav.meta a { display: none; }
    header nav.meta a.search { display: block; }
}

content of test-ruleset.xml

<?xml version="1.0"?>
<ruleset name="test">
 <description>Test ruleset</description>
 <rule ref="Squiz.CSS.DuplicateStyleDefinition"/>
</ruleset>

executing this setup results in the following errors:

$ php phpcs-2.3.2.phar --standard=test-ruleset.xml test.css

FILE: ...test.css
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 3 | ERROR | Duplicate style definition found; first defined on line
   |       | 2
----------------------------------------------------------------------

Time: 8ms; Memory: 2.25Mb

When I remove the media query the error vanishes.
Please ping me if you need more information.

@gsherwood
Copy link
Member

Finally committed a fix. Sorry that took so long.

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

No branches or pull requests

2 participants