Skip to content

Commit

Permalink
fix: article render container responsive width
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Dec 12, 2024
1 parent 4cde1ac commit cae7fa6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/renderer/src/modules/entry-content/index.desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const EntryContent: Component<EntryContentProps> = ({
<article
data-testid="entry-render"
onContextMenu={stopPropagation}
className="relative m-auto min-w-0 max-w-[550px] @3xl:max-w-[70ch] @7xl:max-w-[80ch]"
className="relative m-auto min-w-0 max-w-[550px] @[47.5rem]:max-w-[70ch] @7xl:max-w-[80ch]"
>
<EntryTitle entryId={entryId} compact={compact} />

Expand Down
15 changes: 10 additions & 5 deletions apps/renderer/src/modules/entry-content/index.shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,21 +273,26 @@ export const ContainerToc: FC = memo(() => {
)}
/>

<BackTopIndicator />
<BackTopIndicator
className={
"@[700px]:-translate-x-4 @[800px]:-translate-x-8 @[900px]:translate-x-0 @[900px]:items-start"
}
/>
</div>
</div>
</RootPortal>
)
})

const BackTopIndicator = memo(() => {
const BackTopIndicator: Component = memo(({ className }) => {
const [readPercent] = useReadPercent()
const scrollElement = useScrollViewElement()
return (
<span
className={
"mt-2 flex grow flex-col px-2 font-sans text-sm text-gray-800 dark:text-neutral-300"
}
className={cn(
"mt-2 flex grow flex-col px-2 font-sans text-sm text-gray-800 dark:text-neutral-300",
className,
)}
>
<div className="flex items-center gap-2 tabular-nums">
<IconOpacityTransition
Expand Down

0 comments on commit cae7fa6

Please sign in to comment.