Determines if a hex string is in CSS shorthand notation.
isShortHex('#000') // Returns `true`isShortHex('0x000', '0x') // Returns `true`isShortHex('0x000000', '0x') // Returns `false`isShortHex('#000', '0x') // Returns `false` Copy
isShortHex('#000') // Returns `true`isShortHex('0x000', '0x') // Returns `true`isShortHex('0x000000', '0x') // Returns `false`isShortHex('#000', '0x') // Returns `false`
The hex string to test against.
Prefix of hex string.
true if the hex string is in shorthand notation, false otherwise.
true
false
Determines if a hex string is in CSS shorthand notation.
Example