Skip to content

Commit 6735b89

Browse files
committed
Make colors customizable
1 parent 7d4c61c commit 6735b89

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

packages/client/.env

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1+
# App metadata
12
APP_TITLE=STAC Manager
23
APP_DESCRIPTION=Plugin based STAC editor
4+
5+
# Api variables
36
REACT_APP_STAC_BROWSER=
4-
REACT_APP_STAC_API=
7+
REACT_APP_STAC_API=
8+
9+
## Theming
10+
# REACT_APP_THEME_PRIMARY_COLOR='#6A5ACD'
11+
# REACT_APP_THEME_SECONDARY_COLOR='#048A81'

packages/client/src/theme/theme.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { extendTheme } from '@chakra-ui/react';
22
import { createColorPalette } from './color-palette';
3+
import { adjustHue, setLightness, setSaturation } from 'polished';
4+
5+
const primary = process.env.REACT_APP_THEME_PRIMARY_COLOR || '#6A5ACD';
6+
const secondary = process.env.REACT_APP_THEME_SECONDARY_COLOR || '#048A81';
7+
const base = setSaturation(0.32, setLightness(0.16, adjustHue(48, primary)));
38

49
const theme = {
510
colors: {
6-
primary: createColorPalette('#6A5ACD'),
7-
secondary: createColorPalette('#048A81'),
8-
base: createColorPalette('#331A33'),
11+
primary: createColorPalette(primary),
12+
secondary: createColorPalette(secondary),
13+
base: createColorPalette(base),
914
danger: createColorPalette('#FF5353'),
1015
warning: createColorPalette('#FFC849'),
1116
success: createColorPalette('#46D6CD'),

0 commit comments

Comments
 (0)