Skip to content

Commit

Permalink
feat: 阅读模式添加打印功能按钮;调整打印样式,隐藏调整后的阅读模式 toolbar 的显示;
Browse files Browse the repository at this point in the history
  • Loading branch information
yaohaixiao committed Mar 28, 2024
1 parent 16f08e1 commit 482e84e
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 53 deletions.
6 changes: 5 additions & 1 deletion docs/css/docs.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/css/docs.min.css

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/css/example.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/css/example.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/outline.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/outline.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/reader.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/reader.min.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion outline.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions outline.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion outline.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion outline.min.js.map

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ class Reader extends Base {
this.toolbar = new Toolbar({
placement: 'rtl',
buttons: [
{
name: 'print',
icon: 'print',
size: 20,
action: {
context: this,
handler: this.print
}
},
{
name: 'exit',
icon: 'close',
Expand Down
2 changes: 1 addition & 1 deletion reader.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion reader.min.js.map

Large diffs are not rendered by default.

79 changes: 43 additions & 36 deletions theme/reader.less
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,15 @@
height: initial !important;
}

.outline-reader {
display: block !important;
overflow: hidden;

h1,
&__title {
margin: 13.4pt 0 28pt !important;
text-align: center !important;
font-size: 20pt !important;
.outline {
&-message,
&-toolbar {
display: none !important;
}

&.outline-reader {
&--reading {
position: relative !important;
height: auto !important;
padding: 0 !important;
overflow: hidden !important;
}
&-reader {
display: block !important;
overflow: hidden;

h1,
&__title {
Expand All @@ -150,31 +141,47 @@
font-size: 20pt !important;
}

&__close,
&__progress {
display: none !important;
&.outline-reader {
&--reading {
position: relative !important;
height: auto !important;
padding: 0 !important;
overflow: hidden !important;
}

h1,
&__title {
margin: 13.4pt 0 28pt !important;
text-align: center !important;
font-size: 20pt !important;
}

&__close,
&__progress {
display: none !important;
}
}
}

pre {
padding: 1em !important;
border: 1px solid @border_color !important;
border-radius: 4px !important;
}
pre {
padding: 1em !important;
border: 1px solid @border_color !important;
border-radius: 4px !important;
}

pre,
code {
background-color: @white !important;
}
pre,
code {
background-color: @white !important;
}

table,
img,
svg {
break-inside: avoid;
}
table,
img,
svg {
break-inside: avoid;
}

&_sibling {
display: none !important;
&_sibling {
display: none !important;
}
}
}
}

0 comments on commit 482e84e

Please sign in to comment.