Php_codesniffer: Squiz.CSS.SemicolonSpacingSniff false positive when style name proceeded by an asterisk

Created on 21 Mar 2019  路  11Comments  路  Source: squizlabs/PHP_CodeSniffer

The latest update of PHPCS fails on this code:

.some_class {
    cursor: pointer;
    *cursor: hand;
}

With this message: Style definitions must end with a semicolon

Bug

Most helpful comment

PR #2454 should fix this now anyhow.

Thanks a lot. Will get time to merge later today.

All 11 comments

Looks to have been caused by #2248

cc @jrfnl

@josephzidell I'd seen it. Pinging me is counter-productive.

@josephzidell Ok, looked into this. Fixing it is easy, that's not the problem, but I figured I should check what other prefixes the T_STYLE element could have to prevent similar issues cropping up later.

Well, I've searched through the CSS specs and while I can find plenty references to * as the universal selector and it's use in selectors in general, I can not for the life of me find any reference to the use of it at the start of, or within, a _style name_ / property name.

Got any links to specifications for me ?

It's used in datatables. It's a backwards browser compatibility thing.

Here's a stackoverflow

It seems the asterisk would be the only character

On a related note, tailwind uses a : separator for special class names (it's actually configurable)

@jrfnl Sorry, didn't mean for you to get called into this. I had a late meeting and ran out of time while looking into a fix.

My bad for pulling him into this.

My bad for pulling him into this.

@josephzidell _her_ thank you very much.

@jrfnl Sorry, didn't mean for you to get called into this. I had a late meeting and ran out of time while looking into a fix.

@gsherwood :+1: I saw your response yesterday and wanted to avoid us both working on the same fix, which is why I left it at the time.

PR #2454 should fix this now anyhow.

PR #2454 should fix this now anyhow.

Thanks a lot. Will get time to merge later today.

Thanks @jrfnl for the quick attention and fix!

Was this page helpful?
0 / 5 - 0 ratings