Skip to content

Commit

Permalink
fix(comp:tag): modify tag normal bg color (#1792)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Jan 8, 2024
1 parent 664c34b commit 5990a28
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
18 changes: 15 additions & 3 deletions packages/components/tag/theme/default.ts
Expand Up @@ -5,22 +5,34 @@
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE
*/

import { type CertainThemeTokens, type GlobalThemeTokens, getAlphaColor } from '@idux/components/theme'
export function getDefaultThemeTokens(tokens: GlobalThemeTokens): CertainThemeTokens<'tag'> {
import {
type CertainThemeTokens,
type GlobalThemeTokens,
type ThemeTokenAlgorithms,
getAlphaColor,
} from '@idux/components/theme'
export function getDefaultThemeTokens(
tokens: GlobalThemeTokens,
algrithms: ThemeTokenAlgorithms,
): CertainThemeTokens<'tag'> {
const {
lineWidth,
borderRadiusSm,
tagCompColorAlpha,
colorTextInfo,
colorSuccessBg,
colorInfoBg,
colorWarningBg,
colorRiskBg,
colorErrorBg,
colorFatalBg,
} = tokens
const { getGreyColors } = algrithms
const greyColors = getGreyColors()

return {
bgColorFilled: '#99acd1',
bgColorNormal: getAlphaColor(colorTextInfo, tagCompColorAlpha),
bgColorFilled: greyColors.base,
borderWidth: lineWidth,
borderRadius: borderRadiusSm,

Expand Down
4 changes: 2 additions & 2 deletions packages/components/tag/theme/index.ts
Expand Up @@ -9,8 +9,8 @@ import type { TokenGetter } from '@idux/components/theme'

import { getDefaultThemeTokens } from './default'

export const getThemeTokens: TokenGetter<'tag'> = (tokens, presetTheme) => {
return presetTheme === 'default' ? getDefaultThemeTokens(tokens) : getDefaultThemeTokens(tokens)
export const getThemeTokens: TokenGetter<'tag'> = (tokens, presetTheme, algrithms) => {
return presetTheme === 'default' ? getDefaultThemeTokens(tokens, algrithms) : getDefaultThemeTokens(tokens, algrithms)
}

export type { TagThemeTokens } from './tokens'
7 changes: 6 additions & 1 deletion packages/components/tag/theme/tokens.ts
Expand Up @@ -7,7 +7,12 @@

export interface TagThemeTokens {
/**
* @desc 标签背景颜色
* @desc 标签普通背景颜色
*/
bgColorNormal: string

/**
* @desc 标签填充背景颜色
*/
bgColorFilled: string

Expand Down

0 comments on commit 5990a28

Please sign in to comment.