-
Notifications
You must be signed in to change notification settings - Fork 8
支持打印模式
小叉 edited this page May 12, 2022
·
1 revision
在 layout.css
顶部注释中添加声明 @printMode
/**
* @name 主题名称
* @printMode A3,A4,A5H
*/
加载有声明打印模式的主题,可选择打印模式。
注释中的名称即作为选项名称(最后一位字母若是
H
会转换为横向
);
选择对应模式后,会在<body>
添加class
(名称会被转换为小写)。
示例:
-
A4
: 选项名称为A4
,样式为<body class="print a4">
-
A5H
: 选项名称为A5 横向
,样式为<body class="print a5h">
body.print.a3{}
body.print.a4{}
body.print.a5h{}
/* 仅在打印预览、打印时,才有效样式 */
@media print {
.calendar{margin:0;}
.calendar section{margin:0;padding:0;page-break-before:always;}
}