Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore(component): add a danger hover style for buttons (#7600)

fundon2a2a19fec7d7
diff --git a/packages/frontend/component/src/ui/button/button.css.ts b/packages/frontend/component/src/ui/button/button.css.ts
index b914ee4803..72c0a0859a 100644
--- a/packages/frontend/component/src/ui/button/button.css.ts
+++ b/packages/frontend/component/src/ui/button/button.css.ts
@@ -164,6 +164,10 @@ export const button = style({
'&.processing.disabled:not(.without-hover):hover': {
background: cssVar('processingColor'),
},
+ '&.danger:hover': {
+ color: cssVar('errorColor'),
+ background: cssVar('backgroundErrorColor'),
+ },
},
});
globalStyle(`${button} > span`, {
@@ -359,5 +363,9 @@ export const iconButton = style({
'&.processing.disabled:not(.without-hover):hover': {
background: cssVar('processingColor'),
},
+ '&.danger:hover': {
+ color: cssVar('errorColor'),
+ background: cssVar('backgroundErrorColor'),
+ },
},
});
diff --git a/packages/frontend/core/src/modules/peek-view/view/image-preview/index.tsx b/packages/frontend/core/src/modules/peek-view/view/image-preview/index.tsx
index 8a7c6959e8..5b87cea48b 100644
--- a/packages/frontend/core/src/modules/peek-view/view/image-preview/index.tsx
+++ b/packages/frontend/core/src/modules/peek-view/view/image-preview/index.tsx
@@ -423,6 +423,7 @@ const ImagePreviewModalImpl = ({
<>
<div className={styles.dividerStyle}></div>
<ButtonWithTooltip
+ className="danger"
data-testid="delete-button"
tooltip="Delete"
icon={<DeleteIcon />}