Skip to content

Commit

Permalink
✨ feat: 为 createStyles 添加 isDarkMode 入参
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 20, 2023
1 parent c412eb7 commit ee1def0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/functions/createStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface CreateStylesTheme extends CommonStyleUtils {
token: FullToken;
stylish: FullStylish;
appearance: ThemeAppearance;
isDarkMode: boolean;
}

/**
Expand Down Expand Up @@ -55,9 +56,12 @@ export const createStyles =
let tempStyles: ReturnStyleToUse<Input>;

if (styleOrGetStyleFn instanceof Function) {
const { stylish, appearance, ...token } = theme;
const { stylish, appearance, isDarkMode, ...token } = theme;

tempStyles = styleOrGetStyleFn({ token, stylish, appearance, cx, css }, props!) as any;
tempStyles = styleOrGetStyleFn(
{ token, stylish, appearance, cx, css, isDarkMode },
props!,
) as any;
} else {
tempStyles = styleOrGetStyleFn as any;
}
Expand Down

0 comments on commit ee1def0

Please sign in to comment.