- Letterhead editing - Edit Header and Footer - Margin Text - PrintFormatGenerator class handles generation of HTML and PDF and repeating of Header/Footer - Simplify /printpreview - Separate renderer files for each fieldtype
86 lines
2 KiB
CSS
86 lines
2 KiB
CSS
{% include "templates/print_format/print_format_font.css" %}
|
|
|
|
{% macro render_margin_text(position) %}
|
|
{% set text = layout['text_' + position] %}
|
|
{% if text %}
|
|
@{{ position.replace('_', '-') }} {
|
|
content: {{ text }}
|
|
}
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
@page {
|
|
size: {{ print_settings.pdf_page_size or 'A4' }} portrait;
|
|
margin-top: {{ print_format.margin_top | int }}mm;
|
|
margin-bottom: {{ print_format.margin_bottom | int }}mm;
|
|
margin-left: {{ print_format.margin_left | int }}mm;
|
|
margin-right: {{ print_format.margin_right | int }}mm;
|
|
padding-top: {{ header_height }}px;
|
|
padding-bottom: {{ footer_height }}px;
|
|
|
|
{{ render_margin_text('top_left') }}
|
|
{{ render_margin_text('top_center') }}
|
|
{{ render_margin_text('top_right') }}
|
|
{{ render_margin_text('bottom_left') }}
|
|
{{ render_margin_text('bottom_center') }}
|
|
{{ render_margin_text('bottom_right') }}
|
|
}
|
|
|
|
body {
|
|
font-size: {{ print_format.font_size }}px;
|
|
min-width: {{ body_width | int }}mm !important;
|
|
max-width: {{ body_width | int }}mm !important;
|
|
}
|
|
|
|
@media screen {
|
|
html {
|
|
background-color: var(--gray-300);
|
|
}
|
|
body {
|
|
background-color: white;
|
|
box-shadow: var(--shadow-md);
|
|
margin: 2rem auto;
|
|
min-height: 297mm;
|
|
min-width: {{ body_width | int }}mm !important;
|
|
max-width: {{ body_width | int }}mm !important;
|
|
padding-top: {{ print_format.margin_top | int }}mm;
|
|
padding-right: {{ print_format.margin_right | int }}mm;
|
|
padding-left: {{ print_format.margin_left | int }}mm;
|
|
padding-bottom: {{ print_format.margin_bottom | int }}mm;
|
|
}
|
|
}
|
|
|
|
.section:not(:first-child) {
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.section-label {
|
|
font-size: var(--text-lg);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.field + .field {
|
|
margin-top: 0.5rem;
|
|
}
|
|
|
|
.field .label {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.child-table [data-fieldtype="Currency"] {
|
|
text-align: right;
|
|
}
|
|
|
|
.table-row {
|
|
page-break-inside: avoid;
|
|
}
|
|
|
|
.table-row td, .table-row th {
|
|
border-bottom-width: 1px;
|
|
border-bottom-style: solid;
|
|
border-bottom-color: var(--gray-300);
|
|
}
|
|
|
|
.page-break {
|
|
page-break-after: always;
|
|
}
|