Skip to content

[gatsby-plugin-theme-ui] How do you properly merge conflicting theme tokens? #184

Closed
@daydream05

Description

@daydream05

Description

I made a gatsby theme that uses the base theme presets and extends it a bit. When used on a parent theme that used a totally different set of design tokens, it breaks.

import childTheme from ‘child-theme/src/gatsby-plugin-theme-ui’
import merge from ‘lodash.merge’

const baseTheme

export default merge({}, childTheme, baseTheme)

For example, my child theme has a fontSize array of 7 items and my base theme has only 6. With the method above, my child theme breaks if it uses the last index and turns it into pixel since it doesn’t exist any more.

How would i go about designing/merging it in a way that my theme becomes portable?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions