Skip to content

Commit

Permalink
update Tokens > Icons to latest iconset
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry Archibald committed Nov 9, 2023
1 parent 806f9d6 commit 1198129
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
7 changes: 6 additions & 1 deletion public/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,15 @@ h4 {
}
}

.cpdIcon {
.cpdIconItem {
display: flex;
flex-direction: row;
align-items: center;
gap: 16px;
padding: 8px;
}

.cpdIcon {
height: 32px;
width: 32px;
}
8 changes: 8 additions & 0 deletions stories/src/utils/Icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";

export const Icon: React.FC<{iconName: string}> = ({ iconName }) => {
return <div className="cpdIconItem">
<img className="cpdIcon" alt={iconName} src={require(`@vector-im/compound-design-tokens/icons/${iconName}.svg`)}/>
<p>{iconName}</p>
</div>
}
15 changes: 3 additions & 12 deletions stories/tokens/Icons.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,14 @@ import { Meta } from "@storybook/addon-docs";

import icons from "@vector-im/compound-design-tokens/icons/$icons.json";

import { Icon } from "../src/utils/Icon";

<Meta title="Tokens/Icons" />

# Icons

<div className="cpdIconPreview">
{Object.keys(icons.icon).map((iconName) => (
<div className="cpdIcon" key={iconName}>
<span
style={{
width: "24px",
height: "24px",
display: "block",
background: `var(--cpd-icon-${iconName})`,
backgroundSize: "contain",
}}
/>
{iconName}
</div>
<Icon iconName={iconName} key={iconName}/>
))}
</div>

0 comments on commit 1198129

Please sign in to comment.