Skip to content

@supports prefixing not following spec #568

Description

@kmuncie

Reduced test case: http://codepen.io/kmuncie/pen/YybOrV

The example comes from Keith Clark's article on CSS Parallax.

@supports ((perspective: 1px) and (not (-webkit-overflow-scrolling: touch))) {
  /* ... parallax styles ... */
}

The rules within this block should apply on desktop Chrome but not be used on a iOS Safari since it supports -webkit-overflow-scrolling.

Autoprefixer then attempts to prefix the perspective rule and outputs:

@supports ((-webkit-perspective: 1px) and (not (-webkit-overflow-scrolling: touch)) or (perspective: 1px) and (not (-webkit-overflow-scrolling: touch))) {
  /* ... parallax styles ... */
}

This is not valid according to the spec. It is missing some vital parentheses. Please note Example #8 in the W3C Spec. The following is a valid example with the parentheses broken up to better illustrate.

  @supports (
    ( /* parentheses that wrap each statement which are missing */
      (-webkit-perspective: 1px) and (not (-webkit-overflow-scrolling: touch))
    ) 
    or (
      (perspective: 1px) and (not (-webkit-overflow-scrolling: touch))
    )
  ) {

Thank you for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions