Skip to content

Commit

Permalink
add flex processing to mergeStyles
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasBoll committed May 8, 2024
1 parent 9ad9f2a commit 63791b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/react/layout/lib/utils/mergeStyles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {CSToPropsInput, handleCsProp} from '@workday/canvas-kit-styling';
import {boxStyleFn} from '../Box';
import {flex} from '../utils/flex';
import {backgroundStyleFnConfigs} from './background';
import {borderStyleFnConfigs} from './border';
import {colorStyleFnConfigs} from './color';
Expand Down Expand Up @@ -77,7 +78,7 @@ export function mergeStyles<T extends {}>(
// We have style props. We need to create style and merge with our `csToProps` to get the correct
// merging order for styles
if (shouldRuntimeMergeStyles) {
styles = boxStyleFn(styleProps);
styles = {...boxStyleFn(styleProps), ...flex(styleProps)};
}

return handleCsProp(elemProps, [localCs, styles]) as Omit<T, 'cs' | keyof CommonStyleProps>;
Expand Down

0 comments on commit 63791b2

Please sign in to comment.