Skip to content

Commit fc1f0ea

Browse files
committed
adjust variant name validation regex
This will disallow variants starting with `-` (or existing on its own)
1 parent 703bed9 commit fc1f0ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/tailwindcss/src/variants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { DefaultMap } from './utils/default-map'
1818
import { isPositiveInteger } from './utils/infer-data-type'
1919
import { segment } from './utils/segment'
2020

21-
export const IS_VALID_VARIANT_NAME = /^@?[a-zA-Z0-9_-]*$/
21+
export const IS_VALID_VARIANT_NAME = /^@?[a-zA-Z0-9][a-zA-Z0-9_-]*$/
2222

2323
type VariantFn<T extends Variant['kind']> = (
2424
rule: Rule,

0 commit comments

Comments
 (0)