fix: image preview operations color (#44141)

This commit is contained in:
MadCcc 2023-08-10 13:40:34 +08:00 committed by GitHub
parent e283ebf2e3
commit 8d1a41709f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,11 @@ export interface ComponentToken {
* @descEN Color of preview operation icon
*/
previewOperationColor: string;
/**
* @desc
* @descEN Color of hovered preview operation icon
*/
previewOperationHoverColor: string;
/**
* @desc
* @descEN Disabled color of preview operation icon
@ -79,6 +84,7 @@ export const genPreviewOperationsStyle = (token: ImageToken): CSSObject => {
margin,
paddingLG,
previewOperationColorDisabled,
previewOperationHoverColor,
motionDurationSlow,
iconCls,
colorTextLightSolid,
@ -144,7 +150,7 @@ export const genPreviewOperationsStyle = (token: ImageToken): CSSObject => {
userSelect: 'none',
[`&:not(${previewCls}-operations-operation-disabled):hover > ${iconCls}`]: {
opacity: 0.3,
color: previewOperationHoverColor,
},
'&-disabled': {
@ -370,7 +376,10 @@ export default genComponentStyleHook(
},
(token) => ({
zIndexPopup: token.zIndexPopupBase + 80,
previewOperationColor: new TinyColor(token.colorTextLightSolid).toRgbString(),
previewOperationColor: new TinyColor(token.colorTextLightSolid).setAlpha(0.65).toRgbString(),
previewOperationHoverColor: new TinyColor(token.colorTextLightSolid)
.setAlpha(0.85)
.toRgbString(),
previewOperationColorDisabled: new TinyColor(token.colorTextLightSolid)
.setAlpha(0.25)
.toRgbString(),