Skip to content

Print and document styles#

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.

View the example · See font sizes · Developer guide

Style preview#

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.

Open the interactive style preview to switch brands, try a multi-page table and inspect print behavior.

Returadresse: DNB, Postboks 1600 Sentrum, 0021 Oslo

Ola Nordmann
Eksempelveien 12
0123 Oslo

14. oktober 2026

Informasjon om avtalen din

Hei Ola,

Vi har samlet informasjon om avtalen din og hva du bør være oppmerksom på. Du finner detaljene i oversikten nedenfor.

Dette gjelder for deg

  • Avtalen fortsetter som før.
  • Du kan se oppdatert informasjon i appen eller på nettsiden vår.
  • Ta kontakt dersom du har spørsmål.

Oversikt over avtalen

BeskrivelseDatoBeløp
Avtalepost 114.10.20261 250,00 kr
Avtalepost 214.10.20261 250,00 kr
Avtalepost 314.10.20261 250,00 kr

Har du spørsmål, kan du ta kontakt med oss på 915 04800.
Takk for at du er kunde hos oss.

Vennlig hilsen
DNB

Kun stilforhåndsvisning. Innhold og oppsett er eksempler, ikke en brevmal.

Document styles#

Typography and spacing#

These proposed sizes apply to the document style on screen and in print. Regular app content keeps its existing typography.

RoleSize at the default rootLine height
Body and salutation11pt1.4
Main heading14pt1.25
Section heading13pt1.25
Subheadings and lead text12pt1.3
Signature and table cells10pt1.4
Footer and return address9pt1.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.

Paper appearance#

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.

Developer guide#

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.

NeedImportScope
Print behavior with existing typography and spacingdnb-ui-print.min.css.dnb-print
Black text on white paper in either screen color schemednb-ui-print.min.css.dnb-print.dnb-print--plain
Document typography and spacing on screen and in printdnb-ui-document.min.css.dnb-document
Document formatting with print/PDF behaviorBoth, 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.

Print styles#

Import dnb-ui-print after Eufemia core and your selected brand styles:

import '@dnb/eufemia/style/dnb-ui-core.min.css'
import '@dnb/eufemia/style/themes/ui/ui-theme-basis.min.css'
import '@dnb/eufemia/style/dnb-ui-print.min.css'

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:

<section class="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:

@page letter {
size: A4;
margin: 20mm;
}
@media print {
.letter {
page: letter;
}
}

Plain paper output#

For background-free output, add .dnb-print--plain to the print scope:

<section class="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.

Color scheme and paper surface#

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:

<Theme colorScheme="light">
<section className="dnb-print">{/* Printable content */}</section>
</Theme>

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.

Document implementation#

dnb-ui-document applies the document typography and spacing on screen and in print. It preserves the selected brand's fonts, weights and colors.

Import document formatting#

Import it after Eufemia core and your brand styles:

import '@dnb/eufemia/style/dnb-ui-core.min.css'
import '@dnb/eufemia/style/themes/ui/ui-theme-basis.min.css'
import '@dnb/eufemia/style/dnb-ui-document.min.css'

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:

<article class="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.

Document scope#

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.

Typography details#

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.

React teams#

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(
<Theme brand="sbanken" colorScheme="light">
<article className="dnb-document" lang="nb">
<H1 bottom="small">Informasjon om avtalen din</H1>
<P>Hei Tobias,</P>
<H2 size="x-large">Dette gjelder for deg</H2>
<P>Takk for at du er kunde hos oss.</P>
<P className="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.

HTML templates without React#

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:

<article class="dnb-document" lang="nb">
<h1>Informasjon om avtalen din</h1>
<p>Hei Tobias,</p>
<p>Takk for at du er kunde hos oss.</p>
<p class="dnb-document__signature">Vennlig hilsen<br />DNB</p>
</article>

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.

Footer layout and page numbers#

.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.

Suggest an edit