fix: 대시보드 KPI 글자 크기 반응형 + globals.css !important 예외 처리

ResizeObserver로 컨테이너 크기에 비례하는 동적 폰트 크기 적용.
globals.css의 font-size: 16px !important에서 kpi-dynamic-font 클래스 제외.
This commit is contained in:
SeongHyun Kim
2026-03-26 17:01:15 +09:00
parent cda7e7bbfe
commit 1128a4c278
2 changed files with 5 additions and 5 deletions

View File

@@ -509,7 +509,7 @@ select {
}
/* ===== 전체 폰트 사이즈 16px 통일 (버튼 제외) ===== */
body *:not(button, [role="button"]) {
body *:not(button, [role="button"], .kpi-dynamic-font) {
font-size: 16px !important;
}

View File

@@ -112,12 +112,12 @@ export function KpiCardComponent({
return (
<div
ref={containerRef}
className="flex h-full w-full flex-col items-center justify-center p-3"
className="pop-neu-card flex h-full w-full flex-col items-center justify-center p-4"
>
{/* 라벨 */}
{hasLabel && (
<p
className={`w-full text-muted-foreground ${labelAlignClass}`}
className={`kpi-dynamic-font w-full text-muted-foreground ${labelAlignClass}`}
style={{ fontSize: `${labelFontPx}px`, lineHeight: 1.2 }}
>
{item.label}
@@ -128,7 +128,7 @@ export function KpiCardComponent({
{visibility.showValue && (
<div className="flex items-baseline gap-[0.15em]">
<span
className="font-bold leading-none"
className="kpi-dynamic-font font-bold leading-none"
style={{
fontSize: `${valueFontPx}px`,
...(valueColor ? { color: valueColor } : {}),
@@ -140,7 +140,7 @@ export function KpiCardComponent({
{/* 단위 */}
{visibility.showUnit && unit && (
<span
className="text-muted-foreground font-medium"
className="kpi-dynamic-font text-muted-foreground font-medium"
style={{ fontSize: `${unitFontPx}px` }}
>
{unit}