Backpack's stylesheets.
Check the main Readme for a complete installation guide.
Within your Javascript (usually the entrypoint or top-most JS file)
import '@skyscanner/backpack-web/bpk-stylesheets';By default font rendering is not included if you need to include Skyscanner Relative in your styles, import it using the following:
import '@skyscanner/backpack-web/bpk-stylesheets/font';For Editorial text, the Larken font will also need to be imported:
import '@skyscanner/backpack-web/bpk-stylesheets/larken';As Vite will not transpile the SCSS files, you will need to import the CSS files directly:
import '@skyscanner/backpack-web/bpk-stylesheets/base';
import '@skyscanner/backpack-web/bpk-stylesheets/base.css';By default font rendering is not included if you need to include Skyscanner Relative in your styles, import it using the following:
import '@skyscanner/backpack-web/bpk-stylesheets/font.css';For Editorial text, the Larken font will also need to be imported:
import '@skyscanner/backpack-web/bpk-stylesheets/larken.css';Font updates involve coordination between three repositories:
- Backpack Foundations: defines shared design tokens and font-family values.
- Backpack: registers fonts, implements stylesheet and component.
- bpk-fonts: hosts the actual font files deployed to the CDN.
Backpack uses two font bundles:
- UI text:
font.scss(Skyscanner Relative) - Editorial text:
larken.scss(Larken + Noto fallbacks)
Fallbacks are needed for non‑Latin scripts so text renders correctly everywhere.
- Update Skyscanner Relative files and Noto fallback files in
packages/bpk-stylesheets/font.scss. - Update Larken and Noto fallback files in
packages/bpk-stylesheets/larken.scss.
Defined in font.scss, larken.scss
- Arabic →
Noto Sans Arabic - Hebrew →
Noto Sans Hebrew - Devanagari →
Noto Serif Devanagari - Thai →
Noto Serif Thai - Simplified Chinese →
Noto Sans SC - Traditional Chinese →
Noto Sans TC - Japanese →
Noto Sans JP - Korean →
Noto Sans KR - Generic serif coverage →
Noto Serif
-
Prepare files
- Verify Skyscanner Relative includes Noto fonts for Arabic / Hebrew / Devanagari / Thai / Simplified Chinese / Traditional Chinese / Japanese / Korean fallbacks, as defined in $bpk-font-family-base.
- Prefer
woff2; includewoff/ttfonly if needed. - Add the files to Skyscanner/bpk-fonts using hashed filenames. After merge and deploy, they are served from
https://js.skyscnr.com/sttc/bpk-fonts. - Cross-repo change clarification:
- If the change involves updating token values or adding new script fallbacks, make changes in Backpack Foundations.
- If the change only affects Backpack stylesheets (e.g. font.scss, $base-url, changelog), update within Backpack.
-
Edit SCSS
- In
font.scssand/orlarken.scss, update each@font-faceURL. - Keep
font-familynames and weights the same unless design says otherwise. - If the CDN path changes, update
$base-urlat the top of the file.
- In
-
Build
npm run build:stylesheets
- Verify
-
Import bundles:
import '@skyscanner/backpack-web/bpk-stylesheets/font'; import '@skyscanner/backpack-web/bpk-stylesheets/larken';
-
Visual & glyph validation:
- Check that Arabic / Hebrew / Devanagari / Thai / SC / TC / JP / KR scripts show no missing glyphs.
- Verify all font weights and styles (normal / italic) render correctly.
- For RTL languages (Arabic / Hebrew), test with
dir="rtl"and appropriatelangattributes.
-
DevTools checks:
- Computed: Confirm actual
font-familyandfont-weight. - Network: Ensure fonts load from the CDN and the
woff2format is used.
- Computed: Confirm actual
-
Visual regression:
- Use bpk-stylesheets-fonts storybook to capture before-and-after snapshots for visual verification.
-
Performance tips:
- Use
font-display: swapfor better perceived performance. - Add
preconnectorpreloadto the CDN when appropriate to reduce FOUT/FOIT.
- Use
- Submit
- Describe the change and include screenshots where helpful.
- Browsers pick the closest available weight if an exact one is missing.
- Always provide an explicit
@font-facefor each weight/style combination you depend on. - Provide fallback font files for every weight you plan to use across scripts. For example:
- Relative (in
font.scss): 400, 400 italic, 500, 500 italic, 700, 700 italic, 900, 900 italic. - Larken + fallbacks (in
larken.scss): Larken 300 and 400. If editorial styles use more weights, add matching@font-facefor each Noto fallback as well.
- Relative (in
- If you introduce a new weight, add the corresponding
@font-faceentries. - In verification, check each used weight renders from the expected family in DevTools.
Don't forget to rebuild and commit base.js after you make changes to this package.
To build the base.js file run npm run build:stylesheets in the root folder.