Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Can't add custom colors to colorScheme? #2353

@ktmn

Description

@ktmn

For example, there is no purple color. I'm trying to add it like this:

const theme = {
  siteVariables: {
    colorScheme: {
      purple: {
        foreground: '#A333C8',
      },
    },
  },
};

And using it with the Provider like this:

<Provider theme={mergeThemes(themes.teams, theme)}>...</Provider>

Now siteVariables.colorScheme.purple.foreground is indeed the specified color.

But when I go to use it with a segment:

<Segment color='purple'>...</Segment>

I don't get the purple color.

This should resolve the color:

const colors = getColorScheme(v.colorScheme, p.color)

and use it here:

...(p.color && { borderColor: colors.foreground }),

but there's a limit here:

export const availableColors = [
'default',
'black',
'white',
'brand',
'grey',
'red',
'yellow',
'green',
'pink',
'orange',
]

which prevents using the custom named color. Why is that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions