Thinking in Surfaces
Static palettes are not enough for modern interfaces.
In a dynamic UI, colors change based on where they live. A “gray” text needs to be dark on a white card, but light on a dark tooltip.
Axiomatic Color acts as a Context Engine. Instead of giving you a fixed list of colors, it gives you Surfaces that automatically adjust their content to fit the environment.
The Core Concept
Section titled “The Core Concept”A Surface is not just a background color. It sets the rules for everything inside it.
When you place an element on a surface, you aren’t just painting pixels. You are entering a new Context.
1. Surfaces Create Context
Section titled “1. Surfaces Create Context”Every surface acts as a “Context Provider.” It automatically sets a suite of CSS variables that determine how text, borders, and other elements should look when sitting on that specific surface.
In the visualization above:
- The Page sets the baseline context (Light Mode).
- The Card sits on the Page. It might be slightly lighter or darker, but it maintains the same Solar Time (Light text on Dark, or Dark text on Light).
- The Spotlight (the dark box) inverts the time. It tells its children: “I am dark. You must be light.”
2. Content Adapts to Context
Section titled “2. Content Adapts to Context”Because of this architecture, your components become portable.
You don’t write CSS like .card .text or .footer .text. You just write .text-strong.
- If
.text-strongis on a white card, it resolves to black. - If
.text-strongis on a black tooltip, it resolves to white.
The component doesn’t know where it is. The Surface tells it how to render.
The Hierarchy of Surfaces
Section titled “The Hierarchy of Surfaces”We categorize surfaces based on their physical role in the UI, not their color.
The Canvas
Section titled “The Canvas”These are the foundations. They recede into the background.
The Objects
Section titled “The Objects”These sit on top of the canvas. They hold your content.
The Interactors
Section titled “The Interactors”These are actionable. They invite touch.
The Spotlights
Section titled “The Spotlights”These demand attention. They often break the current polarity to stand out.
Changes saved successfully
Note on Inversion: Spotlight surfaces perform a “Hard Flip” of the theme. If your app is in Light Mode, a Spotlight surface forces its internals into Dark Mode (and vice versa). This ensures that native browser controls (like scrollbars and checkboxes) render correctly inside the inverted area.
X-Ray Mode (Forced Colors)
Section titled “X-Ray Mode (Forced Colors)”What happens when the user turns on “High Contrast Mode” in Windows?
In this mode, the operating system strips away all background colors to ensure maximum legibility. This can be disastrous for modern UIs that rely on background colors to define structure (like a white card on a gray background).
Axiomatic Color handles this with X-Ray Mode.
When the system detects forced-colors: active, it automatically switches from “Rich Mode” (painting pixels) to “X-Ray Mode” (drawing outlines).
- Rich Mode: A card has a white background and no border.
- X-Ray Mode: The background becomes transparent, and a Border appears automatically.
This ensures that your UI structure remains visible (“Fail Visible”) even when the user strips away the paint.
Why This Matters
Section titled “Why This Matters”By thinking in surfaces, you stop fighting with contrast ratios.
- Guaranteed Contrast: The system calculates the foreground colors based on the background surface. If the surface changes, the text changes.
- Automatic Dark Mode: You don’t design “Dark Mode” separately. You just define your surfaces, and the system flips the context.
- Infinite Nesting: You can put a Card inside a Sidebar inside a Page. The system handles the math to ensure distinctness at every level.