Skip to content

Commit 3fb4810

Browse files
authored
Merge pull request #440 from weaveworks/433-proportionally-define-spacing
Proportionally define spacing
2 parents 0b6d100 + 50bda87 commit 3fb4810

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/theme/spacings.js

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
import { forEach } from 'lodash';
22

3+
const baseSpacingNumber = 16;
4+
35
export const spacing = {
46
none: '0',
5-
xxs: '4px',
6-
xs: '8px',
7-
small: '12px',
8-
base: '16px',
9-
medium: '24px',
10-
large: '32px',
11-
xl: '48px',
12-
xxl: '64px',
7+
// 4px
8+
xxs: `${baseSpacingNumber * 0.25}px`,
9+
// 8px
10+
xs: `${baseSpacingNumber * 0.5}px`,
11+
// 12px
12+
small: `${baseSpacingNumber * 0.75}px`,
13+
// 16px
14+
base: `${baseSpacingNumber}px`,
15+
// 24px
16+
medium: `${baseSpacingNumber * 1.5}px`,
17+
// 32px
18+
large: `${baseSpacingNumber * 2}px`,
19+
// 48px
20+
xl: `${baseSpacingNumber * 3}px`,
21+
// 64px
22+
xxl: `${baseSpacingNumber * 4}px`,
1323
};
1424

1525
// Collects all theme spacing vars as SCSS vars.

0 commit comments

Comments
 (0)