UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

15 lines (14 loc) 744 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isColorCssPropertyName = void 0; var validColorPropertyNames = new Set(['color', 'background', 'background-color', 'border', 'border-left', 'border-right', 'border-top', 'border-bottom', 'border-color', 'border-left-color', 'border-right-color', 'border-top-color', 'border-bottom-color', 'outline', 'outline-color', 'box-shadow']); var kebabize = function kebabize(str) { return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, function ($, ofs) { return (ofs ? '-' : '') + $.toLowerCase(); }); }; var isColorCssPropertyName = exports.isColorCssPropertyName = function isColorCssPropertyName(value) { return validColorPropertyNames.has(kebabize(value)); };