| name | mint-css-colors |
| description | Design system color tokens and semantic color variables. Use for consistent color usage across applications with automatic dark mode support. |
Mint CSS Color System
Import
import '@groww-tech/mint-css/dist/index.css';
@import '@groww-tech/mint-css/dist/fragments/allVariables.css';
Color Categories
Primitive Colors
The design system defines primitives that can be combined:
| Category | Colors |
|---|
| Yellow | Various yellow shades |
| Red | Various red shades |
| Green | Various green shades |
| Blue | Various blue shades |
| Lilac | Various lilac shades |
| Neutrals | Gray/neutral shades |
State Colors
| Category | Purpose |
|---|
| Hover States | Interaction feedback |
| Selected States | Current selection indication |
Semantic Tokens
Background Tokens
--background-primary: ...;
--background-secondary: ...;
--background-tertiary: ...;
html[data-theme="dark"] {
--background-primary: ...;
--background-secondary: ...;
--background-tertiary: ...;
}
Content/Text Tokens
--content-primary: ...;
--content-secondary: ...;
--content-tertiary: ...;
--contentInverse: ...;
html[data-theme="dark"] {
--content-primary: ...;
--content-secondary: ...;
--content-tertiary: ...;
--contentInverse: ...;
}
Border Tokens
--border-primary: ...;
--border-secondary: ...;
html[data-theme="dark"] {
--border-primary: ...;
--border-secondary: ...;
}
Usage
CSS Usage
.my-component {
background-color: var(--background-primary);
color: var(--content-primary);
border-color: var(--border-primary);
}
.my-text {
color: var(--content-primary);
}
.my-secondary-text {
color: var(--content-secondary);
}
CSS Modules
.container {
background-color: var(--background-secondary);
color: var(--content-primary);
}
Inline Styles
<div style={{
backgroundColor: 'var(--background-primary)',
color: 'var(--content-primary)'
}}>
Content
</div>
CSS-in-JS
const styles = {
container: {
backgroundColor: 'var(--background-primary)',
color: 'var(--content-primary)',
}
};
Common Color Combinations
Primary Button
.button-primary {
background-color: var(--primary);
color: var(--contentInverse);
}
.button-primary:hover {
background-color: var(--primary-hover);
}
Error State
.error-text {
color: var(--error);
}
.error-background {
background-color: var(--error-background);
}
Success State
.success-text {
color: var(--success);
}
Card Component
.card {
background-color: var(--background-secondary);
border: 1px solid var(--border-primary);
}
Token Naming Convention
The token system uses this naming pattern:
[category]-[semantic-role]
Examples:
background-primary - Main background
content-secondary - Secondary/secondary text
border-primary - Default border color
Best Practices
- Use semantic tokens: Prefer tokens over hardcoded colors
- Test both themes: Ensure colors work in light and dark
- Check contrast: Ensure accessibility compliance
- Use CSS variables: Never hardcode colors
- Document custom colors: Add tokens for custom brand colors
Anti-Patterns
- Don't hardcode colors: Always use CSS variables
- Don't assume light theme: Design for both themes
- Don't ignore contrast: Check WCAG compliance
- Don't create ad-hoc colors: Add to design system
- Don't forget inverse colors: For text on colored backgrounds