Skip to content
This repository was archived by the owner on Mar 14, 2021. It is now read-only.

Commit a84ffcc

Browse files
author
Andrey Okonetchnikov
committed
fix: Update Colors and Typography layouts. Fine tune theme.
1 parent d8695bc commit a84ffcc

File tree

6 files changed

+40
-31
lines changed

6 files changed

+40
-31
lines changed

src/components/ColorSwatch.jsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,23 @@ export const ColorSwatch = ({ value, token }) => {
1111
"rgba(255, 255, 255, 0.75)"
1212
);
1313
return (
14-
<Swatch
15-
token={token}
16-
value={value}
17-
css={css({
18-
p: 3,
19-
py: 4,
20-
bg: value,
21-
overflow: "hidden"
22-
})}
23-
>
24-
<SwatchToken color={color}>{token}</SwatchToken>
25-
<SwatchValue color={color}>{value}</SwatchValue>
14+
<Swatch token={token} value={value}>
15+
<div
16+
css={css({
17+
py: 5,
18+
bg: value
19+
})}
20+
/>
21+
<div
22+
css={css({
23+
p: 3,
24+
bg: value,
25+
overflow: "hidden"
26+
})}
27+
>
28+
<SwatchToken color={color}>{token}</SwatchToken>
29+
<SwatchValue color={color}>{value}</SwatchValue>
30+
</div>
2631
</Swatch>
2732
);
2833
};

src/components/Colors.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export default function Colors({ theme }) {
1313
<Stack gap={gap}>
1414
<Swatches theme={theme} items={palettes}>
1515
{(key, value) => (
16-
<Stack gap={0} minWidth={50}>
16+
<Stack gap={0} minWidth={100}>
1717
<PaletteSwatch token={key} value={value} />
1818
</Stack>
1919
)}
2020
</Swatches>
21-
<Stack gap={gap} minWidth={50}>
21+
<Stack gap={gap} minWidth={150}>
2222
<Swatches theme={theme} items={colors}>
2323
{(key, value) => <ColorSwatch token={key} value={value} />}
2424
</Swatches>

src/components/SwatchToken.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ function SwatchToken({ color = "text", css: componentCSS, ...rest }) {
77
css={css({
88
m: 0,
99
fontFamily: "body",
10-
fontSize: "md",
10+
fontSize: "sm",
11+
fontWeight: "normal",
1112
color,
1213
...componentCSS
1314
})}

src/components/SwatchValue.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function SwatchValue({ color = "secondary", css: componentCSS, ...rest }) {
77
css={css({
88
m: 0,
99
fontFamily: "monospace",
10-
fontSize: "sm",
10+
fontSize: "xs",
1111
color,
1212
...componentCSS
1313
})}

src/components/Typography.jsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,25 @@ import {
1212
export default function Typography({ theme }) {
1313
return (
1414
<ThemeProvider theme={theme}>
15-
<Stack gap={2}>
15+
<Stack gap={5}>
1616
<Swatches theme={theme} items={theme.fontSizes}>
1717
{(token, value) => (
1818
<Swatch token={token} value={value}>
19-
<Stack gap={4} gridTemplateColumns="minmax(auto, 10rem) 1fr">
20-
<div
21-
css={css({
22-
alignSelf: "center",
23-
overflow: "hidden"
24-
})}
25-
>
26-
<SwatchToken>{token}</SwatchToken>
27-
<SwatchValue>{value}</SwatchValue>
19+
<Stack gap={2}>
20+
<div>
21+
<SwatchToken css={{ display: "inline-block" }}>
22+
{token}
23+
</SwatchToken>{" "}
24+
<SwatchValue css={{ display: "inline-block" }}>
25+
({value})
26+
</SwatchValue>
2827
</div>
29-
<FontSizeSwatch token={token} value={value}>
30-
Aa
28+
<FontSizeSwatch
29+
token={token}
30+
value={value}
31+
css={css({ color: "text" })}
32+
>
33+
The quick brown fox jumps over the lazy dog
3134
</FontSizeSwatch>
3235
</Stack>
3336
</Swatch>

src/theme.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const palette = {
1414
};
1515
export default {
1616
fontSizes: {
17-
xl: scale(2),
17+
xl: scale(3),
1818
lg: scale(1),
1919
md: scale(0),
2020
sm: scale(-0.5),
@@ -41,7 +41,7 @@ export default {
4141
text: palette.slate.base,
4242
background: palette.slate.lightest,
4343
primary: "#E53935",
44-
secondary: palette.slate.lighter,
45-
muted: palette.slate.lightest
44+
secondary: palette.slate.light,
45+
muted: palette.slate.lighter
4646
}
4747
};

0 commit comments

Comments
 (0)