JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 23055
  • Score
    100M100P100Q152881F
  • License MIT

Stylelint rule for preventing the use of low performance animation and transition properties.

Package Exports

  • stylelint-high-performance-animation

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stylelint-high-performance-animation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

stylelint-high-performance-animation

NPM version Build Status Build status

Stylelint rule for preventing the use of low performance animation and transition properties.

This is a fork of stylelint-performance-animation stylelint plugin. It uses a blacklist for harmful properties instead of a whitelist, which makes it easy to avoid false positives and allows you to specify which type of properties to warn for (layout/paint).

Install

npm install stylelint-high-performance-animation --save-dev

or

yarn add stylelint-high-performance-animation --save-dev

Usage

Add this config to your .stylelintrc or stylelint config inside package.json:

{
  "plugins": ["stylelint-high-performance-animation"],
  "rules": {
    "plugin/no-low-performance-animation-properties": true
  }
}

Details

div {
  transition: margin 350ms easy;
}
/**           ^^^^^^
 * You should not use low performance animation properties */
@keyframes {
  50% {
    top: 5px;
  }
}
/** ^^^^^^
 * You should not use low performance animation properties */

For more information read article By Paul Lewis and Paul Irish

Options

true

The following pattern is considered warning:

div {
  transition: margin-left 350ms easy;
}

The following pattern is not considered warning:

div {
  transition: transform 350ms easy;
}

Optional secondary options

ignore: "paint-properties"

Makes the rule not warn for properties that cause paint and only warn for properties that cause layout.

ignoreProperties: [string]

Given:

{ ignoreProperties: ['color', 'background-color'] }

The following pattern is considered warning:

div {
  transition: color, margin;
}

The following pattern is not considered warning:

div {
  transition: color, opacity, background-color;
}

License

MIT