Skip to content

Commit

Permalink
feat: add outline for icons
Browse files Browse the repository at this point in the history
  • Loading branch information
davidleger95 committed Nov 28, 2023
1 parent c07b0b7 commit c668cda
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/components/Tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,37 @@ const StyledTag = styled.div`
font-size: 0.8rem;
`;

const IconContainer = styled.div`
display: inline-grid;
grid-template-areas: icon;
justify-items: center;
align-items: center;
`;

const Icon = styled.i`
background-color: #fff;
padding: 2px;
border-radius: 3px;
grid-area: icon;
`;

const IconOutline = styled.i`
grid-area: icon;
paint-order: stroke fill;
-webkit-text-stroke-width: 3px;
-webkit-text-stroke-color: white;
`;

export type Props = { label: string; icon?: string; colored?: boolean };

const Tag = ({ label, icon, colored = true }: Props) => {
return (
<StyledTag>
{icon && <Icon className={`devicon-${icon} ${colored && 'colored'}`} />}{' '}
{icon && (
<IconContainer>
<IconOutline className={`devicon-${icon}`} />
<Icon className={`devicon-${icon} ${colored && 'colored'}`} />
</IconContainer>
)}{' '}
{label}
</StyledTag>
);
Expand Down

0 comments on commit c668cda

Please sign in to comment.