- Refactored role metadata styles in UserDetailPage for consistency with design tokens. - Replaced hardcoded avatar colors with a utility function to generate gradients based on user ID. - Improved InfoCard component styles for better hover effects and accessibility. - Removed deprecated color classes and adjusted background gradients for various components. - Updated theme token tests to reflect the removal of deferred files and ensure compliance with design standards. - Added new avatarColors utility file to manage avatar gradient definitions.
16 lines
669 B
TypeScript
16 lines
669 B
TypeScript
/**
|
|
* گرادیان آواتارهای بدون عکس — تزئینی و عمداً چندرنگ، در هر دو تم یکسان
|
|
* (مثل پالت برچسبها). تنها جایی در پنل که پالت ثابت Tailwind مجاز است.
|
|
*/
|
|
export const AVATAR_GRADIENTS = [
|
|
'from-blue-500 to-cyan-500',
|
|
'from-violet-500 to-purple-600',
|
|
'from-emerald-500 to-teal-600',
|
|
'from-rose-500 to-pink-600',
|
|
'from-amber-500 to-orange-600',
|
|
];
|
|
|
|
/** گرادیان پایدار برای یک آواتار بر اساس شناسه/اندیس. */
|
|
export const avatarGradient = (seed: number) =>
|
|
AVATAR_GRADIENTS[Math.abs(seed) % AVATAR_GRADIENTS.length];
|