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:
Cats Juice
2025-10-10 10:08:05 +08:00
committed by GitHub
parent c63e3e7fe6
commit d80ca57e94
3 changed files with 15 additions and 16 deletions

View File

@@ -11,7 +11,10 @@ export const docIconPickerTrigger = style({
lineHeight: 1,
},
'&[data-icon-type="emoji"]': {
fontFamily: 'emoji',
fontFamily: 'Inter',
},
'&::after': {
display: 'none',
},
},
});

View File

@@ -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 => {