scss-lint icon indicating copy to clipboard operation
scss-lint copied to clipboard

PseudoElement should support both single and double colon syntaxes

Open ntwb opened this issue 9 years ago • 4 comments

Previously #639, specifically https://github.com/brigade/scss-lint/issues/639#issuecomment-160044042 quoting @JohnAlbin there:

For pseudo-elements and pseudo-classes defined in CSS2.1, all current browsers must support both single colon (:) and double colon(::) syntaxes. For pseudo-elements defined in later CSS specs, the single colon (:) version is invalid.

Also, note that IE8 (and other old browsers that don't understand the newer :: syntax) will see the double colon pseudo-elements and ignore the entire ruleset as per the requirements in the CSS 2.1 spec says to do.

Here's a list of -moz prefixes: https://developer.mozilla.org/en-US/docs/Web/CSS/Mozilla_Extensions

My use case is using SCSS-Lint with WordPress and as IE8 is still a supported browser by WordPress, WordPress uses single colon : syntaxes for pseudo-elements.

ntwb avatar Jan 16 '16 03:01 ntwb

Hi @ntwb, thanks for opening the discussion. Can you be a little more specific about what you are proposing? For instance, which of these things (or is there something els) are you proposing?

  1. Make the rule allow either single colon or double colon syntax
  2. Make the rule require both single colon or double colon syntax
  3. Make the rule require only single colon syntax
  4. Make the rule configurable to support any of the above cases in addition to its current behavior

lencioni avatar Jan 16 '16 19:01 lencioni

  1. would work for me, 4. would be the most flexible in general though.

I'd like to be able to define the rule so that when linting if ::before is detected I'd like that flagged as WordPress requires the single colon :before syntax for IE8 backward compatibility.

At the moment the only way around this is to explicitly define the PseudoElement rule as false which results in both single :before and double ::before pseudo syntaxes to be ignored completely.

ntwb avatar Jan 17 '16 00:01 ntwb

I just updated to 0.48.0 and added PseudoElement: enable: false to my .scss-lint.yml config file but it's still throwing warnings PseudoElement: Begin pseudo elements with double colons:::``

lstanard avatar Jun 02 '16 17:06 lstanard

@lstanard, you should open a separate bug.

srawlins avatar Jun 02 '16 17:06 srawlins