= {
render: (args) => {
return (
-
+
낮은 명암비
-
- 높은 명암비
-
+ 높은 명암비
);
},
@@ -69,7 +67,7 @@ export const Contrasts: StoryObj = {
children: {
control: false,
},
- contrast: {
+ muted: {
control: false,
},
},
diff --git a/src/components/Heading/Heading.test.tsx b/src/components/Heading/Heading.test.tsx
index bbefd54..4e0f57e 100644
--- a/src/components/Heading/Heading.test.tsx
+++ b/src/components/Heading/Heading.test.tsx
@@ -46,10 +46,10 @@ test("applies the correct color for low and high contrast", () => {
render();
expect(screen.getByRole("heading", { name: "낮은 명암비" })).toHaveClass(
- "c_text"
+ "c_text.muted"
);
expect(screen.getByRole("heading", { name: "높은 명암비" })).toHaveClass(
- "c_text.contrast"
+ "c_text"
);
});
diff --git a/src/components/Heading/Heading.tsx b/src/components/Heading/Heading.tsx
index 6ec755a..b7b3a94 100644
--- a/src/components/Heading/Heading.tsx
+++ b/src/components/Heading/Heading.tsx
@@ -14,20 +14,21 @@ export interface HeadingProps extends HTMLAttributes {
/** 굵기 */
weight?: FontWeight;
/** 명암비 */
- contrast?: "low" | "high";
+ muted?: boolean;
}
/**
* - `level` 속성을 통해서 ``, ``, ``, ``, ``, `` 요소 중 하나를 선택할 수 있습니다.
* - `level` 속성은 단계 별 기본 텍스트 스타일을 제공합니다.
* - `size` 속성과 `weight` 속성을 통해서 기본 스타일을 변경할 수 있습니다.
+ * - `muted` 속성을 주시면 글자색이 옅어집니다. 명암비가 낮아지므로 접근성 측면에서 주의해서 사용하세요.
*/
export const Heading = ({
children,
level,
size,
weight,
- contrast = "low",
+ muted = false,
...rest
}: HeadingProps) => {
if (!level) {
@@ -41,7 +42,7 @@ export const Heading = ({
return (