@@ -9,9 +9,11 @@ const computed = {
99 // bulletColor: (color) => ({ 'ul > li::before': { backgroundColor: color } }),
1010}
1111
12- function inWhere ( selector , { className, prefix } ) {
12+ function inWhere ( selector , { className, modifier , prefix } ) {
1313 let prefixedNot = prefix ( `.not-${ className } ` ) . slice ( 1 )
14- let selectorPrefix = selector . startsWith ( '>' ) ? `.${ className } ` : ''
14+ let selectorPrefix = selector . startsWith ( '>' )
15+ ? `${ modifier === 'DEFAULT' ? `.${ className } ` : `.${ className } -${ modifier } ` } `
16+ : ''
1517
1618 // Parse the selector, if every component ends in the same pseudo element(s) then move it to the end
1719 let [ trailingPseudo , rebuiltSelector ] = commonTrailingPseudos ( selector )
@@ -27,7 +29,7 @@ function isObject(value) {
2729 return typeof value === 'object' && value !== null
2830}
2931
30- function configToCss ( config = { } , { target, className, prefix } ) {
32+ function configToCss ( config = { } , { target, className, modifier , prefix } ) {
3133 function updateSelector ( k , v ) {
3234 if ( target === 'legacy' ) {
3335 return [ k , v ]
@@ -41,13 +43,13 @@ function configToCss(config = {}, { target, className, prefix }) {
4143 let nested = Object . values ( v ) . some ( isObject )
4244 if ( nested ) {
4345 return [
44- inWhere ( k , { className, prefix } ) ,
46+ inWhere ( k , { className, modifier , prefix } ) ,
4547 v ,
4648 Object . fromEntries ( Object . entries ( v ) . map ( ( [ k , v ] ) => updateSelector ( k , v ) ) ) ,
4749 ]
4850 }
4951
50- return [ inWhere ( k , { className, prefix } ) , v ]
52+ return [ inWhere ( k , { className, modifier , prefix } ) , v ]
5153 }
5254
5355 return [ k , v ]
@@ -121,6 +123,7 @@ module.exports = plugin.withOptions(
121123 {
122124 target,
123125 className,
126+ modifier,
124127 prefix,
125128 }
126129 ) ,
0 commit comments