diff --git a/packages/frontend/component/src/components/page-list/page-tags.css.ts b/packages/frontend/component/src/components/page-list/page-tags.css.ts index 8211c9bbe2..543c655216 100644 --- a/packages/frontend/component/src/components/page-list/page-tags.css.ts +++ b/packages/frontend/component/src/components/page-list/page-tags.css.ts @@ -64,14 +64,6 @@ export const innerBackdrop = style({ }, }); -const range = (start: number, end: number) => { - const result = []; - for (let i = start; i < end; i++) { - result.push(i); - } - return result; -}; - export const tag = style({ height: '20px', display: 'flex', @@ -94,14 +86,6 @@ export const tagSticky = style([ textOverflow: 'ellipsis', whiteSpace: 'nowrap', left: 0, - selectors: range(0, 20).reduce((selectors, i) => { - return { - ...selectors, - [`&:nth-last-child(${i + 1})`]: { - right: `${i * 48}px`, - }, - }; - }, {}), }, ]); diff --git a/packages/frontend/component/src/components/page-list/page-tags.tsx b/packages/frontend/component/src/components/page-list/page-tags.tsx index 4b6b4072a2..8650979983 100644 --- a/packages/frontend/component/src/components/page-list/page-tags.tsx +++ b/packages/frontend/component/src/components/page-list/page-tags.tsx @@ -18,6 +18,7 @@ interface TagItemProps { tag: Tag; idx: number; mode: 'sticky' | 'list-item'; + style?: React.CSSProperties; } // hack: map var(--affine-tag-xxx) colors to var(--affine-palette-line-xxx) @@ -37,13 +38,14 @@ const tagColorMap = (color: string) => { return mapping[color] || color; }; -const TagItem = ({ tag, idx, mode }: TagItemProps) => { +const TagItem = ({ tag, idx, mode, style }: TagItemProps) => { return (