Skip to content

a11y/media-prefers-reduced-motion: media-feature-name-no-unknown error #50

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

Open
strarsis opened this issue Jan 8, 2020 · 0 comments
Open

Comments

@strarsis
Copy link

strarsis commented Jan 8, 2020

CSS that uses prefers-reduced-motion media query:

html {
  scroll-behavior: smooth;
}

@media screen and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.stylelintrc.js uses stylelint-a11y and its rules (including a11y/media-prefers-reduced-motion):

module.exports = {
  'extends': 'stylelint-config-standard',
  'plugins': [
    'stylelint-a11y',
  ],
  'rules': {
    'a11y/media-prefers-reduced-motion': true,
    'a11y/no-outline-none': true,
    'a11y/selector-pseudo-class-focus': true,
    'no-empty-source': null,
    'string-quotes': 'double',
    'at-rule-no-unknown': [
      true,
      {
        'ignoreAtRules': [
          'extend',
          'at-root',
          'debug',
          'warn',
          'error',
          'if',
          'else',
          'for',
          'each',
          'while',
          'mixin',
          'include',
          'content',
          'return',
          'function',
          'tailwind',
          'apply',
          'responsive',
          'variants',
          'screen',
        ],
      },
    ],
  },
};

The prefers-reduced-motion media query still results in lint error:

Unexpected unknown media feature name "prefers-reduced-motion"   media-feature-name-no-unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant