Beta: These styles are a proposed starting point. Typography, spacing,
print behavior and the implementation may change as we gather feedback.
Use this page to review how a branded letter could look and compare the
proposed font sizes and spacing. The document style keeps the selected
brand's fonts, weights and colors while using a smaller type scale for
letters and document production.
The example below shows typography, spacing and branding with fictional
content. Its letter layout is illustrative, not a document template. Each
project owns its content, page layout, logos and envelope positioning.
These proposed sizes apply to the document style on screen and in print.
Regular app content keeps its existing typography.
Role
Size at the default root
Line height
Body and salutation
11pt
1.4
Main heading
14pt
1.25
Section heading
13pt
1.25
Subheadings and lead text
12pt
1.3
Signature and table cells
10pt
1.4
Footer and return address
9pt
1.4
Point sizes assume a 16px root font size and normal PDF scaling. The
implementation uses relative units so browser font preferences still work.
Paragraphs, headings, lists and tables have consistent spacing. The return
address and footer use the smallest text; signatures and table content
remain slightly larger. Brand fonts and weights remain part of the design.
Review the result with your actual content and production PDF renderer.
The document-production team's reference stylesheet should guide final
design approval.
Print output can retain the brand's colors using a light theme, or use
black text on white paper without background graphics. The plain paper
option works regardless of whether the app is light or dark on screen.
Images and artwork may still contain colors and should be checked on paper.
Page margins, footer placement and page numbers belong to the document
layout and PDF renderer. Changing the footer's font size does not correct
a footer positioned outside the page's content area. See
footer layout and page numbers for details.
Eufemia provides independent, opt-in print and document stylesheets. Use
either on its own or combine them. Neither imports the other or is included
in the default Eufemia bundle. Import the stylesheet and apply its scope
to enable it. Both work without React.
For an app, start with the printable apps guide.
Use the document implementation for the smaller
typography shown above. App navigation, content selection and page layout
still need to be handled by the app. These styles do not provide print
representations for every Eufemia component.
Need
Import
Scope
Print behavior with existing typography and spacing
dnb-ui-print.min.css
.dnb-print
Black text on white paper in either screen color scheme
dnb-ui-print.min.css
.dnb-print.dnb-print--plain
Document typography and spacing on screen and in print
dnb-ui-document.min.css
.dnb-document
Document formatting with print/PDF behavior
Both, with dnb-ui-print.min.css last
.dnb-document.dnb-print
SCSS imports are also available through @dnb/eufemia/style/print and
@dnb/eufemia/style/document. For isolated styles,
use the corresponding --isolated.min.css files within IsolatedStyleScope.
Wrap the content you want to apply pagination to in .dnb-print. This
works with existing app typography and does not require .dnb-document
or the document stylesheet:
<sectionclass="dnb-print">
<!-- Your existing content -->
</section>
The base .dnb-print scope preserves your existing typography, spacing,
brand palette and wrapper layout. Add the optional plain mode described
below to change paper colors. The print stylesheet works independently of
dnb-ui-document. Screen styles remain unchanged except for elements
explicitly marked dnb-print-only.
Configure your PDF renderer to use print media. The scope does not exclude
content elsewhere in the app from printing; the app owns that selection.
Pagination applies under @media print. Within .dnb-print,
it keeps headings with following content, requests repeating table headers
and footers, and asks that table rows stay together when they fit on a page.
It removes scrolling and clipping from Eufemia Table containers so rendered
rows can flow across pages. Long documents and tables can span pages;
pagination depends on the browser or PDF renderer.
Add .dnb-print-hidden to controls and other screen-only content. This
helper works inside or outside .dnb-print.
Add .dnb-print-only to content that should appear only in print. It
keeps its normal display in print and is hidden on screen.
Use .dnb-print__keep-together inside the scope for a short group, such
as a signature, that belongs together.
Use .dnb-print__page-break inside the scope to start a section on the
next page.
The app decides how navigation, buttons, form values, expanded sections,
dialogs and other interactive content appear in print. The stylesheet does
not hide controls automatically, expand collapsed content, render
virtualized rows, or convert interactive components to static content.
Page size, margins, repeated page footers, page numbering and envelope
geometry belong to the app or template and PDF renderer. The shared styles
do not impose an @page size or margin. For example, an A4 template can add:
For background-free output, add .dnb-print--plain to the print scope:
<sectionclass="dnb-print dnb-print--plain">
<!-- Black text without CSS backgrounds, in either screen color scheme -->
</section>
This opt-in mode applies only during printing. It makes text and links
black on a white paper surface, removes descendant CSS backgrounds,
gradients and shadows, uses gray borders, and disables transitions and
animations in the scope. Fonts and the type scale remain unchanged.
Text inputs, checkboxes, radio buttons and switches retain visible
boundaries and selection indicators without background graphics. The
screen retains its selected theme and control state.
Input placeholders are hidden in plain print so an empty field remains
visually distinct from an entered value.
Image pixels, fixed SVG fills, canvas and video are not recolored. Inline
SVGs that use currentColor follow the black text color. Provide a printable
alternative for graphics that depend on a dark background. CSS background
images are removed, so essential graphics should use an image element or
a separate printable representation.
Status information must remain understandable without color.
For output that retains brand colors, omit .dnb-print--plain and use a
light brand theme. The base .dnb-print scope does not convert dark
tokens to a light palette. Setting the CSS color-scheme property alone
does not replace those tokens.
For React, set the scheme on a Theme wrapper around the printable content:
For HTML without React, apply .eufemia-theme__color-scheme--light on a
wrapper around the printable content, with the selected brand's light
theme stylesheet loaded. This wrapper uses the light scheme on screen
as well as in print. A nested light wrapper lets the surrounding app keep
its selected color scheme. The document preview uses this approach.
For dark content on screen with black text on paper, use .dnb-print--plain.
Automatic conversion to a complete light brand palette remains outside
this stylesheet's support. Use a dedicated light printable view if you
need branded colors in print. Do not reset only a few color tokens.
In the base mode, the template owns the paper background and text color.
Use the light theme's background and text tokens for that paper surface.
Plain mode supplies white paper and black text. Both modes leave wrapper
width and overflow to the app or template. Brand artwork retains fixed
colors; background printing depends on the renderer's settings. Check that
text, links, borders and status indicators remain readable with background
graphics disabled and in
grayscale. Essential meaning must not depend on color alone.
Load fonts before generating the PDF and verify font embedding and page
breaks in the actual production renderer.
See the printable apps guide
for app layout, print-only content, and browser testing.
It works without dnb-ui-print. To combine document formatting with the
print behavior described above, add the print stylesheet after the
document stylesheet:
import'@dnb/eufemia/style/dnb-ui-print.min.css'
Also add .dnb-print to the document wrapper:
<articleclass="dnb-document dnb-print">
<!-- Document typography with print pagination -->
</article>
Add .dnb-print--plain to the same wrapper if the document should print
with black text on white paper. This changes print colors while
dnb-ui-document continues to supply document typography. The letter
preview uses a light brand theme with the base print mode to retain its
brand colors.
Wrap the document in .dnb-document, inside the selected brand's theme.
Application content outside this wrapper retains its normal typography.
.dnb-document activates document formatting only. Print pagination
requires both the print import and .dnb-print. Neither scope imports
styles or enables the other.
The size table maps native h1 to 14pt, h2 to 13pt, and h3 and h4
to 12pt. For React headings, the corresponding visual sizes are
xx-large, x-large, and large or medium.
Paragraphs have a 0.75rem bottom gap. Headings have 1.25rem above and
0.5rem below; a first heading has no top gap. Table cells use
0.375rem 0.5rem padding. Explicit Eufemia Space properties take precedence
over default paragraph and heading spacing.
Explicit table alignment, vertical alignment and cell spacing options are
also preserved. Table size variants use the document cell padding;
border={false} (or .dnb-table--no-border) keeps cells borderless.
React heading components retain their brand-specific default size mapping.
For example, H2 defaults to large for DNB and x-large for Sbanken.
Set size="x-large" on H2 to select the same 13pt document size across
brands, as shown in the React example. The native HTML heading sizes are fixed by the
document profile; both approaches retain the selected brand's fonts.
The profile reuses --font-size-* and --line-height-* variables. Values
are expressed in rem, so the point equivalents assume a 16px root and
normal PDF scaling. Browser font preferences still work. The profile does
not change the root font size. Responsive typography modifiers use the
document scale at every viewport size to keep pagination stable.
Use .dnb-document__signature for 10pt signature text, and
.dnb-document__footer and .dnb-document__return-address for 9pt text,
including nested paragraphs. Greeting wording, logos, envelope calculations
and positioning remain part of the template. Existing inline font sizes
should be removed when migrating to the profile.
Eufemia does not provide DNB Light or Noto Sans as part of this profile.
Prefer Eufemia's H1, H2, H3 and P components in React projects.
They render semantic HTML and support Eufemia's spacing props, typography
options and theme context. H1 renders an <h1> by default; it is not a
different heading level.
Keep the brand on the existing Theme component. This example uses
document formatting only:
import{H1,H2,P}from'@dnb/eufemia/elements'
import{Theme}from'@dnb/eufemia/shared'
render(
<Themebrand="sbanken"colorScheme="light">
<articleclassName="dnb-document"lang="nb">
<H1bottom="small">Informasjon om avtalen din</H1>
<P>Hei Tobias,</P>
<H2size="x-large">Dette gjelder for deg</H2>
<P>Takk for at du er kunde hos oss.</P>
<PclassName="dnb-document__signature">
Vennlig hilsen
<br/>
Sbanken
</P>
</article>
</Theme>
)
Choose heading levels for the document structure, not the desired font
size. Use the size prop to select a visual size independently of the
heading level. The example uses bottom="small" to add a 1rem gap below
the title.
Use native <h1>, <h2> and <p> elements when your document renderer
or templating system does not use React. The stylesheet supports these
elements directly within .dnb-document, so React is not required:
Both approaches produce semantic headings. Use the approach that fits the
project's rendering technology. To enable print pagination in either
example, import dnb-ui-print and add dnb-print to the article's classes.
Add dnb-print__keep-together to the signature to keep it on one page when
it fits.
.dnb-document__footer controls typography only. It does not position the
footer at the bottom of a page, repeat it across pages, or generate page
numbers. The print rules for repeating <tfoot> apply to table footers,
not document page footers.
The template and PDF renderer own footer placement and page numbering.
Align the footer with the document's content area and reserve enough space
in the page margins for the footer and page numbers. Keep page numbers in
a separate area from the footer text. Verify the layout with long content,
multiple pages and each supported language.
Use your PDF renderer's supported page-footer and page-counter features
for output such as "Page 1 of 3". Support differs between renderers, so
validate the result with the engine used in production. Reducing the font
size does not correct a footer whose width or position exceeds the page's
content area.