Skip to content

Commit

Permalink
feat: add more palette customization options
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Dec 13, 2022
1 parent 7267013 commit 2794190
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/widget-embedded/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const App = () => {
secondary: {
main: secondary,
},
...widgetConfig.theme?.palette,
},
shape: {
borderRadius,
Expand Down
7 changes: 7 additions & 0 deletions packages/widget-embedded/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export const widgetBaseConfig: WidgetConfig = {
// fee: 0.05
},
},
// theme: {
// palette: {
// background: {
// paper: '#121212',
// },
// },
// },
tokens: {
featured: [
// {
Expand Down
3 changes: 2 additions & 1 deletion packages/widget/src/config/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => {
palette: {
mode,
...palette,
...(mode === 'light' ? paletteLight : paletteDark),
...theme.palette,
primary: {
main: primaryMainColor,
light: primaryLightColor,
Expand All @@ -135,7 +137,6 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => {
0.2,
),
},
...(mode === 'light' ? paletteLight : paletteDark),
},
shape: {
...shape,
Expand Down
5 changes: 4 additions & 1 deletion packages/widget/src/types/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export type HiddenUIType = `${HiddenUI}`;

export type Appearance = PaletteMode | 'auto';
export type ThemeConfig = {
palette?: Pick<PaletteOptions, 'primary' | 'secondary'>;
palette?: Pick<
PaletteOptions,
'grey' | 'background' | 'text' | 'secondary' | 'primary'
>;
shape?: Shape;
typography?: TypographyOptions;
};
Expand Down

0 comments on commit 2794190

Please sign in to comment.