Fix usage of special-character prefixes (#8772)
* Fix import * Support arbitrary prefixes * Add test * Update changelog
This commit is contained in:
parent
c8c4852b87
commit
5191ec1c00
3 changed files with 125 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { flagEnabled } from '../featureFlags.js'
|
||||
import { flagEnabled } from '../featureFlags'
|
||||
import * as regex from './regex'
|
||||
|
||||
export function defaultExtractor(context) {
|
||||
|
|
@ -22,6 +22,10 @@ export function defaultExtractor(context) {
|
|||
function* buildRegExps(context) {
|
||||
let separator = context.tailwindConfig.separator
|
||||
let variantGroupingEnabled = flagEnabled(context.tailwindConfig, 'variantGrouping')
|
||||
let prefix =
|
||||
context.tailwindConfig.prefix !== ''
|
||||
? regex.optional(regex.pattern([/-?/, regex.escape(context.tailwindConfig.prefix)]))
|
||||
: ''
|
||||
|
||||
let utility = regex.any([
|
||||
// Arbitrary properties
|
||||
|
|
@ -88,6 +92,8 @@ function* buildRegExps(context) {
|
|||
// Important (optional)
|
||||
/!?/,
|
||||
|
||||
prefix,
|
||||
|
||||
variantGroupingEnabled
|
||||
? regex.any([
|
||||
// Or any of those things but grouped separated by commas
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue