Understanding the color system and its application in your theme.
Radix Themes comes with a number of color scales, each with their own light, dark and alpha variants. Under the hood, the color system is powered by Radix Colors, we override the default colors indigo and gray to match our Scale brand but all Radix Themes colors are also available for you to use if needed.
Accent color is the most dominant color in your theme. It is used for accent buttons, links and other interactive elements. accentColor
is specified directly on the Theme component and by default it's set to indigo
(accent):
There is a range of accent colors to choose from:
Each accent is a 12-step scale that includes a solid and a transparent variant of each color. For example, here’s the indigo
color scale (accent):
Accent color tokens can be accessed using CSS variables. You can use these tokens to style your custom components, ensuring they are accessible and consistent with the rest of your theme.
You can also choose between a pure gray or a number of tinted grays. Your accent color will be automatically paired with a gray shade that compliments it. However, you can also specify a custom grayColor
directly on the Theme component:
There is 6 grays to choose from. The difference may seem subtle, but it is impactful especially on pages with a lot of text or in dense UIs.
Grays are based on the same 12-step color scale that includes a solid and a transparent variant of each color. For example, here’s the slate
color scale:
Gray color tokens can be accessed using CSS variables. You can use these tokens to style your custom components, ensuring they are accessible and consistent with the rest of your theme.
When available, the color
prop on the components can be used to override the theme accent.
Nested components will automatically inherit the new accent color.
Individual colors can be accessed directly using similar CSS variables by their corresponding names. For example, the reds are accessed via --red-1
, --red-2
, and so on up to --red-12
.
Radix Themes automatically adjusts the focus and selection colors depending on the accent color of the current component. Most of the time, setting the color
prop will intelligently change the focus and selection colors to avoid a mismatch of conflicting hues:
Focus color tokens can be accessed using CSS variables that follow a similar naming structure like the other scales, e.g. --focus-1
, --focus-2
, and so on up to --focus-12
.
Most of the components use --focus-8
for the focus outline color.
Every color has an alpha variant which is designed to appear visually the same when placed over the page background. This is a powerful tool that allows colors to look naturally when overlay over another background. All numerical color steps have a corresponding alpha variant.
Alpha colors are used automatically within Radix Themes components no additional configuration is required.
A number of background colors are used to create a sense of visual hierarchy in Radix Themes UIs. These colors are used for backgrounds, cards, and other surfaces.
The panelBackground
prop controls whether panelled elements use a solid or a translucent background color. The default translucent
value creates a subtle overlay effect:
While solid
is useful when you'd prefer to present information unobstructed.
Scale UI Radix colors can be customized by overriding the corresponding CSS variables of the token system, to achieve this you need to delete this line import '@scale/scaleui-radix/dist/styles.css'
from your code and crate new CSS files similar to the ones in this folder to override the default colors.
If you need any extra guidance to create the theme for your project please ask in the #scaleui-radix-design channel in Slack for help.