Skip to content

Use deepmerge themes when overriding #36

@alexislightspeed

Description

@alexislightspeed

Description

Provide a high-level summary of your issue.

return <ThemeProvider theme={{ ...selectedTheme, ...themeOverrides }}>{children}</ThemeProvider>;

Rather than spreading both objects together, use deepmerge so that a new theme may extend the ThemeUI without fully overriding the original theme.

What do you think should have happened?

The color would be deepmerged. Instead the color is overwritten by the ThemeOverride

Steps to reproduce the problem

const existingTheme = {col:{blue:'blue'}};
const newTheme = {col:{red:'red'}};
const mergedTheme = {...existingTheme, ...newTheme};
console.log(mergedTheme);
:rip:

Specifications

  • Affected component(s): Core / FlameTheme

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions