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

Added more spacing tokens #2220

Merged
merged 3 commits into from
Feb 14, 2024
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
5 changes: 5 additions & 0 deletions .changeset/curly-worms-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/tokens': minor
---

Adds additional spacing tokens
12 changes: 1 addition & 11 deletions packages/tokens/src/Tokens.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,12 @@ const gutter = css`
margin-left: ${spacing[3]}px;
`;

const colors = [
'#fb4949',
'#497ffb',
'#62e3fd',
'#52c825',
'#fdd063',
'#fd7fec',
'#a5fd8b',
];

const spacingBlockVariants = Object.keys(spacing)
.filter(num => Number(num) === 0 || Number(num) > 25)
.reduce((acc: Partial<Record<keyof typeof spacing, string>>, index, idx) => {
const key = index as PropertyKey as keyof typeof spacing;
acc[key] = css`
background-color: ${colors[idx]};
background-color: ${palette.purple.light2};
width: ${spacing[key]}px;
height: ${spacing[key]}px;
`;
Expand Down
4 changes: 4 additions & 0 deletions packages/tokens/src/spacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const spacing = {
200: 8,
300: 12,
400: 16,
600: 24,
800: 32,
1200: 48,
1600: 64,

/** @deprecated use 100 instead */
1: 4,
Expand Down
Loading