@@ -10,19 +10,21 @@ const computed = {
10
10
// bulletColor: (color) => ({ 'ul > li::before': { backgroundColor: color } }),
11
11
}
12
12
13
- function inWhere ( selector , className ) {
13
+ function inWhere ( selector , { className, prefix } ) {
14
+ let prefixedNot = prefix ( `.not-${ className } ` ) . slice ( 1 )
15
+
14
16
if ( selector . endsWith ( '::before' ) ) {
15
- return `:where(${ selector . slice ( 0 , - 8 ) } ):not(:where(.not- ${ className } *))::before`
17
+ return `:where(${ selector . slice ( 0 , - 8 ) } ):not(:where([class~=" ${ prefixedNot } "] *))::before`
16
18
}
17
19
18
20
if ( selector . endsWith ( '::after' ) ) {
19
- return `:where(${ selector . slice ( 0 , - 7 ) } ):not(:where(.not- ${ className } *))::after`
21
+ return `:where(${ selector . slice ( 0 , - 7 ) } ):not(:where([class~=" ${ prefixedNot } "] *))::after`
20
22
}
21
23
22
- return `:where(${ selector } ):not(:where(.not- ${ className } *))`
24
+ return `:where(${ selector } ):not(:where([class~=" ${ prefixedNot } "] *))`
23
25
}
24
26
25
- function configToCss ( config = { } , { target, className } ) {
27
+ function configToCss ( config = { } , { target, className, prefix } ) {
26
28
return Object . fromEntries (
27
29
Object . entries (
28
30
merge (
@@ -38,7 +40,7 @@ function configToCss(config = {}, { target, className }) {
38
40
}
39
41
40
42
if ( typeof v == 'object' && v . constructor == Object ) {
41
- return [ inWhere ( k , className ) , v ]
43
+ return [ inWhere ( k , { className, prefix } ) , v ]
42
44
}
43
45
44
46
return [ k , v ]
@@ -48,7 +50,7 @@ function configToCss(config = {}, { target, className }) {
48
50
49
51
module . exports = plugin . withOptions (
50
52
( { modifiers, className = 'prose' , target = 'modern' } = { } ) => {
51
- return function ( { addComponents, theme, variants } ) {
53
+ return function ( { addComponents, theme, variants, prefix } ) {
52
54
const DEFAULT_MODIFIERS = [
53
55
'DEFAULT' ,
54
56
'sm' ,
@@ -74,7 +76,7 @@ module.exports = plugin.withOptions(
74
76
all . map ( ( modifier ) => ( {
75
77
[ modifier === 'DEFAULT' ? `.${ className } ` : `.${ className } -${ modifier } ` ] : configToCss (
76
78
config [ modifier ] ,
77
- { target, className } ,
79
+ { target, className, prefix }
78
80
) ,
79
81
} ) ) ,
80
82
variants ( 'typography' )
0 commit comments