diff --git a/apps/docs/src/assets/Opacity.png b/apps/docs/src/assets/Opacity.png new file mode 100644 index 00000000..f78dc3da Binary files /dev/null and b/apps/docs/src/assets/Opacity.png differ diff --git a/apps/docs/src/index.css b/apps/docs/src/index.css index 544c5316..803a5a18 100644 --- a/apps/docs/src/index.css +++ b/apps/docs/src/index.css @@ -2,7 +2,7 @@ box-sizing: border-box; padding: 0; margin: 0; - font-family: "SUIT", sans-serif; + font-family: 'SUIT', sans-serif; font-style: normal; } @@ -11,37 +11,32 @@ body { } @font-face { - font-family: "SUIT"; - src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Light.woff2") - format("woff2"); + font-family: 'SUIT'; + src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; } @font-face { - font-family: "SUIT"; - src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Regular.woff2") - format("woff2"); + font-family: 'SUIT'; + src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; } @font-face { - font-family: "SUIT"; - src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Medium.woff2") - format("woff2"); + font-family: 'SUIT'; + src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; } @font-face { - font-family: "SUIT"; - src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-SemiBold.woff2") - format("woff2"); + font-family: 'SUIT'; + src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; } @font-face { - font-family: "SUIT"; - src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Bold.woff2") - format("woff2"); + font-family: 'SUIT'; + src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; } @@ -58,7 +53,7 @@ body { flex-direction: column; gap: 16px; color: white; - font-family: "SUIT", sans-serif; + font-family: 'SUIT', sans-serif; h4 { font-size: 28px; @@ -96,10 +91,81 @@ body { .color-chips { display: flex; - a { + span { width: 80px; height: 80px; + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + text-decoration: none; + color: transparent; + transition: color 160ms ease; + } + + span::before { + content: ''; + position: absolute; + inset: 0; + background: rgba(0, 0, 0, 0.15); + opacity: 0; + transition: opacity 160ms ease; + pointer-events: none; + z-index: 1; + } + + span::after { + content: attr(data-title); + position: absolute; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + padding: 8px; + text-align: center; + white-space: pre-line; + color: white; + opacity: 0; + transition: opacity 160ms ease; + pointer-events: none; + font-size: 12px; + font-weight: 600; + line-height: 1.2; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); + z-index: 2; + } + + span:hover::before { + opacity: 1; + } + span:hover::after { + opacity: 1; + } + span .alpha-bg { + position: absolute; + inset: 0; + background-image: url('/src/assets/Opacity.png'); + background-position: center; + background-repeat: repeat; + background-size: 80px 80px; + border-radius: 6px; + z-index: 0; } + span .alpha-fill { + position: absolute; + inset: 0; + border-radius: 6px; + z-index: 0; + } + } + .alpha-surface { + padding: 6px; + gap: 10px; + border-radius: 8px; + } + .alpha-surface span { + border: 1px solid rgba(255, 255, 255); + border-radius: 6px; } } diff --git a/apps/docs/src/stories/Colors.stories.tsx b/apps/docs/src/stories/Colors.stories.tsx index c0b8c2b3..1198b068 100644 --- a/apps/docs/src/stories/Colors.stories.tsx +++ b/apps/docs/src/stories/Colors.stories.tsx @@ -1,8 +1,8 @@ import { colors } from '@sopt-makers/colors'; export default { - title: 'colors/Colors' -} + title: 'colors/Colors', +}; export const Default = { render: () => { @@ -11,101 +11,142 @@ export const Default = { const alphaScales = [900, 800, 700, 600, 500, 400, 300, 200, 100]; const renderColorChips = (scalesArr: number[], name: string) => - scalesArr.map(item => { + scalesArr.map((item) => { const key = `${name}${item}` as keyof typeof colors; - return + return ; }); - return
* 마우스 오버시 이름과 코드가 뜹니다 *
+ const renderAlphaChips = (scalesArr: number[], name: string) => + scalesArr.map((item) => { + const colorKey = `${name}Alpha${item}` as keyof typeof colors; + const displayName = `alpha${item}`; + return ( + + + + + ); + }); -* 마우스 오버시 이름과 코드가 뜹니다 *
-grayscale
-blue
-red
-green
-yellow
-grayscale
+orange
-orange
+blue
+red
+green
+yellow
+red
-orange
-blue
-gray
-gray
+orange
+blue
+red
+green
+yellow
+