Guides

Theming

Managing light and dark themes in ForgeUI

Theming

ForgeUI does not enforce a theming system.

This is an intentional decision.
Rather than prescribing how colors, tokens, or themes should be defined, ForgeUI focuses on providing structural consistency that works with a wide range of theming approaches.

ForgeUI is designed to adapt to your existing setup, not replace it.


How theming works in ForgeUI

ForgeUI works naturally with:

  • CSS variables
  • Tailwind utility classes
  • platform-level preferences (such as system dark mode)

These mechanisms are widely understood, composable, and easy to reason about.
By relying on them, ForgeUI keeps theming transparent and adaptable.

If a theming decision is hard to trace, it usually belongs at the application level.


No enforced token system

ForgeUI does not ship with a built-in token or theme layer.

This avoids:

  • locking teams into a specific color or spacing model
  • duplicating design-system responsibilities
  • hiding visual decisions behind configuration

Instead, teams are encouraged to define tokens where they already make sense — often in CSS variables or Tailwind configuration — and apply them consistently across components.


Light and dark mode

ForgeUI components are designed to work in both light and dark environments.

However, ForgeUI does not manage theme state directly.

Typical approaches include:

  • toggling a data-theme or class on the root element
  • relying on prefers-color-scheme
  • syncing theme state with application settings

ForgeUI components respond to these mechanisms without requiring additional configuration.


Styling at the component level

Theming in ForgeUI happens close to the component markup.

This means:

  • colors are applied via utilities or variables
  • theme-specific logic is visible where it matters
  • overrides remain local and predictable

This approach reduces surprises and makes it easier to audit visual behavior when themes change.


Avoiding hidden theming behavior

ForgeUI avoids implicit theme logic that automatically changes component behavior.

Implicit theming:

  • makes debugging harder
  • obscures visual intent
  • increases the risk of unintended side effects

By keeping theming explicit, ForgeUI ensures that visual changes are deliberate and understandable.

Explicit theming scales better than implicit magic.


Responsibilities of the implementer

ForgeUI provides the structure, but teams are responsible for:

  • defining color systems
  • validating contrast across themes
  • testing components in different modes

This separation keeps ForgeUI focused while allowing teams full control over visual identity.


In practice

When theming with ForgeUI:

  • start with neutral defaults
  • apply tokens at the application level
  • override locally only when necessary

This approach keeps theming flexible without fragmenting the system.


Final thought

Theming is a product concern, not a component concern.

ForgeUI’s role is to provide stable, predictable structure that supports theming — not to dictate how it should be done.

A good theming system is one you barely notice.

On this page