Skip to content

Commit

Permalink
🏷️ fix: 经过讨论,移除 injectGlobal 在 createStyles 中的入参
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 11, 2023
1 parent 3cc7b6f commit d6d2aaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/functions/createStyles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css, cx, injectGlobal, type CSSObject } from '@emotion/css';
import { css, cx, type CSSObject } from '@emotion/css';
import type { Emotion } from '@emotion/css/create-instance';
import { useMemo } from 'react';

Expand Down Expand Up @@ -55,10 +55,7 @@ export const createStyles =
if (styleOrGetStyleFn instanceof Function) {
const { stylish, appearance, ...token } = theme;

tempStyles = styleOrGetStyleFn(
{ token, stylish, appearance, cx, css, injectGlobal },
props,
) as any;
tempStyles = styleOrGetStyleFn({ token, stylish, appearance, cx, css }, props) as any;
} else {
tempStyles = styleOrGetStyleFn as any;
}
Expand Down
1 change: 0 additions & 1 deletion src/types/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ThemeAppearance, ThemeMode } from './appearance';
export interface CommonStyleUtils {
cx: Emotion['cx'];
css: Emotion['css'];
injectGlobal: Emotion['injectGlobal'];
}

export interface ThemeContextState {
Expand Down

0 comments on commit d6d2aaf

Please sign in to comment.