File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import type { Theme } from './theme'
1616import { compareBreakpoints } from './utils/compare-breakpoints'
1717import { DefaultMap } from './utils/default-map'
1818import { isPositiveInteger } from './utils/infer-data-type'
19+ import { isAlpha } from './utils/is-alpha'
1920import { segment } from './utils/segment'
2021
2122type VariantFn < T extends Variant [ 'kind' ] > = (
@@ -714,9 +715,9 @@ export function createVariants(theme: Theme): Variants {
714715 variants . functional ( 'in' , ( ruleNode , variant ) => {
715716 if ( ! variant . value || variant . modifier ) return null
716717
717- // Named values should be alphanumeric . This prevents `in-foo-bar` from
718- // being used as a variant.
719- if ( variant . value . kind === 'named' && ! / ^ [ a - z A - Z ] + $ / i . test ( variant . value . value ) ) {
718+ // Named values should be alpha (tag selector) . This prevents `in-foo-bar`
719+ // from being used as a variant.
720+ if ( variant . value . kind === 'named' && ! isAlpha ( variant . value . value ) ) {
720721 return null
721722 }
722723
You can’t perform that action at this time.
0 commit comments