stylelint
Version:
A mighty CSS linter that helps you avoid errors and enforce conventions.
21 lines (17 loc) • 400 B
JavaScript
import { keyframeSelectorKeywords } from '../reference/keywords.mjs';
/**
* Check whether a string is a keyframe selector.
*
* @param {string} selector
* @returns {boolean}
*/
export default function isKeyframeSelector(selector) {
if (keyframeSelectorKeywords.has(selector)) {
return true;
}
// Percentages
if (/^(?:\d+|\d*\.\d+)%$/.test(selector)) {
return true;
}
return false;
}