Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Jun 19, 2024
1 parent d87e9b7 commit 61ca07d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/mui-material/src/zero-styled/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import * as React from 'react';
import { Interpolation } from '@mui/system';
import { extendSxProp } from '@mui/system/styleFunctionSx';
import { Theme } from '../styles/createTheme';
import useThemeProps from '../styles/useThemeProps';
import useTheme from '../styles/useTheme';
import GlobalStyles from '../GlobalStyles';
import GlobalStyles, { GlobalStylesProps } from '../GlobalStyles';

export { css, keyframes } from '@mui/system';

export { default as styled } from '../styles/styled';

export function globalCss(styles: any) {
export function globalCss(styles: Interpolation<{ theme: Theme }>) {
return function GlobalStylesWrapper() {
return (
// Pigment CSS `globalCss` support callback with theme inside an object but `GlobalStyles` support theme as a callback value.
<GlobalStyles styles={typeof styles === 'function' ? (theme) => styles({ theme }) : styles} />
<GlobalStyles
styles={
(typeof styles === 'function'
? (theme) => styles({ theme })
: styles) as GlobalStylesProps['styles']
}
/>
);
};
}
Expand Down

0 comments on commit 61ca07d

Please sign in to comment.