theme-provider #22

Merged
andika merged 6 commits from theme-provider into dev 2026-01-28 01:50:41 +00:00
Showing only changes of commit 0d7e3a1286 - Show all commits

View File

@@ -12,27 +12,10 @@ export const StatCard = ({
const digitCount = const digitCount =
valueString.replace(/\D/g, "").length || valueString.length; valueString.replace(/\D/g, "").length || valueString.length;
/**
*
const getValueFontSize = () => {
if (digitCount <= 3) {
// 3.75rem for 3 or fewer digits
return "3.75rem";
} else if (digitCount <= 6) {
// Scale down for more digits
return "clamp(2rem, 5cqi, 3rem)";
} else if (digitCount <= 9) {
return "clamp(1.5rem, 4cqi, 2.5rem)";
} else {
return "clamp(1.25rem, 3cqi, 2rem)";
}
};
* */
const getValueFontSize = () => { const getValueFontSize = () => {
switch (true) { switch (true) {
case digitCount <= 3: case digitCount <= 2:
// 3.75rem for 3 or fewer digits // 3.75rem for 3 or fewer digits
return "3.75rem"; return "3.75rem";
case digitCount <= 6: case digitCount <= 6:
@@ -68,8 +51,8 @@ const getValueFontSize = () => {
</p> </p>
</div> </div>
<div className={`${iconBgClass} p-3 rounded-lg `}> <div className={`${iconBgClass} px-3 py-2 rounded-lg `}>
<Icon className="size-8" /> <Icon className="size-[valueFontSize]" />
</div> </div>
</div> </div>
<p <p