wuxh
2 years ago
No known key found for this signature in database
GPG Key ID: 464F03149513C20C
3 changed files with
3 additions and
2 deletions
-
components/config-provider/index.tsx
-
components/config-provider/style/index.ts
-
components/theme/util/genComponentStyleHook.ts
|
@ -206,7 +206,7 @@ const ProviderChildren: React.FC<ProviderChildrenProps> = (props) => { |
|
|
const shouldWrapSSR = iconPrefixCls !== parentContext.iconPrefixCls; |
|
|
const shouldWrapSSR = iconPrefixCls !== parentContext.iconPrefixCls; |
|
|
const csp = customCsp || parentContext.csp; |
|
|
const csp = customCsp || parentContext.csp; |
|
|
|
|
|
|
|
|
const wrapSSR = useResetIconStyle(iconPrefixCls); |
|
|
const wrapSSR = useResetIconStyle(iconPrefixCls, csp); |
|
|
|
|
|
|
|
|
const mergedTheme = useTheme(theme, parentContext.theme); |
|
|
const mergedTheme = useTheme(theme, parentContext.theme); |
|
|
|
|
|
|
|
|
|
@ -4,7 +4,7 @@ import type { CSPConfig } from '..'; |
|
|
import { resetIcon } from '../../style'; |
|
|
import { resetIcon } from '../../style'; |
|
|
import { useToken } from '../../theme/internal'; |
|
|
import { useToken } from '../../theme/internal'; |
|
|
|
|
|
|
|
|
export const useResetIconStyle = (iconPrefixCls: string) => { |
|
|
export const useResetIconStyle = (iconPrefixCls: string, csp?: CSPConfig) => { |
|
|
const [theme, token] = useToken(); |
|
|
const [theme, token] = useToken(); |
|
|
|
|
|
|
|
|
// Generate style for icons
|
|
|
// Generate style for icons
|
|
|
|
@ -3,6 +3,7 @@ import type { CSSInterpolation } from '@ant-design/cssinjs'; |
|
|
import { useStyleRegister } from '@ant-design/cssinjs'; |
|
|
import { useStyleRegister } from '@ant-design/cssinjs'; |
|
|
import { useContext } from 'react'; |
|
|
import { useContext } from 'react'; |
|
|
import { ConfigContext } from '../../config-provider/context'; |
|
|
import { ConfigContext } from '../../config-provider/context'; |
|
|
|
|
|
import { genCommonStyle, genLinkStyle } from '../../style'; |
|
|
import { useResetIconStyle } from '../../config-provider/style'; |
|
|
import { useResetIconStyle } from '../../config-provider/style'; |
|
|
import type { ComponentTokenMap, GlobalToken } from '../interface'; |
|
|
import type { ComponentTokenMap, GlobalToken } from '../interface'; |
|
|
import type { UseComponentStyleResult } from '../internal'; |
|
|
import type { UseComponentStyleResult } from '../internal'; |
|
|