mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(core): change doc icon layout to avoid incorrect color caused by the transform (#13719)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Updated document title styling for improved readability (larger font, increased line height, heavier weight). * Refined spacing so titles align correctly when a document icon is present (no extra top padding). * Improved emoji rendering by using a consistent font and removing an unnecessary visual artifact. * Simplified title container behavior to ensure stable, predictable alignment without placeholder-based shifts. * **Chores** * Minor UI cleanup and consistency adjustments for the icon/title area. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -11,7 +11,10 @@ export const docIconPickerTrigger = style({
|
||||
lineHeight: 1,
|
||||
},
|
||||
'&[data-icon-type="emoji"]': {
|
||||
fontFamily: 'emoji',
|
||||
fontFamily: 'Inter',
|
||||
},
|
||||
'&::after': {
|
||||
display: 'none',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -6,21 +6,13 @@ import { useLiveData, useService } from '@toeverything/infra';
|
||||
|
||||
import * as styles from './doc-icon-picker.css';
|
||||
|
||||
const TitleContainer = ({
|
||||
children,
|
||||
isPlaceholder,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
isPlaceholder: boolean;
|
||||
}) => {
|
||||
const TitleContainer = ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
<div
|
||||
className="doc-icon-container"
|
||||
style={{
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
// title container has `padding-top`
|
||||
transform: isPlaceholder ? 'translateY(80%)' : 'translateY(50%)',
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
@@ -54,7 +46,7 @@ export const DocIconPicker = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<TitleContainer isPlaceholder={isPlaceholder}>
|
||||
<TitleContainer>
|
||||
<IconEditor
|
||||
icon={icon?.icon}
|
||||
onIconChange={data => {
|
||||
|
||||
Reference in New Issue
Block a user