diff --git a/components/button/style/index.tsx b/components/button/style/index.tsx index a41011c25b..456c626f46 100644 --- a/components/button/style/index.tsx +++ b/components/button/style/index.tsx @@ -181,7 +181,7 @@ const genDefaultButtonStyle: GenerateStyle = token => ({ const genPrimaryButtonStyle: GenerateStyle = token => ({ ...genSolidButtonStyle(token), - color: '#FFF', + color: token.colorTextLightSolid, backgroundColor: token.colorPrimary, boxShadow: `0 ${token.controlOutlineWidth}px 0 ${token.colorPrimaryOutline}`, diff --git a/components/theme/themes/dark/index.ts b/components/theme/themes/dark/index.ts index 7e0e41c595..994b8f3b68 100644 --- a/components/theme/themes/dark/index.ts +++ b/components/theme/themes/dark/index.ts @@ -15,7 +15,7 @@ import { } from './palettes'; export default function derivative(token: SeedToken): MapToken { - const { colorPrimary, colorSuccess, colorWarning, colorError, colorInfo } = token; + const { colorSuccess, colorWarning, colorError, colorInfo } = token; const colorPalettes = Object.keys(defaultPresetColors) .map((colorKey: keyof PresetColorType) => { @@ -34,18 +34,22 @@ export default function derivative(token: SeedToken): MapToken { return prev; }, {} as ColorPalettes); + const colorPrimary = token.colorPrimary || '#177ddc'; + const colorBgBase = token.colorBgBase || '#000'; + const colorTextBase = token.colorTextBase || '#fff'; + const primaryColors = generatePrimaryPalettes(colorPrimary); const successColors = generateSuccessPalettes(colorSuccess); const warningColors = generateWarningPalettes(colorWarning); const errorColors = generateErrorPalettes(colorError); const infoColors = generateInfoPalettes(colorInfo); - const bgColors = generateBgPalettes('#000'); - const textColors = generateTextAlphaPalettes('#fff'); + const bgColors = generateBgPalettes(colorBgBase); + const textColors = generateTextAlphaPalettes(colorTextBase); return { ...token, ...colorPalettes, - + colorPrimary, // Colors ...genColorMapToken({ primaryPalettes: primaryColors, diff --git a/components/theme/themes/dark/palettes.ts b/components/theme/themes/dark/palettes.ts index 80d1d5d38f..6dc7895fac 100644 --- a/components/theme/themes/dark/palettes.ts +++ b/components/theme/themes/dark/palettes.ts @@ -13,7 +13,7 @@ import { getAlphaColor, getSolidColor } from './colorAlgorithm'; export function generatePrimaryPalettes(primaryBaseColor: string): PrimaryPalettes { const primaryColors = generate(primaryBaseColor, { theme: 'dark' }); return { - 0: primaryBaseColor, + 0: '#0e161f', 1: primaryColors[0], 2: primaryColors[1], 3: primaryColors[2], diff --git a/components/theme/themes/default/index.ts b/components/theme/themes/default/index.ts index a1c37e00b9..94ffb499b8 100644 --- a/components/theme/themes/default/index.ts +++ b/components/theme/themes/default/index.ts @@ -15,7 +15,7 @@ import { } from './palettes'; export default function derivative(token: SeedToken): MapToken { - const { colorPrimary, colorSuccess, colorWarning, colorError, colorInfo, colorBgBase } = token; + const { colorSuccess, colorWarning, colorError, colorInfo } = token; const colorPalettes = Object.keys(defaultPresetColors) .map((colorKey: keyof PresetColorType) => { @@ -34,18 +34,22 @@ export default function derivative(token: SeedToken): MapToken { return prev; }, {} as ColorPalettes); + const colorPrimary = token.colorPrimary || '#1890ff'; + const colorBgBase = token.colorBgBase || '#fff'; + const colorTextBase = token.colorTextBase || '#000'; + const primaryColors = generatePrimaryPalettes(colorPrimary); const successColors = generateSuccessPalettes(colorSuccess); const warningColors = generateWarningPalettes(colorWarning); const errorColors = generateErrorPalettes(colorError); const infoColors = generateInfoPalettes(colorInfo); const bgColors = generateBgPalettes(colorBgBase); - const textColors = generateTextAlphaPalettes('#000'); + const textColors = generateTextAlphaPalettes(colorTextBase); return { ...token, ...colorPalettes, - + colorPrimary, // Colors ...genColorMapToken({ primaryPalettes: primaryColors, diff --git a/components/theme/themes/default/palettes.ts b/components/theme/themes/default/palettes.ts index d5c7c3ee62..54c9e10449 100644 --- a/components/theme/themes/default/palettes.ts +++ b/components/theme/themes/default/palettes.ts @@ -13,7 +13,7 @@ import { getAlphaColor, getSolidColor } from './colorAlgorithm'; export function generatePrimaryPalettes(primaryBaseColor: string): PrimaryPalettes { const primaryColors = generate(primaryBaseColor); return { - 0: '#0e161f', + 0: primaryBaseColor, 1: primaryColors[0], 2: primaryColors[1], 3: primaryColors[2], diff --git a/components/theme/themes/seed.ts b/components/theme/themes/seed.ts index 5e13b62975..408650d987 100644 --- a/components/theme/themes/seed.ts +++ b/components/theme/themes/seed.ts @@ -21,15 +21,15 @@ const seedToken: SeedToken = { ...defaultPresetColors, // Color - colorPrimary: '#1890ff', + colorPrimary: '', colorSuccess: '#52c41a', colorWarning: '#faad14', colorError: '#ff4d4f', colorInfo: '#1890ff', - colorTextBase: '#000', + colorTextBase: '', colorTextLightSolid: '#fff', - colorBgBase: '#fff', + colorBgBase: '', // Font fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,