File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
src/OnboardingSPA/utils/global-styles Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -901,7 +901,7 @@ export const toStyles = (
901
901
marginReset : true ,
902
902
presets : true ,
903
903
rootPadding : true ,
904
- variationStyles : false ,
904
+ variationStyles : true ,
905
905
...styleOptions ,
906
906
} ;
907
907
@@ -1411,6 +1411,7 @@ export function generateStyles(
1411
1411
updatedConfig ,
1412
1412
blockSelectors
1413
1413
) ;
1414
+
1414
1415
const globalStyles = toStyles (
1415
1416
updatedConfig ,
1416
1417
blockSelectors ,
@@ -1429,6 +1430,31 @@ export function generateStyles(
1429
1430
) ;
1430
1431
} ) ;
1431
1432
1433
+ //Add SpecialStyling for variations
1434
+ const nodesWithStyles = getNodesWithStyles ( updatedConfig , blockSelectors ) ;
1435
+ if ( nodesWithStyles ) {
1436
+ nodesWithStyles . forEach ( ( { selector, styleVariationSelectors } ) => {
1437
+ // Include the button varirations manually
1438
+ if (
1439
+ selector . toLowerCase ( ) . includes ( 'button' ) &&
1440
+ styleVariationSelectors
1441
+ ) {
1442
+ const firstEntry = Object . entries (
1443
+ styleVariationSelectors
1444
+ ) [ 0 ] ;
1445
+ const firstKey = firstEntry [ 0 ] ;
1446
+ let firstValue = firstEntry [ 1 ] ;
1447
+
1448
+ // Remove the value of firstKey from firstValue (specifically after the -- part)
1449
+ firstValue = firstValue . replace (
1450
+ firstKey ,
1451
+ firstKey . replace ( / - - \d + / , '' )
1452
+ ) ;
1453
+ updatedConfig . styles . css = `:root :where(${ firstValue } ){ background: transparent none; }` ;
1454
+ }
1455
+ } ) ;
1456
+ }
1457
+
1432
1458
// Construct the styles array
1433
1459
const styles = [
1434
1460
...result ,
You can’t perform that action at this time.
0 commit comments