Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸš‘hotfix: ν‚€μ›Œλ“œ Xλ²„νŠΌ 색상 λ³€κ²½ #436

Merged
merged 1 commit into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/presentation/components/common/Keyword/Item/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Keyword } from '@api/types/user';
import { icCloseGrey, icCloseWhite } from '@assets/icons';
import { COLOR } from '@styles/common/color';
import { StKeywordItem, StCount, StMyDeleteBtn } from './style';
import { StCount, StKeywordCloseBtn, StKeywordItem, StMyDeleteBtn } from './style';

interface Props extends Keyword {
isMutable: boolean;
Expand All @@ -28,9 +27,10 @@ function KeywordItem(props: Props) {
<div>
<div>{content}</div>
{isMutable && !isMine && (
<img
<StKeywordCloseBtn
Copy link
Member

@100Gyeon 100Gyeon Jan 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 κ°€λ²Όμš΄ μ œμ•ˆμ΄λΌ λ°˜μ˜ν•˜μ§€ μ•Šμ•„λ„ λ©λ‹ˆλ‹€~!
μ‚­μ œ λ²„νŠΌμ΄λ‹ˆκΉŒ close 말고 deleteλŠ” μ–΄λ–¨κΉŒμš”?

onClick={onDeleteClick}
src={viewMode === 'linear' || color === COLOR.GRAY_2 ? icCloseGrey : icCloseWhite}
theme={viewMode === 'linear' || color === COLOR.GRAY_2 ? 'grey' : 'color'}
color={fontColor}
/>
)}
</div>
Expand Down
22 changes: 18 additions & 4 deletions src/presentation/components/common/Keyword/Item/style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from 'styled-components';
import styled, { css } from 'styled-components';

import { icCloseWhite } from '@assets/icons';
import { COLOR } from '@styles/common/color';
import { FONT_STYLES } from '@styles/common/font-style';

Expand All @@ -20,9 +21,22 @@ export const StKeywordItem = styled.div<{ color: string; fontColor: string }>`
gap: 8px;
${FONT_STYLES.R_13_TITLE}
}
img {
cursor: pointer;
}
`;

export const StKeywordCloseBtn = styled.div<{ color: string; theme: 'grey' | 'color' }>`
cursor: pointer;
mask-image: url(${icCloseWhite});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mask-image λΌλŠ” 속성을 μ“°λ©΄ svg 색칠을 μ›ν•˜λŠ” μƒ‰μœΌλ‘œ ν•  수 μžˆμ–΄μš©
https://web.dev/i18n/ko/css-masking/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μš°μ™• 이거 처음 λ΄€μ–΄μš” !! 신기해라 🀩

(질문) 근데 -webkit-mask-image: url(${icCloseWhite});λŠ” 같이 적용 μ•ˆ 해도 λ˜λŠ” κ±΄κ°€μš”..?

width: 13px;
height: 13px;
${({ color, theme }) =>
theme === 'grey'
? css`
background-color: ${COLOR.GRAY_6};
`
: css`
background-color: ${color};
opacity: 0.6;
`}
`;

export const StCount = styled.span`
Expand Down