Mihr UI logoMihr UI

Color variables

Semantic color tokens map palette shades to specific UI roles. Each token automatically resolves to a different shade in light and dark mode, so you never hardcode colors.

All groups are registered as ThemeExtension and accessible via context extensions like context.textColors.primary.


Text colors23 tokens

Manage all text fill colors across light and dark modes via TextColors.

NameLight modeDark modeUsage
text.primarygray-900grayDark-50page headings, high emphasis content
text.secondarygray-700grayDark-300labels, section headings
text.secondary.hovergray-800grayDark-200Secondary text hover state
text.tertiarygray-600grayDark-400supporting text, paragraphs
text.tertiary.hovergray-700grayDark-300Tertiary text hover state
text.quaternarygray-500grayDark-400subtle, low-contrast text (footer headings)
text.disabledgray-500grayDark-500disabled fields, buttons
text.placeholdergray-500grayDark-500input placeholders
text.placeholder.subtlegray-300grayDark-700lower contrast (e.g. verification inputs)
text.whitewhitewhitealways white regardless of mode
text.primary.on.brandwhitegrayDark-50Primary text on solid brand backgrounds (CTA sections)
text.secondary.on.brandbrand-200grayDark-300Secondary text on solid brand backgrounds
text.tertiary.on.brandbrand-200grayDark-400Tertiary text on solid brand backgrounds
text.quaternary.on.brandbrand-300grayDark-400Quaternary text on solid brand backgrounds
text.brand.primarybrand-900grayDark-50brand headings (e.g. pricing cards)
text.brand.secondarybrand-700grayDark-300brand buttons, accented text
text.brand.secondary.hoverbrand-800grayDark-200Brand secondary text hover state
text.brand.tertiarybrand-600grayDark-400lighter accented text (metric numbers)
text.brand.tertiary.altbrand-600grayDark-50lighter in dark mode
text.error.primaryerror-600error-400error messages, validation
text.error.primary.hovererror-700error-300Error text hover state
text.warning.primarywarning-600warning-400warning messages
text.success.primarysuccess-600success-400success messages

Background colors32 tokens

Surface and container colors via BackgroundColors.

NameLight modeDark modeUsage
bg.primarywhitegrayDark-950white in light, near-black in dark
bg.primary.solidgray-950grayDark-900dark background for tooltips, etc.
bg.primary.altwhitegrayDark-900switches to secondary in dark mode
bg.primary.hovergray-50grayDark-800default hover for white-bg components
bg.secondarygray-50grayDark-900subtle contrast against primary (section bgs)
bg.secondary.solidgray-600grayDark-600mid-tone dark fill (featured icons)
bg.secondary.subtlegray-25grayDark-900slightly lighter secondary
bg.secondary.hovergray-100grayDark-800hover on gray-50 bg components
bg.secondary.altgray-50grayDark-950switches to primary in dark mode
bg.tertiarygray-100grayDark-800stronger contrast (toggles)
bg.quaternarygray-200grayDark-700even stronger contrast (sliders, progress)
bg.activegray-50grayDark-800selected items
bg.disabledgray-100grayDark-800disabled primary buttons, toggles
bg.disabled.subtlegray-50grayDark-900disabled inputs, checkboxes
bg.overlaygray-950grayDark-800modal overlays
bg.brand.primarybrand-50brand-500brand tinted (check icons)
bg.brand.primary.altbrand-50grayDark-900switches to secondary bg in dark mode
bg.brand.secondarybrand-100brand-600slightly stronger brand tint (featured icons)
bg.brand.solidbrand-600brand-600strong brand fill (toggles, messages)
bg.brand.solid.hoverbrand-700brand-500hover state for brand solid
bg.brand.sectionbrand-800grayDark-900dark brand bg for website sections (CTAs)
bg.brand.section.subtlebrand-700grayDark-950lighter brand section bg (FAQ sections)
bg.error.primaryerror-50error-950light error bg (error states)
bg.error.secondaryerror-100error-600slightly stronger error bg (featured icons)
bg.error.soliderror-600error-600strong error fill (buttons)
bg.error.solid.hovererror-700error-500Error solid hover
bg.warning.primarywarning-50warning-950Warning primary background
bg.warning.secondarywarning-100warning-600Warning secondary background (featured icons)
bg.warning.solidwarning-600warning-600strong warning fill
bg.success.primarysuccess-50success-950Success primary background
bg.success.secondarysuccess-100success-600Success secondary background (featured icons)
bg.success.solidsuccess-600success-600strong success fill

Border colors10 tokens

Divider and border colors via BorderColors.

NameLight modeDark modeUsage
border.primarygray-300grayDark-700inputs, button groups, checkboxes
border.secondarygray-200grayDark-800most common default (tables, cards, dividers)
border.secondary.altrgba(#000000, 8%)grayDark-800floating menus, notifications
border.tertiarygray-100grayDark-800subtle dividers, chart axes
border.disabledgray-300grayDark-700disabled inputs, checkboxes
border.disabled.subtlegray-200grayDark-800disabled buttons
border.brandbrand-500brand-400active input fields
border.brand.altbrand-600grayDark-700switches to gray in dark mode (banners, footers)
border.errorerror-500error-400error state inputs, uploaders
border.error.subtleerror-300error-500less prominent error indication

Foreground colors21 tokens

Icon and indicator colors via ForegroundColors.

NameLight modeDark modeUsage
fg.primarygray-900whiteprimary icons
fg.secondarygray-700grayDark-300secondary icons
fg.secondary.hovergray-800grayDark-200Secondary hover state
fg.tertiarygray-600grayDark-400supporting icons
fg.tertiary.hovergray-700grayDark-300Tertiary hover state
fg.quaternarygray-400grayDark-600button icons, help icons, input icons
fg.quaternary.hovergray-500grayDark-500Quaternary hover state
fg.whitewhitewhiteAlways white foreground
fg.disabledgray-400grayDark-500disabled button group icons, dropdown items
fg.disabled.subtlegray-300grayDark-600disabled active checkboxes
fg.brand.primarybrand-600brand-500featured icons, progress bars
fg.brand.primary.altbrand-600grayDark-300switches to gray in dark mode (active tabs)
fg.brand.secondarybrand-500brand-500accents, arrows in marketing
fg.brand.secondary.altbrand-500grayDark-600switches to gray in dark mode (brand buttons)
fg.brand.secondary.hoverbrand-600grayDark-500Brand secondary hover state
fg.error.primaryerror-600error-500error featured icons
fg.error.secondaryerror-500error-400error input icons, negative metrics
fg.warning.primarywarning-600warning-500warning featured icons
fg.warning.secondarywarning-500warning-400Warning secondary foreground
fg.success.primarysuccess-600success-500success featured icons
fg.success.secondarysuccess-500success-400button dots, avatar online dots, positive metrics

Component colors29 tokens

Component-specific tokens (avatars, toggles, sliders, etc.) via ComponentColors.

NameLight modeDark modeUsage
comp.avatar.bggray-100grayDark-800
comp.avatar.contrast.borderrgba(#000000, 8%)rgba(#FFFFFF, 12%)
comp.avatar.profile.photo.borderwhitegrayDark-950
comp.avatar.styles.bg.neutral#E0E0E0#E0E0E0
comp.button.primary.iconbrand-300brand-300
comp.button.primary.icon.hoverbrand-200brand-200
comp.button.destructive.primary.iconerror-300error-300
comp.button.destructive.primary.icon.hovererror-200error-200
comp.featured.icon.light.fg.brandbrand-600brand-200
comp.featured.icon.light.fg.errorerror-600error-200
comp.featured.icon.light.fg.graygray-500grayDark-200
comp.featured.icon.light.fg.successsuccess-600success-200
comp.featured.icon.light.fg.warningwarning-600warning-200
comp.focus.ringbrand-500brand-500
comp.focus.ring.errorerror-500error-500
comp.footer.button.fgbrand-200grayDark-300
comp.footer.button.fg.hoverwhitegrayDark-100
comp.icon.fg.brandbrand-600grayDark-400
comp.icon.fg.brand.on.brandbrand-200grayDark-400
comp.screen.mockup.bordergray-900grayDark-700
comp.slider.handle.bgwhitebrand-500
comp.slider.handle.borderbrand-600grayDark-950
comp.toggle.bordergray-300transparent
comp.toggle.button.fg.disabledgray-50grayDark-600
comp.toggle.slim.border.pressed.hoverbrand-700transparent
comp.toggle.slim.border.pressedbrand-600transparent
comp.tooltip.supporting.textgray-300grayDark-300
comp.text.editor.icon.fggray-400grayDark-400
comp.text.editor.icon.fg.activegray-500white

Utility colors18 palettes

UtilityColors provides 18 palettes, each a UtilityScale with shades 50 through 900. In light mode shades map directly; in dark mode the scale is inverted so darker shades become lighter.

TokenLight sourceDark sourceShades
graydirectExtended(gray)grayDarkInverted(grayDark)50–900
branddirectExtended(brand)brandInverted(brand)50–900
brandAltdirectExtended(brand)grayDarkInverted(gray)50–900
bluedirect(AccentColors.blue)inverted(AccentColors.blue)50–700
blueDarkdirect(AccentColors.blueDark)inverted(AccentColors.blueDark)50–700
blueLightdirect(AccentColors.blueLight)inverted(AccentColors.blueLight)50–700
indigodirect(AccentColors.indigo)inverted(AccentColors.indigo)50–700
purpledirect(AccentColors.purple)inverted(AccentColors.purple)50–700
fuchsiadirect(AccentColors.fuchsia)inverted(AccentColors.fuchsia)50–700
pinkdirect(AccentColors.pink)inverted(AccentColors.pink)50–700
errordirect(MihrColors.error)inverted(MihrColors.error)50–700
warningdirect(MihrColors.warning)inverted(MihrColors.warning)50–700
successdirect(MihrColors.success)inverted(MihrColors.success)50–700
orangedirect(AccentColors.orange)inverted(AccentColors.orange)50–700
orangeDarkdirect(AccentColors.orangeDark)inverted(AccentColors.orangeDark)50–700
grayBluedirect(grayBlue)inverted(grayBlue)50–700
greendirect(AccentColors.green)inverted(AccentColors.green)50–700
yellowdirect(AccentColors.yellow)inverted(AccentColors.yellow)50–700

Alpha colors20 tokens

AlphaColors provides 20 opacity-based tokens that adapt to the current theme. In light mode, white tokens use #FFFFFF and black tokens use #000000. In dark mode the base colors are swapped: white tokens use #0C0E12 (gray-950) and black tokens use #FFFFFF.

TokenOpacityLight modeDark mode
white1010%#FFFFFF @ 10%#0C0E12 @ 10%
white2020%#FFFFFF @ 20%#0C0E12 @ 20%
white3030%#FFFFFF @ 30%#0C0E12 @ 30%
white4040%#FFFFFF @ 40%#0C0E12 @ 40%
white5050%#FFFFFF @ 50%#0C0E12 @ 50%
white6060%#FFFFFF @ 60%#0C0E12 @ 60%
white7070%#FFFFFF @ 70%#0C0E12 @ 70%
white8080%#FFFFFF @ 80%#0C0E12 @ 80%
white9090%#FFFFFF @ 90%#0C0E12 @ 90%
white100100%#FFFFFF @ 100%#0C0E12 @ 100%
black1010%#000000 @ 10%#FFFFFF @ 10%
black2020%#000000 @ 20%#FFFFFF @ 20%
black3030%#000000 @ 30%#FFFFFF @ 30%
black4040%#000000 @ 40%#FFFFFF @ 40%
black5050%#000000 @ 50%#FFFFFF @ 50%
black6060%#000000 @ 60%#FFFFFF @ 60%
black7070%#000000 @ 70%#FFFFFF @ 70%
black8080%#000000 @ 80%#FFFFFF @ 80%
black9090%#000000 @ 90%#FFFFFF @ 90%
black100100%#000000 @ 100%#FFFFFF @ 100%