Skip to content

Commit

Permalink
feat: add more color themes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeovazero committed Jun 1, 2021
1 parent 07c5555 commit 4406a97
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const IconButtonStyled = styled(IconButton)`
}
:hover {
cursor: pointer;
background-color: lightpink;
background-color: hsl(68,90%,90%);
}
`

Expand Down
2 changes: 1 addition & 1 deletion src/components/Keys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const KeysStyled = styled(Keys)`
flex-direction: column;
align-items: center;
font-family: var(--fontFamilyPrimary);
color: var(--primaryLight);
color: var(--primary);
transition: color 1.25s ease;
font-weight: bold;
.keys__key {
Expand Down
30 changes: 14 additions & 16 deletions src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ export const FONT_FAMILY = {
secondary: '\'Pattaya\', sans-serif'
} as const

const lightColorFromHue = (hue: number) => `hsl(${hue}, 74%, 39%)`
const colorFromHue = (hue: number) => `hsl(${hue}, 79%, 28%)`

const colorTokens = (hue: number) =>
({
primary: colorFromHue(hue),
primaryLight: lightColorFromHue(hue)
}) as const

export const THEME = {
purple: {
primary: '#560F80',
primaryLight: '#781AAE'
},
red: {
primary: 'darkred',
primaryLight: 'red'
},
orange: {
primary: 'darkorange',
primaryLight: 'orange'
},
blue: {
primary: 'darkblue',
primaryLight: 'blue'
}
green: colorTokens(164),
blue: colorTokens(194),
purple: colorTokens(278),
pink: colorTokens(308),
red: colorTokens(338)
} as const

const isThemeColor = (t: string): t is ThemeColor => t in THEME
Expand Down

0 comments on commit 4406a97

Please sign in to comment.