Understanding font-style, font-variant, and font-weight in CSS
CSS provides several properties to control the appearance of text. font-style, font-variant, and font-weight each serve distinct purposes.
font-style – Controls the slant of text.
normal (default), italic, oblique.font-variant – Controls the use of alternate glyphs such as small-caps.
normal, small-caps.font-weight – Controls the thickness or boldness of text.
normal (400), bold (700), 100-900 for fine-grained control.In this example, each property independently affects the text: italics for slant, small-caps for typographic style, and font-weight for thickness.
font-style is for slanting text (italic, oblique).
font-variant is for typographic alternates like small-caps.
font-weight is for boldness or lightness of text.
These properties can be combined for richer text styling.
Always use semantic HTML (<em>, <strong>) with CSS for accessible emphasis.
You need to make a paragraph italic and also display small caps for a heading. Which CSS properties would you use and how would you write them?
If you set font-weight: bold; on a button but the text doesn't appear bolder, what could be causing that?
While implementing a style guide, a designer asks for 'light oblique' text. How would you achieve that, and what are the differences between font-style: oblique and font-weight: 300?
A bug appears where font-variant: small-caps works in Chrome but not in Safari. How would you investigate and fix it?
Our design system needs to support dynamic theming where font weight and style can be toggled at runtime. What considerations would you make to ensure consistency and performance across components?
We have a legacy codebase with many inline font-weight declarations causing specificity wars. How would you refactor the CSS architecture to manage font style, variant, and weight more cleanly?
We're migrating a large enterprise product to a CSS‑in‑JS solution and need to map existing font-style, font-variant, and font-weight usages to a token system. What strategy would you use to avoid visual regressions and maintain cross‑team consistency?
How would you design a global typography framework that balances fine‑grained control (like small‑caps, italic, variable weight) with the goal of keeping the CSS bundle size minimal for a high‑traffic site?