stylelint-high-performance-animation
Version:
Stylelint rule for preventing the use of low performance animation and transition properties.
14 lines (12 loc) • 334 B
JavaScript
/**
* Get the index of a declaration's value
*
* @param {Decl} decl
* @return {int} The index
*/
export default function declarationValueIndex(decl) {
const beforeColon = decl.toString().indexOf(":");
const afterColon =
decl.raw("between").length - decl.raw("between").indexOf(":");
return beforeColon + afterColon;
}