Skip to content

Commit

Permalink
Make chapter view paginator flush
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiriVulpes committed Dec 30, 2024
1 parent e146624 commit c889714
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ui/view/ChapterView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default ViewDefinition({
const paginator = await view.paginator()
.viewTransition("chapter-view-chapter")
.style("view-type-chapter-block")
.type("flush")
.tweak(p => p.title.text.bind(chapterState.mapManual(chapter =>
quilt["view/chapter/title"](Maths.parseIntOrUndefined(chapter.url), chapter.name))))
.appendTo(view)
Expand All @@ -52,6 +53,9 @@ export default ViewDefinition({
.setMarkdownContent(chapter.body ?? "")
})

paginator.header.style("view-type-chapter-block-header")
paginator.footer.style("view-type-chapter-block-paginator-actions")

paginator.data.use(paginator, chapter => chapterState.value = chapter)

return view
Expand Down
1 change: 1 addition & 0 deletions style/component/core/paginator.chiri
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
%padding-block-3

&-page:
display: ${paginator-page-display: flex}
%flex
%flex-column
#transition: #{transition("opacity")}, #{transition("translate")}, #{transition("display")}
Expand Down
19 changes: 18 additions & 1 deletion style/view/type/chapter.chiri
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@

&-work:
&-block:

&-header:
#after: .block-header, .paginator-header, .paginator-header--flush
%background-none
%border-none
%box-shadow-none
%relative
%padding-inline-0

@before:
%background-none
%backdrop-filter-none

&-body:
%padding-inline-4
#after: .paginator-page
%padding-top-3
%padding-bottom-4
$paginator-page-display: block

&-paginator-actions:
%padding-inline-0

0 comments on commit c889714

Please sign in to comment.