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