Skip to content

General ​

Responsive CSS Classes ​

There are several pre-defined, responsive CSS classes for quickly applying commonly used CSS properties.

They all follow the same general naming convention {property}-{bp}-{value} to apply responsively or {property}-{value}

Sass Variables, Functions and Mixins ​

In order to promote consistency and improve developer quality of life, we use Sass to define variables, mixins and functions. All of these are included in a library.scss file that can be pre-loaded in Webpack so that they are made available in single file Vue components. Anything in library.scss does not actually compile down to any CSS, rather just definitions that can be used to add CSS so that we always have common styles defined in one place.

Print ​

Beacon ships a print stylesheet — an @media print block, identical in the benefits and employee themes — that turns a Beacon page into something sensible on paper. There is nothing to opt into; it applies whenever a page is printed from the browser.

What it does:

  • Strips all ink. Every element gets color: #000 with backgrounds, box-shadows, and text-shadows removed. Any distinction carried by color alone disappears in print.
  • Hides chrome automatically. .site-header, .site-footer, .left-nav, .main-content-sidebar, .help-widget, and every .btn are set to display: none. Page padding and the main content area's border are dropped so the content fills the sheet.
  • Annotates links. An a[href] prints its URL in parentheses after the link text, and abbr[title] prints its title. In-page (#) and javascript: links are exempt.
  • Keeps tables readable across pages. thead repeats on each page (display: table-header-group), rows and images avoid splitting mid-break, and .table borders are forced visible against white.
  • Avoids awkward breaks. h2 and h3 never end a page, and paragraphs keep three-line orphans and widows.
ClassDescription
.hidden-printHides the element when the page is printed.
.no-printIdentical to .hidden-print.

Because color is stripped, anything meaningful has to survive in black and white — carry it in text, symbols, borders, or position rather than color alone. In print this is a hard constraint, not only an accessibility preference.

Scope: printed pages vs. generated PDFs ​

The stylesheet above covers printing a Beacon page from the browser. That is the whole of Beacon's remit for print.

A generated PDF — a document the application produces as its own artifact rather than rendering as a Beacon page — sits outside the design system. Its layout and typography are a one-off concern for the feature that generates it, and it does not need to conform to Beacon patterns. Beacon pattern requests shouldn't be raised for a generated PDF's internal typography.

The test is not whether the output ends up on paper, but whether the artifact is a Beacon-rendered page. If a PDF is produced by rendering an HTML page with Beacon's CSS and printing it, then Beacon does apply and everything above governs it.