Skip to content

Commit b089f25

Browse files
committed
FIx the button
1 parent 633d509 commit b089f25

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/OnboardingSPA/utils/global-styles/use-global-styles-output.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ export const toStyles = (
901901
marginReset: true,
902902
presets: true,
903903
rootPadding: true,
904-
variationStyles: false,
904+
variationStyles: true,
905905
...styleOptions,
906906
};
907907

@@ -1411,6 +1411,7 @@ export function generateStyles(
14111411
updatedConfig,
14121412
blockSelectors
14131413
);
1414+
14141415
const globalStyles = toStyles(
14151416
updatedConfig,
14161417
blockSelectors,
@@ -1429,6 +1430,31 @@ export function generateStyles(
14291430
);
14301431
} );
14311432

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+
14321458
// Construct the styles array
14331459
const styles = [
14341460
...result,

0 commit comments

Comments
 (0)