New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lansforsakringar/fonts

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lansforsakringar/fonts

Länsförsäkringar web font files

1.1.1
latest
Source
npm
Version published
Maintainers
3
Created
Source

Länsförsäkringar Fonts

The Länsförsäkringar web font files and best practices we rely on.

Loading fonts

Please check the latest community guidelines before implementing the font files. As of 2022, our method for limiting Flash of invisible text (FOIT) and Flash of Unstyled Text (FOUT) relies on combining preloading and the font-display: swap CSS property.

Preloading

<head>
  <!-- ... -->
  <link rel="preload" href="/lf-rubrik.woff2" as="font" type="font/woff2" crossorigin>
  <link rel="preload" href="/lf-rubrik.woff" as="font" type="font/woff" crossorigin>
  <link rel="preload" href="/lf-rubrik.ttf" as="font" type="font/ttf" crossorigin>
  <link rel="preload" href="/intro-cond-bold.woff2" as="font" type="font/woff2" crossorigin>
  <link rel="preload" href="/intro-cond-regular.woff2" as="font" type="font/woff2" crossorigin>
</head>

Font display

@font-face {
  font-family: 'LF Rubrik';
  src:
    url('./lf-rubrik.woff') format('woff')
    url('./lf-rubrik.woff2') format('woff2')
    url('./lf-rubrik.ttf') format('ttf');
  font-display: swap;
  /* ... */
}

CSS

This package includes a complete CSS implementation of the font stacks ready to be imported.

The file declares the two custom properties --lf-font-family-sans-serif and --lf-font-family-serif which can be used to apply the appropriate font family.

@import '@lansforsakringar/fonts';

body {
  font-family: var(--lf-font-family-sans-serif);
}

h1 {
  font-family: var(--lf-font-family-serif);
}

The font files are referenced relative to the CSS and can be loaded using a tool like postcss-url. If such a tool is not available in your environment, you will have to copy the source files and do the CSS implementation manually.

See the full CSS implemetation.

Fallbacks

LF Rubrik (serif) falls back to Georgia. Intro Cond (sans serif) falls back to Arial.

See the complete font stacks in the implemetation example.

FAQs

Package last updated on 15 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts