Aabestfontgenerator.
THE TYPE NOTEBOOK

CSS Import for Font Stylesheets

Import a font stylesheet in CSS, keep the import in valid order and distinguish it from loading a font file through @font-face.

Use CSS @import for a stylesheet that registers fonts. Use @font-face to declare a font file directly, then apply the named family to the text.

Sources reviewed .

COMPARE REAL FONTS

Try the collection.

Read the selection notes ↓

Enter the same words in each specimen to compare. These are editorial starting points; explore each family for its background and license.

LIVE TYPEFACE SPECIMEN

See your words in Inter.

Real font preview
Loading Inter…
Get font from the official source ↗

This preview uses a real font. Copying ordinary text into another app will not carry this font with it. The PNG keeps the visual appearance.

Explore Inter: history, styles and license ↗

LIVE TYPEFACE SPECIMEN

See your words in Lora.

Real font preview
Loading Lora…
Get font from the official source ↗

This preview uses a real font. Copying ordinary text into another app will not carry this font with it. The PNG keeps the visual appearance.

Explore Lora: history, styles and license ↗

01

Import a stylesheet rather than a font binary

W3C defines @import as a way to bring rules from another stylesheet into the current cascade. A statement such as @import url("./font-faces.css") belongs before ordinary style rules. The imported stylesheet can contain @font-face declarations. If all you have is a WOFF2 file, register it in a font-face rule instead.

02

Keep the imported family name and applied family aligned

Open the font stylesheet and check the exact family name and weight it provides. Use that name first in the element’s font-family list, then add a fallback. Confirm the stylesheet was requested and that the relevant font file became available. If a relative URL is used inside the imported stylesheet, inspect the request against the location of that stylesheet.

03

Check what users see when the resource arrives late

Compare the page before and after the intended font loads. Inspect the longest heading and the smallest important label in the fallback. If another stylesheet overrides the declaration, check rule order. The font-face guide covers direct file registration. Try the homepage copyable text styles for a separate caption.

GOOD QUESTIONS

Your questions, answered.

Can @import load a WOFF2 file by itself?

Use @import for stylesheet rules. Register a font file as the source in an @font-face rule.

Why did a late @import do nothing?

An import placed after ordinary style rules is invalid. Move it before them and check the resource path.

Sources & background

Sources supporting this page’s explanations. Practical examples are our editorial suggestions.